by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Mehrdad K
@mkeyno
I did it with teensy 2.1 and SD card ,
the approach is the same
maybe its due to DMA feature of teensy
Shelby Merrick
@forkineye
isn't FastLED just bit banging?
Mehrdad K
@mkeyno
not this code use APA102 which is use software SPI
bitbang so slow compare to Data-clock type LED chip
Shelby Merrick
@forkineye
ah
i just took a quick look at the clockless code from them and seemed to be bit-banging at first glance. didn't know you were using a clocked one
Mehrdad K
@mkeyno
this code work on the teensy very well , but I didn't know ESP can't handle it
I also disable wifi but no change
Shelby Merrick
@forkineye
how many files you have? each open has to scan SPIFFS
Mehrdad K
@mkeyno
for this test only 3 and as you may checked I've just open new file when duration show passed and after reading the total image line just back to beginning the file FILe.seek(0, SeekSet);
do you think ESP can read about 2Mbyte per second along with process other instructions
SteveToulouse
@SteveToulouse

I just ran a test using a 3144 byte read buffer. I get a very stable 1.2MByte/s (M=10241024) when reading a whole 2MBytes file.
Using a 16KB (K=1024) buffer I get a stable 2MBytes.

But I'm just open,read all,closing. No seeks or anything in there.

Mehrdad K
@mkeyno
how to set the specific buffer
16kB buffer is pretty high
specially when you need more room for other process such as wifi services
@SteveToulouse can you test my code with your presumption
Mehrdad K
@mkeyno
File FILe;
void loop() {


  if(SHOW)
      {
        if( (millis()- OpenlastTime) > DURATION[image_index]*1000L )
        {
          FILe.close();
          image_index++; 
          if(image_index>IMAGE_NUM)    image_index=0;          
           Serial.print(F(" i="));  Serial.print(image_index); 
          Serial.print(F(" New Image="));  Serial.print(IMAGES[image_index]);
          Serial.print(F(" duration="));  Serial.println(DURATION[image_index]);

           FILe=SPIFFS.open("/SHOW/"+IMAGES[image_index], "r");
          if(!FILe) Serial.println("FILE NOT OPEN");
          OpenlastTime=millis();
          Current_imageLine = 0;
        }
        if(!Start_new_round && (micros()-lastLineShow)> lineInterval)
        {
        int i = 0; 
           while( (i < NUM_LEDS*3) && FILe.available())
          { 
               i += FILe.readBytes( ((char*)leds) + i, (NUM_LEDS*3)-i);
            }

        FastLED.show(); 
        lastLineShow=micros();     
        Current_imageLine++;                                        
        }
       {read_line(Current_imageLine++,image_index); FastLED.show(); lastLineShow=micros(); }
          if(Current_imageLine >= IMAGES_LINES)   
          { 
            Serial.print("[frame]"); Serial.println((micros()-lastFrameShow));
            Current_imageLine = 0;
            lastFrameShow=micros(); 
            Start_new_round=false; 
            FILe.seek(0, SeekSet);

           } 

      }

}
Clemens Kirchgatterer
@everslick
can I assume GPIO2 to be unused by default or is the core sending something over that TX1 ?
Me No Dev
@me-no-dev
it's always Serial TX on boot
so while the bootloader is running, it's sending the same data as on serial 0
Clemens Kirchgatterer
@everslick
ok, thats killing my RTC that is connected there :-(
Me No Dev
@me-no-dev
are you using it for SCL?
Clemens Kirchgatterer
@everslick
lemme check
no, it's SDA
Me No Dev
@me-no-dev
should not be an issue then...
Clemens Kirchgatterer
@everslick
SCL is GPIO4
Me No Dev
@me-no-dev
what is the RTC?
Clemens Kirchgatterer
@everslick
DS3231
Me No Dev
@me-no-dev
always worked fine for me
are you sure that is what is killing your RTC?
maybe power?
Clemens Kirchgatterer
@everslick
not quite, it used to work on GPIO5 and GPIO14
then i moved it to GPIO4 and 2 and now it does not respond anymore
formerly i tried to share the clock with a SPI device, but that did not work
so i rearranged them
Clemens Kirchgatterer
@everslick
should i try sharing SDA with MOSI ?
Clemens Kirchgatterer
@everslick
somebody on stackexchange suggested to wire CLK to SDA and MOSI to SCK, because that would avoid bitcombinations on i2c that could be misinterpreted
that would even spare me a full GPIO pin
Me No Dev
@me-no-dev
have not thought about it that way..
can't come up with answer without some serious thinking. Surely takes less to give it a go :P
Clemens Kirchgatterer
@everslick
hehe - indeed. but first comes lunch! :-P
Martin Ayotte
@martinayotte
@everslick , I'm using Wire on GPIO0/GPIO2 without any issue for more than a year.
Clemens Kirchgatterer
@everslick
hmm, i have my own bitbanging code. maybe Wire does something to switch of serial?
Martin Ayotte
@martinayotte
it is doing pinMode(GPIOx, INPUT_PULLUP) right at the beginning.
Clemens Kirchgatterer
@everslick
yeah, but it does not switch off any debugging output in the core neither.
@martinayotte do you have SDA or CLK on GPIO2 ?
Martin Ayotte
@martinayotte
According to my sketch and wiring, I'm doing Wire.begin(0, 2), so it is wired as SDA=GPIO0 and SCL=GPIO2.
Both with external pullups.