Part Number: CC2650
Hello
Does TI have any example of using SPI DMA in callback mode.
Below is a description of my problem -
I have to sense two ADC pins sequentially and store the data to the on board flash. To do this, I understand the I have to open an ADC channel -> take a reading and store in flash -> close channel -> open new channel and repeat process. Example of commands below
adc = ADC_open(Board_ADCBufChannel0, ¶ms);
res = ADC_convert(adc, &adcValue1[1]);
ExtFlash_write(flash_addr+ 2*i, 2, (uint8_t*)&adcValue1[1]);
ADC_close(adc);
Unfortunately the open and closing of ADC channels and flash write takes a long time and I am only able to get a sampling frequency of 5KHz . I realized that the flash write was using SPI DMA in blocking mode. I changed this to callback mode, threw in a callback function but cannot get the code to execute well... mostly because of my limited FW experience :)
So a few questions here.
1. Is my algorithm above the best way to accomplish my task. Should I be saving a chunk of ADC data from two channels to RAM and then transfer from RAM to FLASH. But even this would need the RAM to FLASH transfer to be handled by SPI DMA in callback mode while CPU continues to read ADC channels.
2. Is there an example of SPI DMA is callback mode that would help me get started.
Thanks
Raghu