Other Parts Discussed in Thread: ADS8332, , TMS320F28335
hello.
some one send me the sample code for external ADC (ADS8332) with TM4C123gh6pm, and SPI code also
Thank you.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
hello.
some one send me the sample code for external ADC (ADS8332) with TM4C123gh6pm, and SPI code also
Thank you.
I don't have an example interfacing to that ADC converter, but I do have a more generic example of using the SPI. Download TivaWare and see the example in "C:\ti\TivaWare_C_Series-2.1.4.178\examples\peripherals\ssi\spi_master.c". For the ADS8332 change the transfer size to 16 bits and use SSI_FRF_MOTO_MODE_2, polarity = 1, phase = 0.
SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_2, SSI_MODE_MASTER, 1000000, 16);
I will push this to the ADC forum to see if they have anything to add.
Hi,
1. Keep the ADC in auto channel selection mode. Set the timer interrupt for 1 mS. Initialize GPIO interrupt for End of conversion pulse.
2. In ADS833x_init() do not read back and compare the register , just write the register.
3. Send the start of conversion to ADC in 1 mS timer interrupt. But add some intelligence (like flag) to conform that all the SPI initialization and ADC initialization has been completed before start of conversion pulse.
4. ADC will generate EOC which will trigger GPIO interrupt. Read the ADC count in GPIO interrupt by sending 16 clock pulses. After that reset the GPIO interrupt.
5. Using SSIDataput() and SSIDataGet() (Tiva ware library) is advisable rather than SPI_transfer() (RTOS library).
6. After few iteration of 1 mS timer put the ADC in manual channel select mode by using ADS833x_WriteRegister(). And you can select any channel using ADS833x_Channel_Select().
Regards,
Digvijay