Hi
Im using the 1224 and the ADS1271. The 1271 drives a pin low when the data is ready and notifies the MCU to get that data. Im my board that pin is the pin 55 (it can generate an interrupt when driven low.)
Unfortunately for me, my only experience with interrupts is from PICs so...
The idea is that when the pin is driven low, the SPI starts receiving the data from ADC.
So here are my questions:
1) I have this:
_enable_IRQ();
gioInit();
gioEnableNotification(gioPORTB,2);
but how do I know that the interrupt on channel 9 arrived so I can start getting the data?
I mean: if(interrupt_on_channel_9==1)
get_data_from_spi
2) The SPI has a 16bits buffer but the ADS has a 24 buffer. I read on another post that I could have 2 transmissions from the ADS in order to get all the data. But how could I do that?
3) I saw the example provided by Halcogen and saw this:
spiDAT1_t dataconfig1_t;
dataconfig1_t.CS_HOLD = FALSE;
dataconfig1_t.WDEL = TRUE;
dataconfig1_t.DFSEL = SPI_FMT_0;
dataconfig1_t.CSNR = 0xFE;
/* Enable CPU Interrupt through CPSR */
_enable_IRQ();
/* Initialize SPI Module Based on GUI configuration
* SPI1 - Master ( SIMO, SOMI, CLK, CS0 )
* SPI2 - Slave ( SIMO, SOMI, CLK, CS0 )
* */
spiInit();
/* Initiate SPI2 Transmit and Receive through Interrupt Mode */
spiSendAndGetData(spiREG2, &dataconfig1_t, 16, TX_Data_Slave, RX_Data_Slave);
I don't understand why the first lines if I'm configuring that from HALCOGEN
and the last line I need to change it but I dont get what the dataconfig1_t is...
And, as you can see the on the line below, what is the destbuff?? that means I could have there the 24 bit buffer??
void spiGetData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * destbuff);