SysTick interrupts disable?

sashmich
Wed Jan 25, 2017 5:39 pm
Hello.
How can I disable (or lower priority) interrupts Systick system timer?
Thank you.

victor_pv
Wed Jan 25, 2017 7:27 pm
sashmich wrote:Hello.
How can I disable (or lower priority) interrupts Systick system timer?
Thank you.

sashmich
Wed Jan 25, 2017 7:43 pm
Yes, attachinterrapt() and micros() I use to measure the frequency. But there are occasional errors. I guess it’s because Systick.

RogerClark
Wed Jan 25, 2017 8:35 pm
I think You would also need to disable the USB interrupt as well

victor_pv
Wed Jan 25, 2017 9:23 pm
sashmich wrote:Yes, attachinterrapt() and micros() I use to measure the frequency. But there are occasional errors. I guess it’s because Systick.

sashmich
Thu Jan 26, 2017 10:08 am
RogerClark wrote:I think You would also need to disable the USB interrupt as well

sashmich
Thu Jan 26, 2017 10:18 am
victor_pv wrote:sashmich wrote:Yes, attachinterrapt() and micros() I use to measure the frequency. But there are occasional errors. I guess it’s because Systick.

BennehBoy
Thu Jan 26, 2017 2:05 pm
Check the code out in this -> https://github.com/BennehBoy/ArduinoSpeedoCorrection

It uses a hardware interrupt to measure the ‘HIGH’ period of a square wave signal, pretty easy to get to frequency from that.

Obviously if your signal looks different you’ll need to adjust what you are looking for but same principal applies.


victor_pv
Thu Jan 26, 2017 5:28 pm
sashmich wrote:victor_pv wrote:sashmich wrote:Yes, attachinterrapt() and micros() I use to measure the frequency. But there are occasional errors. I guess it’s because Systick.

sashmich
Thu Jan 26, 2017 6:05 pm
BennehBoy wrote:Check the code out in this -> https://github.com/BennehBoy/ArduinoSpeedoCorrection

It uses a hardware interrupt to measure the ‘HIGH’ period of a square wave signal, pretty easy to get to frequency from that.

Obviously if your signal looks different you’ll need to adjust what you are looking for but same principal applies.


sashmich
Thu Jan 26, 2017 7:15 pm
Where can I find documentation for this team?
(TIMER1->regs).gen->CR1 = 0x00; it’s example.

sashmich
Thu Jan 26, 2017 7:54 pm
RogerClark wrote:I think You would also need to disable the USB interrupt as well

victor_pv
Thu Jan 26, 2017 8:47 pm
sashmich wrote:BennehBoy wrote:Check the code out in this -> https://github.com/BennehBoy/ArduinoSpeedoCorrection

It uses a hardware interrupt to measure the ‘HIGH’ period of a square wave signal, pretty easy to get to frequency from that.

Obviously if your signal looks different you’ll need to adjust what you are looking for but same principal applies.


sashmich
Fri Jan 27, 2017 5:58 pm
victor_pv wrote:sashmich wrote:BennehBoy wrote:Check the code out in this -> https://github.com/BennehBoy/ArduinoSpeedoCorrection

It uses a hardware interrupt to measure the ‘HIGH’ period of a square wave signal, pretty easy to get to frequency from that.

Obviously if your signal looks different you’ll need to adjust what you are looking for but same principal applies.


victor_pv
Fri Jan 27, 2017 6:45 pm
sashmich wrote:victor_pv wrote:

The thing is, you don’t need to use micro. If you set the timer in PWM capture mode, the timer will start and stop with the input signal, then generate an interrupt, but the count has stopped already, so delays by other interrupts will not affect the count. You wont need micros() or anything similar, just read the 2 counter registers, and that will show how many system clock cycles took for the signal period and duty cycle. So any interrupt serviced will not affect, since it is a hardware timer that starts and stops by itself. The only thing you do in the ISR is read the values, but not start or stop any count.

sashmich
Sun Jan 29, 2017 9:29 am
victor_pv wrote:sashmich wrote:victor_pv wrote:

The thing is, you don’t need to use micro. If you set the timer in PWM capture mode, the timer will start and stop with the input signal, then generate an interrupt, but the count has stopped already, so delays by other interrupts will not affect the count. You wont need micros() or anything similar, just read the 2 counter registers, and that will show how many system clock cycles took for the signal period and duty cycle. So any interrupt serviced will not affect, since it is a hardware timer that starts and stops by itself. The only thing you do in the ISR is read the values, but not start or stop any count.

victor_pv
Sun Jan 29, 2017 7:39 pm
sashmich wrote:
Thank you for the explanation. But it is not yet clear the string value “(TIMER1-> regs) .gen-> CR1 = 0x00;” You can thus can be configured timers?

Leave a Reply

Your email address will not be published. Required fields are marked *