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.

HALCOGEN: How to configure the ADC using HALCOGEN? Is there an action routine?

Part Number: HALCOGEN
Other Parts Discussed in Thread: TMS570LS1224

Hi Team,

There's an issue from the customer need your help:

How to configure the ADC using HALCOGEN? Is there an action routine? Like this, the more detailed the better, thank you! 

Could you help check this case please? Thanks.

Best Regards,

Ben

  • 1. launch HALCoGen
    2. To create a new HALCoGen project: File → New → Project
    3. If you use TMS570LS1224 Lauchpad, Choose
        Family: TMS570LS12x,
        Device:TMS570LS1224PGE
        
    4. Then define a project name and Location
    5. The next step is to enable the appropriate drivers
    6. Enable MIBADC1 drivers in the „Driver Enable‟ sub tab of the device
        
    7. From the MIBADC1 Group1 tab (or Group2, or Group Event), configure FIFO Size, Trigger Source and ADC channel
        
    8. Generate code: File → Generate Code
  • 1. Cycle time and Sample Time for the ADC?
  • Here is the example:

    ADC Pin 0 and Pin 1 are used in the example. The sampling is triggered by rising edge of signal at GIOB0.

    The sampled value is displayed on UART console, the UART baudrate is 9600.

    myExample.zip

  • Hi Wang,

    Thanks for your great help.

    How does HALCOGEN font size adjust? The font is too small to see after generating code. 

    If one of the ADC interfaces is selected, as shown in the figure below, how do I configure the VU size? 

    Best Regards,

    Ben

  • Hi Ben,

    How does HALCOGEN font size adjust?

    HALCoGen GUI is not designed to scale with the user's desktop resolution setting. We can't adjust the font size.

    If one of the ADC interfaces is selected, as shown in the figure below, how do I configure the VU size? 

    This is not from HalCOGen GUI. I don't know how to change the resolution or font size of the screenshot posted onto E2E thread.

  • Hi Wang,

    If one of the ADC interfaces is selected, as shown in the figure below, how do I configure the VU size? 

    Sorry for the translation problem. It should be:

    how do I configure the HALCOGEN to get the VU's value.

    Best Regards,

    Ben

  • Hi Wang,

    The customer said the picture seems a different software, is there a download link?

    Best Regards,

    Ben

  • Hi Ben,

    If you use Altium to design or view the schematics, you can zoom in/out the display by selecting View->Zoom IN or Zoom Out command from the main menu. The font size can be changed from Preferences -> Schematic.

  • Hi Wang,

    Thanks for your response.

    What should I do after generating the code? And what's next after choosing one of the ADC interface?

    Best Regards.

    Ben

  • Hi Ben,

    You can use the ADC APIs generated by HAL in your application:

    For example:

    /* initialize ADC */
    /* Groupx and Pins, trigger source etc */
    adcInit();

    /* start adc conversion */
    adcStartConversion(adcREG1,adcGROUP1);

    /* wait and read the conversion count */
    while((adcIsConversionComplete(adcREG1,adcGROUP1))==0);
    ch_count = adcGetData(adcREG1, adcGROUP1,&adc_data[0]);

    /* conversion results : */
    /* adc_data[0] -> should have conversions for Group1 channel1 */
    /* adc_data[1] -> should have conversions for Group1 channel2 */
    id = adc_data[0].id;
    value = adc_data[0].value;

  • Hi Wang,

    How to use that? Can I import HAL project into CCS?

    Best Regards,

    Ben

  • Hi Ben,

    This application note will help you create A HALCoGen-Based Project For CCS:

    https://www.ti.com/lit/an/spna121b/spna121b.pdf?ts=1668696157896&ref_url=https%253A%252F%252Fwww.google.com%252F