Tool/software:
Hello,
I would like to trigger ADC periodically via Timer trigger output. I didn't see any examples of that. How I can do that?
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.
Tool/software:
Hello,
I would like to trigger ADC periodically via Timer trigger output. I didn't see any examples of that. How I can do that?
Hello Mehmet Sahin,
Sorry for the delayed replies.
In the current MCU+SDK there is no support for the Triggering ADC from the Timer Module.
If you want to trigger the ADC at a particular time, then you need to select the ADC trigger as PWM or Timer PWM or IEP or External GPIO Pins with the below CTRL MMR register.
Use the same ADC example as is there in the MCU+SDK with the above suggestion and see if you are able to trigger the ADC.
My suggestion is that first you can go with the external Hw pin and that you can configure it from the syscfg and generate code.
Please let me know your test results.
Regards,
Anil.


Thank you for your response.
As I am relatively new to working with MCU+ SDK(new to TI products), I would greatly appreciate more detailed guidance on how to proceed.
I have come across the registers you mentioned in the Technical Reference Manual (TRM).
However, if I intend to engage in register-level programming, does this imply that I will need to develop the ADC driver and Timer driver from scratch?
I am curious to know if there are any shortcuts around that.
Hello Mehmet Sahin,
In the MCU+SDK, we (TI) support some of the examples, like GPIO, I2C, SPI, ADC and other drivers.
My suggestion is that first you can take the ADC example from the MCU+SDK.
Then, run it on the SOC.
Which are the tools needed and how to run examples from CCS everything is available in the MCU+SDK document.
You can follow the document from the link below ..
Please complete these steps and let me know
So, that I can give suggestions about how to implement your requirements on top of the existing ADC example.
https://www.ti.com/tool/MCU-PLUS-SDK-AM243X


Regards,
Anil.
Yes, I have already did that.
I have successfully connected a potentiometer and transmitted its values over EtherCAT to Twincat as well.
However, the main query now revolves around transforming this setup into a periodic sampling process, operating at a frequency of, for instance, 20 kHz.
The aim is to average these samples over a specified time constant and subsequently transmit them via EtherCAT. This remains the ultimate objective.
Ya sure , I can tell you the next steps .
Please expect you may get reply by mostly on Monday .
Regards,
Anil.
Hello Mehmet Sahin,
Currently, we don't have the working example to generate a PWM from the Timer.
Please look at the FAQ below. This FAQ helps you to enable the Timer PWM.
Integrate Timer PWM into an existing ADC example which is available in the MCU+SDK .
Later, configure the MMR register to enable the HW trigger by using the code below .
And see if the ADC is interrupt is triggered or not for every the Timer PWM signal..
ADC example : \ti\mcu_plus_sdk_am64x_10_01_00_32\examples\drivers\adc\adc_singleshot
/* set timer clock source */
SOC_controlModuleUnlockMMR(SOC_DOMAIN_ID_MAIN, 1);
*(volatile uint32_t*)(0x43004710) = xx;
SOC_controlModuleLockMMR(SOC_DOMAIN_ID_MAIN, 1);
Regards,
Anil.