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.

RM48L952: 1us timer implementation using HET

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

Hello, thank you for always answering my questions today.
Today I am going to implement a 1us timer utilizing HET using only CCS. Using the HALCOGEN setting and the hetGetTimestamp(hetRAM1) function, we experimented with how many times hetGetTimestamp(hetRAM1) counts per second. As a result, hetGetTimestamp(hetRAM1) counts 2000000 per second. So I thought I could use it with a count of 500ns. However, hetGetTimestamp(hetRAM1) needs to be initialized every second, that is, every 2000000 counts, but in order to initialize hetGetTimestamp(hetRAM1) correctly, a clock faster than the hetGetTimestamp(hetRAM1) clock is required. Therefore, I want to initialize hetGetTimestamp(hetRAM1) in a place that does not interfere with the CPU, but I do not know how to do it. If hetGetTimestamp(hetRAM1) can be initialized every 1 second, I think that 1us timer can be implemented by expressing the value as hetGetTimestamp(hetRAM1)/2.
Thanks for reading. Below is my code.

20221007_HET_Test.zip

  • Hi,

    I started to work on your issue and i will get back to you soon.

    Thanks & Regards,

    Jagadish.

  • Hi,

    I would say it is very easy to implement 1uSec interrupt also from RTI instead of HET (which required programming).

    In your code you created 1mSec interrupt using RTI right, in the same way you can configure 1uSec interrupt also as shown below in HALCoGen

    In above figure i configured 1uSec interrupt for RTICompare1. And also enabled corresponding interrupt of RTICompare1 in HALCoGen

    And i also did modify your RTI notification handler as shown below

    I kept your existing code as it is in rtiNOTIFICATION_COMPARE0 condition and i added code related to the 1uSec in rtiNOTIFICATION_COMPARE1 condition.

    I am attaching modified code here, please do test with it and let me know the status.

    6813.20221007_HET_Test.zip

    --

    Thanks & Regards,

    Jagadish.