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.

reset compare for RTI on Hercules

Other Parts Discussed in Thread: HALCOGEN

Hi

Quick question

I need to get a timer interrupt every X time to start the ADC conversion. Then receive the interrupt from ADC, get data, and start counting again. Since I have other timer interrupts there, I cannot reset the counter. So here is the question

If I use rtiDisableNotification this will stop the compare from occurring right? So if I need to start the count for THAT compare after getting all the data from ADC, can I do it with rtiEnableNoritifation?

I explain myself. Does rtiEnableNoritifation sets the compare value every time I call it??

thanks!

  • Miguel,
    The rtiDisablNotification only disable the interrupt. Likewise, the rtiEnableNoritifation() only re-enable the interrupt. After you disable interrupt the counter will still continue to count and you will still get the compare match. But no interrupt is generated when there is a compare match. Once you re-enable the interrupt and if a match happens then you will get the interrupt.
  • I undertand that... what I need to know is that if every time I call rtiEnableNoritifation() the register with the value for the compare. I dont want that when I call the function, almost immediately I get the interrupt... so the compare gets a reset every time I call the function??
    thanks
  • See this diagram which is also in the TRM. If you disable the notification it does not stop the counter. So if you happen to re-enable the notification and there is an immediate compare match then you will get interrupt again. Unless you stop the counter but you said you have other tasks using the counter. Are you using both the counters? Can you have other tasks using one counter and have the ADC using another counter?

  • ok. What is the Capture event source??
    what does that part?
  • I want to make sure you are asking a new question about capture event source. Any interrupt that goes to the VIM module can become a capture event for the RTI.  For example, if you get a ADC interrupt you can use the ADC interrupt as event trigger to capture the RTI free running counter and the up counters.

     See below image about Capture Event source from the VIM userguide.

    13.2.1.2 Capture Feature
    Both counter blocks also provide a capture feature on external events. Two capture sources can trigger
    the capture event. The source triggering the block is configurable (RTICAPCTRL). The sources originate
    from the Vectored Interrupt Manager (VIM) and allow the generation of capture events when a peripheral
    modules has generated an interrupt. Any of the peripheral interrupts can be selected as the capture event
    in the VIM.
    When an event is detected, RTIUCx and RTIFRCx are stored in the capture up counter (RTICAUCx) and
    capture free running counter (RTICAFRCx) registers. The read order of the captured values must be the
    same as the read order of the actual counters (see Section 13.2.1.1).

  • I was talking about this part

  • I'm not clear what you are trying to ask about which part. There are two counters in the RTI. In your screenshot you are showing for counter 0. Here you can select from two different capture sources. Default is capture event source 0. For each capture source you can select which interrupt to become the capture source. See below VIM configuration in HalCoGen. Here I'm illustrating an example where capture source 0 will take from interrupt 10 and capture 1 will take interrupt from interrupt 20. This means that interrupt 10 will become the event for RTI counter 0. 

  • oooh okokok
    but what does that part means??
    is the channel??
    In my case, I want the interrupt occurs every time the timer reaches the compare value...
    But you tell me that I could select a different trigger and mmm lets say "ADC group1 to interrupt source for RTI" so I will get an interrupt every time ADC interrupt occurs? or lets say an input arrives and then that triggers the interrupt?

    thanks
  • You asked about how the capture event work and I was giving an example that using ADC interrupt as a capture event source. Perhaps that confuses. Let's not use ADC interrupt. Let's use GIO interrupt. You can configure such that a GIO interrupt will cause the RTI to capture its counters? Is that more clear? So forget about using ADC as an interrupt source for the RTI capture. The interrupt source can be anything else. Let's give another example. When you receive a SPI message you will generate a SPI receive interrupt. If you want to use the SPI receive as an event to capture the RTI counter, you can do so.

    This is the reason I asked in the beginning are you asking a new question about the capture event? I was under the impression that you want to try some new features.
  • Hi Charles

    okok

    So the source is the channel on the VIM right??

    and I have two methods to cause an interrupt in there. The compare match or the capture event source right??

    thanks!!