I am failing in my effort to enable a LM3S811 to control an ADS8508 (EVM) 16 bit ADC, via the SPI port.
The object is to trigger and take a reading from the ADC, as required under program control.
I am using CCS Ver: 4.2.3.00004 and the Stellaris® Peripheral Driver Library.
Here are the hardware settings and program listings that I use.
readADS8509(), is called every 2 milliseconds, but the DATA is always high.
Since this is my first attempt at the SSI I could be missing something, or because of the problems
I had with the ADS8508EVM documentation I could have blown the chip.
Any help would be appreciated.
Earl
//=========================================================================================
ADS8509 I/O
Inputs:
TAG pulled low
Ext/Int pulled high
PWRD pulled low
CS pulled low
SB/BTC pulled high
R/C connected to SSIFss, 1uS every 2mS
DATACLK connected to SSIClk, 17 500nS pulses starting on the leading edge of the SSIFss pulse
Outputs:
SYNC same as the SSIFss pulse
BUSY at the trailing edge of SSIFss, goes to ground for 2uS
DATA connected to SSIRx, ALWAYS HIGH
//==========================================================
void
ConfigSSI(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 | GPIO_PIN_2);
// Configure and enable the SSI port for TI master mode.
//Use SSI0, system clock supply, master mode, 1MHz SSI frequency, and 16-bit data.
SSIConfigSetExpClk( SSI0_BASE,
SysCtlClockGet(),
SSI_FRF_TI, //data transfer protocol
SSI_MODE_MASTER, //mode of operation.
1000000, //clock rate
16); //number of bits transferred per frame.
SSIEnable(SSI0_BASE);
}
void
readADS8509(void)
{
SSIDataPut(SSI0_BASE, 0);
g_ulADC_In = 10;
while(SSIDataGetNonBlocking(SSI0_BASE, &g_ulADC))
{
++g_ulADC_In;
}
}