KurtE / FlexIO_t4

Teensy 4 beta - WIP Flex IO support including Serial
MIT License
25 stars 18 forks source link

Unexpected behavior when compiling for CPU speed less than 600Mhz #9

Closed david-res closed 3 years ago

david-res commented 3 years ago

I've setup FlexIO2 on a Teensy Micromod to output data on an 8 bit parallel bus. When my test sketch/app sketch is compiled for a CPU speed of 600MHz the data is outputted as expected and the Write Strobe pin pulses correctly as it is driver by Timer0 when shiftbuf0 is loaded. In the image below four 8 bit values are being pushed out correctly image

When I compile the same sketch for any CPU speed lower than 600Mhz (tried 528,450,396) the Write Strobe pin driven by timer0 starts do pulse before the data is transferred from the shifter buffer to the shifter. In the image below the "empty" pulse is seen when the shifter buffer is loaded image

I don't know if this issue is related directly to the library, but I figured as I am using the library to manage the FlexIO instance I'll open it here. I also have a thread on PJRC

Attached is the Demo app

FlexIO_8bit_demo.zip

KurtE commented 3 years ago

Not really sure, but will throw out some darts on forum thread

david-res commented 3 years ago

Fixed - FlexIO clock will work @480 Mhz but only with CPU at 600Mhz or above To run on a lower CPU clock speed, FlexIO clock needs to be set at a max of 240Mhz