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.

AM2634: am2634

Part Number: AM2634
Other Parts Discussed in Thread: SYSCONFIG, LP-AM263

Hii,

I am sampling adc sine wave ( soc from software ) with amplitude(high=1v and low=0v) with frequency of 1mhz but i am getting digital value between 2300 and 2450 . i should be gettiing from 0 to something?
what  can be possible error??

  • Do you mean 1mHz (0.001Hz) or do you mean 1MHz? If the latter I would say aliasing is the problem. What do you get at 0Hz and 1kHz for example?

  • i meant it to be 1MHz.
    it give fine for 1Hz to 5Hz, But for 1KHz and above it is not giving correct.
    how to solve this problem??

  • The obvious question: What is your sampling rate?

  • For am2634 launchpad it is supposed to be 4msps??

  • The sampling period is what you program it to be.

    Have you experimented with the examples yet?: C:\ti\mcu_plus_sdk_am263x_08_05_00_24\examples\drivers\adc

  • have set it to 4msps with syscfg.
    Do i need to change it manually in code ??

  • The Start Of Conversion (SOC) is mostly configured in SYSCONFIG. Study the examples in combination with the TRM.

  • In Start Of Conversion(SOC) from software, are SYSCLK, ADC Clock Prescaler and SOCx Sample Window are enough for setting the sampling rate or do we need to initialize other driver like EPWM, because example in sdk for SOC from Software is only using  SYSCLK for time reference for adc ??

     

  • The ADC can be triggered in many different ways as mentioned in the manual:

    EPWM is just one option. The readme for your example is clear enough I think.

    In this case, the sample rate is the rate at which ADC_forceSOC() is called:

  • hii kier,

    I am using a sampling rate of greater than 3 msps ( SysClk=200MHz  AdcClock=200/3 MHz ).
    I am feeding the square wave of 1MHz to the J1/J3 Pin 23 of am2634 launchpad in Continuous mode but still i am getting data in range 1200 to 1400.

    This is code for taking the digital data in SOC from Software.

    while(1)
    {

    ADC_clearInterruptStatus(baseAddr, ADC_INT_NUMBER1);

    ADC_forceSOC(baseAddr, ADC_SOC_NUMBER0);
    while(ADC_getInterruptStatus(baseAddr, ADC_INT_NUMBER1) == false)
    {
    }
    DebugP_log("ADC Result register value : %d\r\n", ADC_readResult(CONFIG_ADC0_RESULT_BASE_ADDR, ADC_SOC_NUMBER0));

    }

    pls suggest how to fix it.

  • When you say "fix it", you mean you want to achieve a sample rate of 4MSPS such that you can reliably reconstruct a 1MHz sine wave?

    When you say "i am getting data", how are you viewing this data?

    If you are just using the code above then the sample rate is only as fast as the call to ADC_forceSOC(). One of the problems could be that DebugP_log is a very slow process so the call frequency of ADC_forceSOC() will be low I imagine.

    Comment out DebugP_log() and instead set-up a buffer to store the return value of ADC_readResult() but you will need quite a lot of memory. Then use the Graph feature to plot the data points:

    Sorry but I'm not TI support staff so cannot afford to spend much more time on this. Hopefully TI will pick up this topic.

  • Hello Tej_1441, Kier,

    I'll start by giving Kier a great Thank You for providing great initial feedback here.

    I am glad to continue further support as needed.

    Tej, where are you at now with your project?

    Best Regards,

    Zackary Fleenor

  • Based on the information I have gathered so far; I think a signal conditioning circuit needs to be included in the test setup. What instrumentation is being used to inject the 1 MHz sine wave? It will need sufficient drive strength to charge the S&H capacitor. The following app note is also applicable to the AM263x SAR ADC.

    https://www.ti.com/lit/an/spract6a/spract6a.pdf

  • hii fleener , thanks for your reply
    I am using function generator for generating the 1MHz sine wave.

  • Can you provide any spec details for the function generator signal? Is a signal conditioning circuit like I mentioned above something that could be done here?

  • Hii Fleenor,
    sorry for late reply as i was busy with some other works.
    i have planned to do adc sampling with epwm as the trigger source for SOC, But even with this case i am stuck in similar situation, where i am able to sample signal of sine wave(amplitude 1VPP and offset 0.5V) till 50 KHz but when i increase frequency of signal then it is getting distorted and upper and lower values missing.



                         GRAPH at 150KHz.



    Here is code for initilization of  adc and epwm driver. 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #include "ti_drivers_open_close.h"
    #include <kernel/dpl/DebugP.h>
    void Drivers_open(void)
    {
    Drivers_adcOpen();
    Drivers_epwmOpen();
    Drivers_intXbarOpen();
    Drivers_uartOpen();
    }
    void Drivers_close(void)
    {
    Drivers_uartClose();
    }
    void Drivers_adcOpen()
    {
    /* CONFIG_ADC1 initialization */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX





    This is main code for reading the adc register value and printing.
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (C) 2022-2023 Texas Instruments Incorporated
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the
    * distribution.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    pls tell where i am getting wrong?


  • Hello Tej_1441,

    Is it possible to insert some kind of voltage buffer on the input? Can you share the specs of the signal generator you are using? I don't see any issue with your code, but believe the issue could be related to the drive strength of your instrument.

    Best Regards,

    Zackary Fleenor

  • Hii Fleenor,
    It is not possible to insert voltage buffer.
    I am using Tektronix signal generator with model number AFG31000 SERIES Arbitrary function generator.
    https://www.tek.com/en/datasheet/arbitrary-function-generators

    H
    ere i have attached the image of plotted graph for constant amplitude( amplitude = 0.5v and offset = 0.250v) and different frequency  for ADC conversion.
    Sampling rate is set to 4MSPS and frequency for triggering SOC from epwm is set to be 1MHz.

    why on increasing frequency, range of value captured by ADC is decreasing.
    And i am receiving 50 sample at 20KHz which means sampling rate=1msps ( Is sampling rate effected by frequency by which we trigger adc SOC)  

                             graph at 5KHz



                           graph at 10 KHz



                           graph at 20 KHz





                              graph at 50KHz


                           Graph at 100KHz


                                  Graph at 200KHz


                                  graph at 400KHz

  • Hey Tej_1441,

    I spoke with the design engineer here and came up with the following feedback.

    1) It looks like a low-pass filter in the HW is acting upon the signal. Can you check the board for any possible LPF elements?

    2) If the EPWM SoC Trigger is set to 1MHz, then you are only generating data at 1MSPS. (The EPWM trigger rate is directly related to the sampling rate).

    3) Can you also please provide captures of the input waveform? The "InstaView" technology of the Function Generator you are using seems promising to provide some additional clues.

    Best Regards,

    Zackary Fleenor

  • Hii Fleenor,
    I am using sitara AM263x MCU with PART NO : LP-AM263.
    1 ) I have checked the HW, but there is no LPF elements.
    2 ) It can be noticed from the images in previous reply that number of sample for 1MHz is correct ( trigger for ADC's SOC is set to 1MHz), But the problem is that signal is not getting uniformly sampled.

    Here i am attaching the captures of input waveform




    Here are details obtained from the "InstaView" technology of Function Generator.

     

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    DHCP On
    CLOCK_REFERENCE Internal
    GPIB_ADDRESS 1.10000000000000000000e+01
    GPIB_CONFIGURATION Talk/Listen
    LANGUAGE English
    SCREEN_SAVER Off
    CONTRAST 7.00000000000000000000e+01
    CLICK_TONE On
    SOFT_KEYBOARD On
    BEEPER On
    POWER_ON Default
    BRIGHTNESS 1.00000000000000000000e+02
    TRIGGER_SOURCE External
    TRIGGER_SLOPE Positive
    TRIGGER_INTERVAL 1.00000000000000002082e-03
    TRIGGER_OUT Trigger
    TIMEZONE UTC+08:00
    USB_ESER 0.00000000000000000000e+00
    USB_SRER 0.00000000000000000000e+00
    USB_QEN 0.00000000000000000000e+00
    USB_OEN 0.00000000000000000000e+00
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    Pls once verify the example code  adc_soc_epwm (ti.com) is woking correctly.



  • Hello,

    The example code is working as expected.

    The AM263x Launchpad has 0.1µF capacitor to ground at the ADCx_AINy boosterpack pin. This is parallel to the load applied by the function generator and results in a LPF response that is likely attenuating signals in the 100KHz range as shown.

    Best Regards,

    Zackary Fleenor

  • Hii Fleenor,
    Thanks a lot for your help! Your suggestion to remove 0.1uF capacitor fixed the issue I was having.
    I really appreciate you for giving your time.