Handling single SPI in main routine and interrupt

Status
Not open for further replies.

smartshashi

Member level 4
Joined
Aug 11, 2004
Messages
68
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
513
I am using single SPI port for FRAM & Flash. While using SPI in main if interrupt occurs & if interrupt uses same SPI port for read/write FRAM or FLASH collision occurs.

Please suggest the solution to solve this problem.
 

This is basically a matter of your application design. If you require SPI to be used from both program domains, then the specific interrupt, that does SPI IO has to be disabled during an atomic SPI access, or the SPI action in interrupt has to be delayed (e. g. according to a metaphore respectively a flag) during the main program SPI access and rescheduled afterwards.

It's an everyday programming problem, to my opinion.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…