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.
Hi
I have a program that uses eCap1 to capture a GPIO signal input (GPIO 0 goes to input X-Bar's INPUT7), to simplify the testing, this GPIO0 is also set as a digital output that sends out a square wave.
The schematic is as follows:
When I put eCap1 interrupt routine into CPU1, both edges can be captured, everything is fine.
When I put eCap1 interrupt routine into CLA1, only rising edge can be captured.
I have checked eCap1 setting, the register settings of both cases are identical.
Are there anything I need to do for eCap CLA interrupt triggering?
Both projects are attached for your review.
Thank you very much!
Jiakai
Test Captuer with Interrupt in CPU.zipTest Captuer with Interrupt in CLA.zip
By the way, when I define some global variables in a .CLA file, since these global variables don't have initial values, they are allocated to .bss_cla section.
My issue is: Does the program need to set 0 to .bss_cla section, or this is done by the startup program (so I don't need to clear the section)?
Regards,
Jiakai
Jiakai,
The uninitialized CLA global variables are placed in .bss_cla section. Please refer to compiler user's guide for further details.
https://www.ti.com/lit/pdf/SPRU514Y
It is the responsibility of the application to initialize the variable or create initialized global variable, then compiler will place in .const_cla section.
Thanks & Regards,
Santosh
Hi Santosh,
I do have put the global variables with initial value into .const_cla, and the initial values are copied to their running place at the startup code (add code to startup to copy both Cla1Prog and .const_cla). I will add code to clear .bss_cla section at the startup code.
By the way, CCS doesn't support the global variable with initial value defined in .cla file, CCS will report an error message. I have to define it in .c file,
then name its section as .const_cla. hope CCS fix this bug soon.
thanks,
Jiakai
Jiakai,
I will work on the section name with cal expert. Does this fix your eCAP issue?
Thanks & Regards,
Santosh
Hi Santosh,
eCAP issue is the most important thing to me, I want to know if I have anything wrong on initializing eCAP.
Thanks,
Jiakai
Hi Santosh,
I have fixed the bug. I have defined Uint16 wrong.
it should define it as unsigned short instead of unsigned int.
This may cause some registers are cleared incorrectly.
Thanks,
Jiakai