Hi!
I would like to connect an ADS1256 to a C6713 DSK. For this purpose i use the McBSP0.
Im now not shure how i need to configure the McBSP.
How is the Read Data Continuous Mode of the ADS1256 exactly working? The description on Page 35 of the datasheet are not very detailled.
My understanding of this mode is the following:
When i have sent the RDATAC command, the adc wil go into Read Data Continuous mode. It will start to convert, when its finished the DRDY Signal will go low. Now I need to set CS low und clock 24 Bits out of the adc.
If this is the correct, it's not that easy to interface this adc with the 6713 DSK.
I would need to connect the DRDY Signal to an external Interrupt pin and make alle the recieving manually in the external ISR. This can't be the right way.
Can anyone advise me how to set all these things up? At the end i just want an interrupt in the C6713, when there is a new sample to process.
Hi Hans,
You've got the basic flow for this correct. There is a code example for the ADS1256 using the TMS320C6713 here:
http://e2e.ti.com/support/data_converters/precision_data_converters/w/design_notes/1227.aspx
The program uses mapping of an external interrupt through the EDMA. See if that helps you get your project going and let us know how you make out.
Regards,
Tom
Hi Tom!
Thanks for posting this example! Verry interessting, though, I dont see clearly through how it works.
As I dont need to process whole blocks of samples, EDMA has no advantage in my case.
So I think I'll use the EXT_IN6 Pin on the Peripheral Expansion Connector und trigger this Interrupt with the DRDY Signal of the ADC. In the ISR of this Interrupt, I process the last sample, read in the new one, and leave the isr. So, the adc triggers all the processing on the dsp.
Thanks for your help, I will let you know if if was successfull.
So now I have tried out really to communicate with my ADS1256.
For this purpose I studied the provided example.
What I dont unterstand ist the way which an McBSP can be used to communicate in real SPI style.
Clock Stop, and FrameSync concepts are clear.
In my understanding, for example if I want to have one single conversion result, I do the following steps:
1.bring CS down
2.Clock out the Command to obtain one sample to the adc
3. wait a short time
4.clock the converted data out of the ADC
5.bring CS up
This is one communication frame as described in the ADS datasheet and is normally an SPI Com works.
How is this behaviour possible with the McBSP and the CSL ?
I have succesfully written out data with the MCBSP_write(adcSPIHandle, ADS1256_CMD_RDATA); command. So far so good.
But how does this work together with the described communication pattern? This command only clocks out 8 bits then brings CS high again.
In this way, there is no possiblity to clock out the wanted 24 bits.
If we lock at the example code:
(void)SetWordLength(adcSPIHandle,ADS1256_WORDLENGTH_8BIT); /* send read data command to the converter */ while (MCBSP_FGETH(adcSPIHandle, SPCR, XRDY) != 1) ; MCBSP_write(adcSPIHandle, ADS1256_CMD_RDATA); /* receive the dummy word from the converter */ while (MCBSP_FGETH(adcSPIHandle, SPCR, RRDY) != 1) ; (void)MCBSP_read(adcSPIHandle); (void)SetWordLength(adcSPIHandle,ADS1256_WORDLENGTH_24BIT); DSK6713_waitusec(50);
/* send "no command" to read conversion result */ while (MCBSP_FGETH(adcSPIHandle, SPCR, XRDY) != 1) ; MCBSP_write(adcSPIHandle, 0x00000000u); /* retrieve the conversion result from the converter */ while (MCBSP_FGETH(adcSPIHandle, SPCR, RRDY) != 1) ; data = (long)MCBSP_read(adcSPIHandle);
It looks like a silly workaround to get the McBSP to funtction in a real SPI way.
I dont see why this even works, because the writing und reading back functions are separated.
It would really appreciate if someone could explain this to me. Thanks a lot!