Page 1 of 1

Custom interrupt, does it works?

Posted: Tue Sep 08, 2015 2:15 pm
by 407charles
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.

Re: Custom interrupt, does it works?

Posted: Tue Sep 08, 2015 3:06 pm
by Benj
Hello,

This should hopefully work as you are expecting.
Arduino_frequency3.fcfx
(5.53 KiB) Downloaded 255 times

Re: Custom interrupt, does it works?

Posted: Fri Sep 11, 2015 3:27 pm
by 407charles
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. :(