Other Parts Discussed in Thread: ADS127L01
Tool/software: Code Composer Studio
Hi Folks,
I am having trouble reading data from a 24 bit ADC (ADS127L01) using SPI. I originally set up using module 3 but switched to module 0 to see if that helped anything. It did not. The ADC pulls a pin (digital ready, DRDY) low when data is ready so I am trying to trigger ADC reads using a GPIO based interrupt. I need to collect data at 250 kHz, so I set up to collect the 24 bits of data at 8 MHz. On my scope, I can see the GPIO toggle. The GPIO interrupt service routine sets a flag called triggerADC that seems to be working (discussed below):
void DRDYIntHandler(void){ // initiate ADC data transfer
GPIOIntClear(GPIO_PORTE_BASE, GPIO_INT_PIN_1);
triggerADC = true;
}
In the main loop, I have the following code:
if(triggerADC == true){
uint8_t i = 0;
for (i = 0; i<3; i++){
SSIDataGet(SSI0_BASE, &dataPoint[i]);
}
triggerADC = false;
}
The problem is that I do not see the SCK pin toggle when I try to read data. If I replace the SSIDataGet with a SSIDataPut command, then the SCK pin does toggle, giving the expected three sets of eight pulses at the expected frequency. That indicates that the ISR is working and the flag is being set and cleared when I want it. I have also tried reading a single value (not using the for(int i ...) loop) but that does not work either. I have also tried reading using the non-blocking command but that did not work.
I suspect I am missing something pretty simple about the SSIDataGet command but I just do not know what it is. Any help will be appreciated.
Thanks,
Jack