Custom interrupt, does it works?
Moderator: Benj
-
- Posts: 122
- Joined: Thu Jun 26, 2014 12:01 pm
- Has thanked: 41 times
- Been thanked: 19 times
- Contact:
Custom interrupt, does it works?
I found an example of a custom interrupt for capture mode of timer1 but flowcode displays error when I'm trying to use it. The website shows the setup and how to retrieve the value of ICR1 register onto a variable, well, the problem is: If I place the line FCV_CAPTVAL = ICR1; on a "C Box" it retrieves an error and it does not compile to the arduino uno with Atmega 328P; however, if I take this "C Box" out (deleted) then it goes through and compiles, the problem is: the value of the capture event is what I need to retrieve (on register ICR1). How can I achieve this? Can somebody tell me? Thanks a lot in advance.
- Attachments
-
- Arduino_frequency3.fcfx
- Here is my program
- (5.61 KiB) Downloaded 200 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Custom interrupt, does it works?
Hello,
This should hopefully work as you are expecting.
This should hopefully work as you are expecting.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 122
- Joined: Thu Jun 26, 2014 12:01 pm
- Has thanked: 41 times
- Been thanked: 19 times
- Contact:
Re: Custom interrupt, does it works?
Thanks a lot for your help Benjamin . Now the program goes through but the macro never gets enable. I don't know if the application is right, it supposed to run when PB0 (ICP1) goes high but it does not capture. ![Sad :(](./images/smilies/icon_sad.gif)
![Sad :(](./images/smilies/icon_sad.gif)