2024-08-22 01:36 PM
Hello All,
I am progressing toward my goal.
I am bit banging a GPIO port every 2 uS based on a Byte buffer. I can not use SPI because I need to send a predefine number of bit that is not 8 aligned.
So I use a timer and every UIF event I reset the GPIO and every CC2F I set or not based on the bit.
Everything is almost working well except that using a logic analyser I have time to time delay in the bit banging.
I think it is due to other interrupts, I have already disabled the DMA and the SDIO but still I have delay.
I am using VSCode on Mac with CubeMX, how could I know which interrupt is causing delay
Except disabling one by one, I do not see how to do it
Thanks
Vincent
2024-08-22 02:15 PM
> how could I know which interrupt is causing delay
Look at the interrupts you have enabled which are same or higher priority than the one you process UIF in. Probably SysTick is causing it.
2024-08-22 02:46 PM
Well systick has a priority of 15 and my TIMER a priority of 0
so It might be something else
2024-08-22 03:38 PM
@vbesson wrote:I can not use SPI because I need to send a predefine number of bit that is not 8 aligned.
You might still be able to use SPI - just set the excess bits to whatever the line idle state is ...
2024-08-22 04:25 PM
A priority of 0, although numerically lower, is a higher priority than 15. That's it. Swap them.
2024-08-22 09:38 PM
0 is the timer and 15 is the systick so normally the timer will preempt and be executed with no delay right even on systick interrupt ? Wdyt. ?
andrew the spi use D a circular buffer how do you send let say 129 bits without 7 zero padding ?
thanks
vincent
2024-08-23 02:18 AM
@vbesson wrote:how do you send let say 129 bits without 7 zero padding ?
You don't have to zero pad - you could pad with ones instead.
whatever is the line idle state
2024-08-23 03:02 AM
Well, I do not think it will work because, I am building a floppy simulator and data sector can be across the the end of the beginning of the circular buffer and the bit number is really important,
At the end of the buffer I can not add any bits to pad a non 8 bits Bytes, this is why I am using bit banging.
If you have better approach. (Btw I solved my interrupt issue)
Vincent
2024-08-23 06:37 AM
> 0 is the timer and 15 is the systick so normally the timer will preempt and be executed with no delay right even on systick interrupt ? Wdyt. ?
You are correct. I misread. You can still get jitter of a few cycles, but shouldn't be at play here.