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.

TMS570LS3137-EP: TMS570LS3137-EP

Part Number: TMS570LS3137-EP
Other Parts Discussed in Thread: HALCOGEN

Dear sir,

thank you so much for your reply sir.

Through UART i am sending the data and receiving the response as per the command structure given by client

only pending is adc

in adc i want to read the voltage and displaying in gui

i am using this AD7476SR

TZ-R2 in schematic 3rd pin as the input voltage of 3V

from bellow code iam receiving the response is 60159 constant. changing input voltage of ADC no change in output response


/* USER CODE BEGIN (0) */
#include "sci.h"
#include "adc.h"
#include "stdlib.h"
/* USER CODE END */

/* Include Files */

#include "sys_common.h"

/* USER CODE BEGIN (1) */
unsigned char command[10];
/* USER CODE END */

/** @fn void main(void)
* @brief Application main function
* @note This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/

/* USER CODE BEGIN (2) */
/* USER CODE END */


//adcData_t data; //ADC Data Structure
//adcData_t *adc_data_ptr = &data; //ADC Data Pointer
//unsigned int NumberOfChars, value;


int main(void)
{
/* USER CODE BEGIN (3) */

/* USER CODE BEGIN (3) */

adcData_t adc_data; //ADC Data Structure
adcData_t *adc_data_ptr = &adc_data; //ADC Data Pointer
unsigned int NumberOfChars, value;


sciInit();
adcInit();

adcCalibration(adcREG1);
// adcCalibration(adcREG2);
while(1) // Infinite loop to acquire and send ADC sample data via SCI (UART)
{
adcStartConversion(adcREG1,adcGROUP1); //Start ADC conversion
while(!adcIsConversionComplete(adcREG1,adcGROUP1)); //Wait for ADC conversion
adcGetData(adcREG1,1U,adc_data_ptr); //Store conversion into ADC pointer

// adcGetData(adcREG1, adcGROUP1,&adc_data[0]);


value=(unsigned int) adc_data_ptr-> value;

// NumberOfChars = ltoa(value, (char *)command); //Converts "value" to a string and stores it in "command".

NumberOfChars= sprintf(command, "%d", value);

// NumberOfChars= sprintf(value, "%d", command);
//Transmit over Serial

// sciSend(scilinREG, 2, (unsigned char *) "0x");
sciSend(scilinREG, NumberOfChars,command);
sciSend(scilinREG, 2, (unsigned char *) "\r\n");
__delay_cycles(10000000); // 1-second delay
}


/* USER CODE END */

return 0;
}

/* USER CODE BEGIN (4) */

/* USER CODE END */

the above code is used to read the voltage of adc

i am taking the reference code from this video www.youtube.com/watch

i am trying to read the voltage of ADC .

iam attaching the snapshots for halcogen also sir.

please guide me

 Desktop.rar

We are using AD7476SRTZ-R2 ADC as an interface between adc input and micro controller.
We are feeding adc input voltage to AD7476SRTZ-R2 and this adc will process based on the inputs chip select , clock received from the micro controller. and processed digital data will be given to the microcontroller.
so we are trying to send chip select  and clock from the micro controller but adc is not responding. 
iam attaching the custom board schematic please check

  • Hi,

      In your schematic, AD7476SRTZ-R2 ADC uses SPI interface. In your code, I don't see anything that initiates the SPI. Instead, you are initializing the integrated ADC and trying to read the internal ADC. 

    You can find SPI example in HalcoGen. See below. First go to Help->Example.

    Next look under the directory TMS570LS31x_21x, you will find examples including SPI.