• AVR Freaks

H2.06: SPI Interrupt Mode Clarification

New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2015/08/20 14:16:52
  • Location: 0
  • Status: offline
2018/12/23 10:33:23 (permalink)

H2.06: SPI Interrupt Mode Clarification

I am currently writing an application which communicates with the LTC1856 ADC and I'm curious about some of the finer points of SPI Interrupts concerning the Harmony framework.
When "Interrupt Mode" is selected in the MPLAB Harmony Configurator, interrupt priority selection is provided.  The chip that I'm using necessitates a simultaneous write/read, therefore I would expect that both TX and RX occur at the same time.  How is this handled with interrupts?  Why would I need two interrupts for the same operation? 
From the Harmony Reference, Volume V, I gathered that enabling interrupt mode simply ensures that the Task function is called immediately rather than handled in the main while(1) loop.  To me, this means that I would expect one interrupt, while in the picture attached, I see three (Tx,Rx,Err).

Attached Image(s)

Super Member
  • Total Posts : 310
  • Reward points : 0
  • Joined: 2016/03/11 22:47:59
  • Location: 0
  • Status: offline
Re: H2.06: SPI Interrupt Mode Clarification 2019/01/06 13:35:25 (permalink)
In general - for SPI the write bits out to MOSI happens with the same clock as the read bits into MISO. There is no interrupt involved between the MOSI and MISO portion.
The interrupt comes into play when you say write, then go off to other things, then the write completes and you get an interrupt saying that the write is complete.
That's how I understand it...
Superb Member
  • Total Posts : 9999
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: H2.06: SPI Interrupt Mode Clarification 2019/01/06 14:50:33 (permalink)
Of course, things get a bit more complicated when you have FIFO buffers on the write and read.
The OP has not mentioned which PIC part they are using.

Nearly there...
Jump to:
© 2021 APG vNext Commercial Version 4.5