Hi all,
I am trying to take continuous data from ADS1298, I successfully write and read to Status registers of ADS1298 via SPI. Now I am trying to get three package data (each have 9 frames with 24-bit word length, means one status and 8 channel data) and store the data into a register.
In ECG_NonBios source code there is an interrupt routine int1_isr and C5515 is interrupted after a low signal (DRDY from ADS1298) come to INT1. However I cannot read anything, I put a printf command inside ISR but there is nothing printed on the console. Below is my main function with interrupt routine, they are all in a .c file. I am new to this interrupt issue, if you can advice any source I will appreciate. My development platform is EVM5515 and code CCS Version: 4.1.0.02002 (that is coming with the EVM).
Thank you all in advance.
***.
void main(void)
{
AllInit();
spi_init();
asm("\tBIT (ST1, #ST1_INTM) = #0"); /*Enable GLobal Int.Mask*/
//
/* Start the Timer0*/
CSL_TIM_0_REGS->TCR = CSL_TIM_0_REGS->TCR | 0x0001;
//
// /*Enable INT1 interrupt */
CSL_CPU_REGS->IER0 = CSL_CPU_REGS->IER0 | 0x1008;
}
interrupt void int1_isr()
{
Uint32 SPIBuf[MAXCHAN+2] = {0}; /* SPI Rx Buffer*/
Uint32 ECGDataSample[MAXCHAN]={0};
Uint16 fLen = 0; /* No. words to be read*/
Uint16 wLen = 0;
Uint8 col = 0;
static Int16 LeadAray[8] = {2,3,8,4,5,6,7,1}; // PG 2.0
/* Read data- continuous mode */
fLen = 9;
wLen = 24;
if(even_flag==8)
CSL_CPU_REGS->IER0 = 0x0000;
/*Reading data from ADS1298 */
LLC_SPI_WordLengthRead_v1(SPIBuf,wLen,fLen);
even_flag++;
for ( col =0; col < MAXCHAN; col++)
{
ECGDataSample[col] = SPIBuf[LeadAray[col]];
ECGDataSample[col] = ECGDataSample[col] >> 4;
spiReadBuff[(9*even_flag)+col] = ECGDataSample[col];
printf("ECGDataSample: %x \n",ECGDataSample[col]);
}
return;
}