Hi,
I'm trying to control a programmable LED using the iMXRT1050 while iMXRT1050 is transferring USB data. I first tried using simple GPIO switching, but the data gets corrupted due to the USB'S processing interrupts.
So I tried to utilize FLEXIO SPI eDMA sample from the SDK(evkbimxrt1050_flexio_spi_edma_lpspi_transfer_master) and set GPIO_B0_13 as MOSI.
When I do this, there's no clear interrupt like the above, but there's a slight delay between the 2nd and 3rd signal, which throws off the LEDs.
The frequency of the switching signal is 8kHz so the period should be 120us.
This delay happens even without any other processing in the MCU, which shouldn't matter since it's using eDMA.
Is there anything that I should lookout for which causes the delay every 2 cycle in FLEXIO SPI eDMA?
Best regards,
Hi,
What is the flexio clock frequency you are using? I would recommend increasing it to see if it helps using clock dividers and predividers.
Also, do you see same behavior using different frequency than 8 KHz?
Best regards,
Felipe
Hi Felipe,
I tried increasing the clock frequency but it's still the same. different frequencies lead to different timing in delay, but the delay still happens.
Do you think using a dedicated SPI pin is more immune to any interrupts or delays compared to FLEXIO SPI eDMA?
I am using D10(GPIO_B0_13) now but maybe using C10(GPIO_B0_12/LPSPI4 SDO) could help regarding this?
Best regards
Brian
Hi Brian,
If the SPI is getting interrupted when the transmission is done I think using SPI module will not change that, you will need to control that in your applications. If you see some delays with no other process running then I will try using SPI module instead of FlexIO or using other pins.
Best regards,
Felipe