cancel
Showing results for 
Search instead for 
Did you mean: 

TIMER Interrupt and Other Interrupt

vbesson
Senior

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 

 

8 REPLIES 8
TDK
Guru

> 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.

If you feel a post has answered your question, please click "Accept as Solution".

Well systick has a priority of 15 and my TIMER a priority of 0 

so It might be something else

 

Andrew Neil
Evangelist III

@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 ...

A priority of 0, although numerically lower, is a higher priority than 15. That's it. Swap them.

If you feel a post has answered your question, please click "Accept as Solution".

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


@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 

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

 

> 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.

If you feel a post has answered your question, please click "Accept as Solution".