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.

ADC TMS570LS4357

Other Parts Discussed in Thread: HALCOGEN

Hello,

I tried to implement a example to configured the adc in a TMS570LS4357, but I have many problems during my  programation.

First, I tried use other channel and other adc group. I use the ADC 2 and the pin 19. I configured the adc in HALCode like a image

But when I activated the pin 19, the time is in 0, no change like in the example

And when I program the code the MCU only wait for the finish of the conversion. I use the same configuration (adc 1 and pin 9), bbut the code do  the same, is only wait for the finish of the conversation. I don't know what is the problem.

This is the code that I use:

void main(void)
{
/* USER CODE BEGIN (3) */
adcData_t adc_data;
adcData_t *adc_data_ptr = &adc_data;
unsigned int j, value;

sciInit();

adcInit();
adcStartConversion(adcREG2, 1U);
//while(!adcIsConversionComplete(adcREG2, 1U));
adcGetData(adcREG2, 1U, adc_data_ptr);
value=(unsigned int)adc_data_ptr->value;
for(j=0;j<8;j++)
{
command[j]=(value>>28)&15;
if(command[j]>9)
command[j]+=7;
command[j]+=48;
value=value<<4;
}
sciSend(CPU, 8 , command);
sciSend(CPU, 2, (unsigned char*)"\r\n");

}

And thanks for your attention

Regards

  • sanchezbjc_fi-iee,

    I just tried the same on HalCoGen 4.05.02 but I can't reproduce your result.
    If you check other channels does the total time still read 0?

    I am wondering if this is a GUI problem and related to some highDPI setting.
    If you can use a machine running Win7 that is better. We have not migrated to Win10.

    -Anthony
  • Hello Anhony,

    I activated other pin in the HALCodeGenerator  04.05.02 and 04.05.01 and the result is the same. I sen a image. This pins no generate a changes in the time.

    I use windows 10, I will try tomorrow in the morning in other computer.

    Thanks

  • Hi Juan Carlos,

    My mistake.. I must have hit 15 instead of 19.

    I can reproduce what you see even on Win7.

    For me it appears that all the checkboxes above 15 are ignored. So maybe you can for now try using ADC channels 0-15, until someone analyzes the issue & fixes?

    Thanks and Best Regards,
    Anthony
  •  Hello,

    In this moment I used a computer with Windows 7 and HALCode Gen 04.05.02 and present the same problem.

  • Hi sanchezbjc_fi-iee,

    There is a little problem in HALCoGen's ADC xml files:

    C:\ti\Hercules\HALCoGen\v04.05.02\drivers\TMS570LC4357ZWT\ADC1v000.xml
    C:\ti\Hercules\HALCoGen\v04.05.02\drivers\TMS570LC4357ZWT\ADC2v000.xml

    Open with a text editor and at the line 97 you can found the problem:

    Change the value to 33 in the case of ADC1 and 25 in the case of ADC2.

    After the modification, start HALCoGen and the calculation of conversion time should work fine.
    I haven't tested that the conversion itself works or not.

    If you test it, could you share your results?

    Regards: Szilárd

  • Hello Szilárd,

    I changed the number in the files .xml and  activate the pin, exist a change in the performance of HALCodeGen, now the time change.

    But the problem now is the execution of the program. The MCU is in loop wiating for the finish the convertion. I use the same code of the example and I don't know what is the reason for the problem.

  • Dear all,

    I found the error, the terminals of VREF and ADREFHI in my design no were no connected. I soldered the resistor of the voltage regulator (LM4040D50) and the voltage in these terminals are the correct and the microcontroller read the port.

    Thanks for your help.
    Juan Carlos