Part Number: ADS131E04
Hello,
I'm using ADS131E04 connected with a PIC32MZ microcontroller, but I'm facing some problems to use the SPI Interface to initialize and control the device. I'm following the Startup Procedure described in Application Information section (Sec. 10.1.2) using as settings:
- CLKSEL = 1 to use the internal oscillator master clock;
- PWNDN and RESETN not controlled (and fixed to 3.3V so always = 1)
- SCLK = 1 Mhz
I initialized the device stopping conversion (driving START = 0) and waited tPOR for the fCLK = 2.048 Mhz used as master clock before to initialize the SPI Interface. After that I sent the RESET command but SPI Interface blocks and continue to send commands only if I power off the ADC (Micro and ADC are on two different boards, so two different power supplies).
This is what I got with an analog discovery device:
This is my initialization code
void APP_Initialize ( void )
{
/* Place the App state machine in its initial state. */
appData.state = APP_STATE_INIT;
/* Wait an initial time for power-up */
/* F_clk = 2.048 Mhz */
/* t_clk = 0.488 us */
/* tPOR = 2^18 * t_clk = 127926 us */
ADC_StaticDelay(130000);
ADC_START_LOW();
/* TODO: Initialize your application's state machine and other
* parameters.
*/
}
void APP_Tasks ( void )
{
/* Check the application's current state. */
switch ( appData.state )
{
/* Application's initial state. */
case APP_STATE_INIT:
{
ADC_Init();
/* Reset Device */
ADC_SendCommand(RESET);
/* Delay to wait reset ok */
/* 18 t_CKL = 18* 0.488 = 8.784 us */
ADC_StaticDelay(10);
/* Read ID Register */
ADC_ReadRegister(ID);
bool appInitialized = true;
if (appInitialized)
{
appData.state = APP_STATE_SERVICE_TASKS;
}
break;
}
case APP_STATE_SERVICE_TASKS:
{
break;
}
/* TODO: implement your application state machine.*/
/* The default state should never be executed. */
default:
{
/* TODO: Handle error in application's state machine. */
break;
}
}
}
Someone could suggest to me what I'm doing wrong in the initialization of this ADC?
Thank you for the support.
Salvatore De Simone.
