Custom Code for eQEP in F28388D using Simulink
3 views (last 30 days)
Show older comments
I would like to write my own C-Code to calculate the measured speed using the eQEP module within the F28388D. The block provided in the C2000 Library does not allow to interact with the UPEVNT bit). I learned that the new C Function Block (released in R2020a) would be a good alternative, however I am not sure how to acess the target's registers (e.g. QCTMRLAT or QEPSTS.UPEVNT) from my code. Is this possible? I am using R2020a and F28388D Control Card.
0 Comments
Answers (1)
Ram Alla
on 13 Oct 2020
Hi Roberto,
The eQEP registers for F2838x are defined in the header file f2838x_eqep.h. Refer to the below mentioned path (in the installation path of your TI Control SUITE) for this header file:
C:\TI\c2000\C2000Ware_2_00_00_02\device_support\f2838x\headers\include
The registers QCTMRLAT and QEPSTS.UPEVNT for eQEP1 can be accessed as shown below:
EQep1Regs.QCTMRLAT;
EQep1Regs.QEPSTS.bit.UPEVNT;
Similarly, you can access these registers for eQEP2 or eQEP3 by replacing EQep1Regs with EQep2Regs or EQep3Regs respectively.
Hope this helps.
Best Regards,
Ram Alla.
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!