Page 1 of 1

where to find timers ... please Urgent

Posted: Sat Nov 01, 2008 4:05 pm
by zenzehar
where to find timers ... i am using PIC 16f84 or AVR ATMEGA8535

Re: where to find timers ... please Urgent

Posted: Mon Nov 03, 2008 11:36 am
by Benj
Hello

Timers can be used by using the interrupt enable icons. If you wish to read the timer registers directly then you will need to create either a single variable or two variables depending on the size of the timer registers.

Eg in flowcode create variables timer1h and timer1l.

Then using a C code block use the following code to pull the data from the timer registers into the Flowcode variables.

Code: Select all

FCV_TIMER1H = tmr1h;
FCV_TIMER1L = tmr1l;

Re: where to find timers ... please Urgent

Posted: Fri Nov 23, 2012 9:43 pm
by nc56
Hello Benj
If I want to read from TMR3 for example canI write
FCV_TIMER3H = tmr3h;
FCV_TIMER3L = tmr3l;
thank you

Re: where to find timers ... please Urgent

Posted: Fri Nov 23, 2012 10:03 pm
by Enamul
Hi
Yes, you have to declare to variable named TIMER3H and TIMER3L and then used c code box where you have to put those two lines. In the rest of the code you can use flowcode variable as normal variable where you will see Timer values.

Re: where to find timers ... please Urgent

Posted: Fri Nov 23, 2012 11:00 pm
by nc56
FCV_TIMER2L and FCV_TIMER2H are unknown by the compilator !

Re: where to find timers ... please Urgent

Posted: Fri Nov 23, 2012 11:06 pm
by Enamul
Variable name should be TIMER2L and TIMER2H to read data from..as compiler knows tmr2l and tmr2h..but to make bridge between c and flowcode you need flowcode variable. Using flowcode variable directly in c code you will get error..but add FCV_ prefix and caps variable compiler can link the variable.

Re: where to find timers ... please Urgent

Posted: Fri Nov 23, 2012 11:32 pm
by nc56
thank you , tat's true :)
for the 18f4550 ;
FCV_TIMER3L=tmr3l;
FCV_TIMER3H=tmr3h;
is working and the same thing for tmr0 and tmr1 because they are on 16 bit but for tmr2 it's only 8 bit
so we can not write tmr2l and tmr2h

Re: where to find timers ... please Urgent

Posted: Sat Nov 24, 2012 12:00 am
by Enamul
Yes, but for some chip tmr0 is also 8-bit. So it's always better to check datasheet.