- This topic has 1 reply, 2 voices, and was last updated 8 years, 2 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › PIC interrupts
How do you stop an interrupt from happening in the middle of an SPI read?
I have an ADC which uses the SPI bus. But it shouldn’t be stopped once it begins reading the value, since this is the method it uses to clear the internal shift register to begin a new conversion.
The problem is I need to stop the timer exaclty when the inerrupt happens, whenever it happens. Is there some way to get around this? Or can I resume reading the ADC from where it left off? Say only 12 of the 16 bits were read in and the interrupt is called, will this corrupt the data being read?
Before start SPI communication, disable the global interrupts and after done with the SPI communication enable the global interrupts.