where to find timers ... please Urgent
where to find timers ... please Urgent
where to find timers ... i am using PIC 16f84 or AVR ATMEGA8535
- 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: where to find timers ... please Urgent
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.
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;
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
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: where to find timers ... please Urgent
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.
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.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: where to find timers ... please Urgent
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
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

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
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: where to find timers ... please Urgent
Yes, but for some chip tmr0 is also 8-bit. So it's always better to check datasheet.