Part Number: TMS320F280049C
Dear Mr. / Ms.

I want the Event load value is NOT a constant, instead, for example, it is the current value of counter1 add 1000.
is it possible to implement?
thanks!
BR
jjl3
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.
Part Number: TMS320F280049C
Dear Mr. / Ms.

I want the Event load value is NOT a constant, instead, for example, it is the current value of counter1 add 1000.
is it possible to implement?
thanks!
BR
jjl3
Hi jjl3,
No it would not be possible to make the event load value be anything other than a static value since the CLB cannot perform additional/subtraction. The HLC controller has this functionality, but can only manipulate the current counter value, the match 1 reference, and the match 2 reference. What is the application you are using for which this is required? I would think you should only be able to accomplish your logic in count-down mode then
Regards,
Peter
Hello, Peter
the application is,
I want to measure the width of a pulse using one counter, and want this value to be added to a constant as the Match reference of another counter.
it is possible to implement via using HLC functionality?
thanks!
BR
jjl3
Hi Mr. Ji,
With the description you have proposed, it should be possible to use the HLC to perform this action. What you can do is have an HLC event triggered by the falling edge of the pulse you are measuring, then within that HLC event you can latch the value of the counter, then use the ADD instruction to add this counter value to a register value. The register should be populated with the constant value you are wanting to add (can be initialized to this value or written to from the CPU). Then you can use the MOV_T1 or MOV_T2 command to move the value of this register to the match reference of another counter
Regards,
Peter