Author Topic: Interrupt atmell  (Read 1092 times)

0 Members and 1 Guest are viewing this topic.

Offline BandzaiTopic starter

  • Newbie
  • Posts: 1
  • Country: bj
Interrupt atmell
« on: August 02, 2016, 06:30:56 pm »

Hello, I'd like to know how to do it correctly generates an interrupt on a microcontroller from Atmel, a SAMD10.
I am currently working on the RTC module and I had created a small program that would light an LED when the counter of the RTC module was equal at the value
that I fixed (1 second) with a flag on the COMP register.

Currently, I want to generate an interrupt without using the ASF library that is too large.
My program is composed of multiple files so I want to generate an interrupt when the value of my counter is equal to the register count.
I tried things without great success.


But I do not see how writing this interruption without using the ASF? If I use the flags, we have to wait until my program gets to the line of code with the condition if (...). In any case, if I only write a condition that will not work.
I can understand the interruption but I can not put it into practice. I understand that if the RTC module counter reaches a second, I have to interrupt
the execution of the current program to return to the execution of subprogramme corresponding to the interruption.


Does someone could tell me how to implement an interruption?

thanks
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Interrupt atmell
« Reply #1 on: August 02, 2016, 11:35:54 pm »
https://github.com/WestfW/SAMD10-experiments
has code to initialize and use RTC interrupts. (Down in https://github.com/WestfW/SAMD10-experiments/blob/master/D10-LED_TOGGLE0/src/UserSource/ticker_rtc.c - but read the comments in the top level readme...)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf