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.
Hello,
I want to use the HRCAP module to measure the pulse width and period of a PWM signal connected to the microcontroller. My Problem is, i can't find the corresponding interrupt vector in the vector table of the MCU. Can anybody help me?
Thanks
with best regards
Chunyu Zhang
Chunyu,
The HRCAP vectors, like almost all the interrupts on C2000 devices, are handled by the PIE module. The HRCAP vectors are listed in the PIE vector table in the F2803x datasheet SPRS584i, Table 3-13, p.41. You will find them as INT4.7 and INT4.8.
Regards,
David
Hello David,David M. Alter said:Chunyu,
The HRCAP vectors, like almost all the interrupts on C2000 devices, are handled by the PIE module. The HRCAP vectors are listed in the PIE vector table in the F2803x datasheet SPRS584i, Table 3-13, p.41. You will find them as INT4.7 and INT4.8.
Regards,
David
Thanks for your answer. Now I have a new question. I use the peripheral library of TI with the Version V123 of the controlSuit ( controlSUITE\device_support\f2803x\v123) in my application. In this version the HRCAP is not supported. It is is available only in Version V126. What I have done was copy the files or functions related to the HRCAP to my project. But there arised an error by compiling the project with code composer studio (V5.3). The error message is
warning: creating output section "HRCap1RegsFile" without a SECTIONS
It seems that I have to modify the link command file ( .cmd) of the project but i have no ideal how to modify this file
how can I solve this problem in an elegent way?
Regard,
Chunyu
Hello Chunyu,
Yes, the HRCAP peripheral was not originally supported in the header files. Personally, I would update all your files to the latest header file version. But if you want to just pick and choose, you are on the right track swapping out the DSP2803x_HRCap.h and DSP2803x_GlobalVariableDefs.c from the v1.26 headers. On your linker error, you are correct that you need to modify the linker command file. You can actually just swap out the DSP2803x_Headers_nonBIOS.cmd file with the one in the v1.26 headers and be done. If you really want to just modify the v1.23 .cmd file, you need to add the MEMORY and SECTIONS definitions for the HRCap peripherals. In the MEMORY section you'd add this:
HRCAP1 : origin = 0x006AC0, length = 0x000020 /* High Resolution Capture 1 registers */
HRCAP2 : origin = 0x006AE0, length = 0x000020 /* High Resolution Capture 2 registers */
and in the SECTIONS section you'd add this:
HRCap1RegsFile : > HRCAP1, PAGE = 1
HRCap2RegsFile : > HRCAP2, PAGE = 1
Again, I'd personally just update all your files to the ones in the v1.26 headers.
Regards,
David
Hello David,David M. Alter said:Hello Chunyu,
Yes, the HRCAP peripheral was not originally supported in the header files. Personally, I would update all your files to the latest header file version. But if you want to just pick and choose, you are on the right track swapping out the DSP2803x_HRCap.h and DSP2803x_GlobalVariableDefs.c from the v1.26 headers. On your linker error, you are correct that you need to modify the linker command file. You can actually just swap out the DSP2803x_Headers_nonBIOS.cmd file with the one in the v1.26 headers and be done. If you really want to just modify the v1.23 .cmd file, you need to add the MEMORY and SECTIONS definitions for the HRCap peripherals. In the MEMORY section you'd add this:
HRCAP1 : origin = 0x006AC0, length = 0x000020 /* High Resolution Capture 1 registers */
HRCAP2 : origin = 0x006AE0, length = 0x000020 /* High Resolution Capture 2 registers */and in the SECTIONS section you'd add this:
HRCap1RegsFile : > HRCAP1, PAGE = 1
HRCap2RegsFile : > HRCAP2, PAGE = 1Again, I'd personally just update all your files to the ones in the v1.26 headers.
Regards,
David
According to your suggestion, I try to use the version v126 instead of v124 (I told you that I used v123, it was an ereror) . I think this is the best way to solve the problem. But it is not so simple as i thought.
What I have done ist just as followed.
change the CCS Project setting: in Properties -> Resource ->Linked Resource set the value of DRV830x_F2803x_DEVICE_SUPPORT_ROOT to ${PROJECT_LOC}\..\..\..\device_support\f2803x\v126 .
But when I complile the project, another prblem arises. The error message is "fatal error: could not open source file "DSP2803x_HRCap.h"
The include_path is still set to v124. I think I should change it also to v126. But I don't konw how to do it. I can only add a new directory under Properties-> Build ->Include options.
Hello David,
the setting in my include Options is a little bit different. there are no Variables like V124. I use CCS 5.3.0. The project I used is originated from the InstaSPIN_BLDC for motor controlling. The following is the screenshot.
I have already redirected the Variable DRV830x_F2803x_DEVICE_SUPPORT_ROOT to V126 in Linked Resource.(see following screenshot): So I think the include order for library head files are set correctly.
But if I search the key word "v124" using the file search function of CCS I found a lot of match.
Chunyu,
All I can see is that the path symbol 'DRV830x_F2803x_DEVICE_SUPPORT_ROOT' is using a relative path, relative to the project location. The example you based your code on is relying on its location in the ControlSuite structure. If you've moved the project or made a copy of it elsewhere that you are using, relative paths are prone to failure unless folder being targeted is also moved with the project.
Try replacing the relative path with an absolute path pointing to the header files.
- David