Trouble getting ADC to output signal with F280049C board

6 ビュー (過去 30 日間)
Jeremy Schaeffer
Jeremy Schaeffer 2022 年 3 月 8 日
回答済み: Sayan 2023 年 10 月 23 日
I want to use an ADC block to output a signal from a sensor interfacing a TI F280049C board, but I am having issues getting any signal back. The scope outputs zero. I have tried to copy multiple examples where an ePWM block is used to trigger the ADC.
I have the ePWM and ADC block in a function subsystem and called by a C28x Hardware Interrupt. It doesn't seem that the subsystem is ever called.

回答 (1 件)

Sayan
Sayan 2023 年 10 月 23 日
Hi Jeremy,
I understand from your issue that the analog voltage data you are trying to read using the "ADC" pin of your TI F280049C board is not reflected from the "ADC" block output.
After analysing the model, I have found the following possible issues and their workarounds associated with the "ADC" and "ePWM" blocks in your model:
For "ADC" block,
  • Check if the analog voltage sensed is within the sensible range of the TI F280049C board.
  • Verify if the "ADC" is sensing the analog voltage. You can do that by ensuring the "Conversion channel" of the ADC block matches the pin where the input voltage is provided.
  • If you are trying to trigger the ADC with "ePWM" you can set that in the "SOCx trigger source" field of the "ADC" block by selecting the proper "ePWM" channel.
For "ePWM" block,
  • The variable "PWM_Counter_Period" used in the "Timer period" field of the "ePWM" block is undefined in your model, which is the reason the carrier triangular signal cannot be generated. You use the following formula to find the period of the triangular carrier (as you are using the "UP-Down" mode of counting) pulse to generate PWM.
"Timer period"=(0.5) * F_clk/F_des
Here, F_clk = Clock frequency of the microcontroller,
F_des= Desired frequency of PWM
  • The reference value to which the triangular pulse is compared is not defined in the block. You can define it by filling in the "CMPA units" field in "Clock cycles" or "Percentage" and providing the value in the "CMPA value" field to define the pulse width of the PWM.
Further, for more information on the "ADC" and "ePWM" blocks, please refer to the following MathWorks Ddocumentation links:
Hope this helps you in resolving the issue.

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by