Hello to everybody,
I was just doing the most simple example for an ADC on the Launchpad TMS570LS1224 but i couldn't make it work. I am using CCS 6.1.1 and HalCoGen 04.05.01.
The exmple is just meant to take data from an ADC and show it some LEDs.
The configuration on HalCogen is as follow:
And the code is as simple as this (in sys_main.c):
/* USER CODE BEGIN (1) */
#include "gio.h"
#include "adc.h"
/* USER CODE END */
/* USER CODE BEGIN (2) */
adcData_t adc_data;
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
gioInit();
adcInit();
adcStartConversion(adcREG1, adcGROUP0);
while(1)
{
while(adcIsConversionComplete(adcREG1, adcGROUP0)==0){};
adcGetData(adcREG1, adcGROUP0, &adc_data);
gioSetBit(gioPORTA, 0, 1);
gioSetBit(gioPORTA, 1, adc_data.value<<1);
gioSetBit(gioPORTA, 2, adc_data.value<<2);
gioSetBit(gioPORTA, 1, adc_data.value<<3);
gioSetBit(gioPORTA, 2, adc_data.value<<4);
gioSetBit(gioPORTA, 5, adc_data.value<<5);
gioSetBit(gioPORTA, 6, adc_data.value<<6);
gioSetBit(gioPORTA, 7, adc_data.value<<7);
}
/* USER CODE END */
}
The thing is, i can't get a single value of the adc_data despite i change the voltage at the input. It even can´t get throught the while(adcIsConversionComplete(adcREG1, adcGROUP0)==0){}; (i know that because the first led is not on). For this simple example i looked at most of the registers but i can't make it work.
All the files are here. 8883.TMS570LS1224_adc_memory.rar
I will appreciate if someone can tell me where am i doing the foolish mistake.
Best Regards
Francisco Dumont






