Is it OK to do SPI inside an interrupt procedure?

bgoolsby
 
Avatar
 
Subject:

Is it OK to do SPI inside an interrupt procedure?

 · 
Posted: 05.02.2014 - 21:51  ·  #1
Using an Xmega chip, I want to have periodic interrupts and communicate with an SPI device inside the interrupt procedure. Is this OK? Do the SPI low-level drivers use interrupts?
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Is it OK to do SPI inside an interrupt procedure?

 · 
Posted: 06.02.2014 - 00:51  ·  #2
Hello,

the XMega SPI doesn't use or change interrupts.
So the SPI can be used within interrupts. But please note that the SPI driver
can not be reentrant, this means only in this interrupt this SPI can be used.

rolf
bgoolsby
 
Avatar
 
Subject:

Re: Is it OK to do SPI inside an interrupt procedure?

 · 
Posted: 06.02.2014 - 15:36  ·  #3
I actually want to use 2 SPI devices. One is an SD card on, say, the SPI_C port. Could I still use SPI_D inside the interrupt procedure, since this is on a different port?
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Is it OK to do SPI inside an interrupt procedure?

 · 
Posted: 06.02.2014 - 18:46  ·  #4
these twi SPIs are completely separated and have nothing to do with each other SPI.
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   79   93 · Page-Gen-Time: 0.063056s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI