How to read timer 1 into a varable for flowcode4
Posted: Tue Jul 21, 2009 11:59 am
I am programming a pic 16HV616 device to sample analog voltage and then adjust output signal timing(in seconds). I need to read the timers 0, 1, and 2. I am using flowcode 4 and don't know how to set an manually read(get the timer value into a variable) the timers.
I do not plan on using interrupts. The sequence goes something like this:
SO my question is how do I set up timer 1, and read the value into a variable? I am using flowcode 4.
Thanks, Dan
I do not plan on using interrupts. The sequence goes something like this:
Code: Select all
Start
sample A/D 1 and calculate delay time 1
sample A/D 2 and calculate delay time 2
Clear and start timer 1
do other functions
read timer 1
is timer 1 > calculated delay time 1 (if yes then switch output and check for delay time 2)
(if not go to do other functions)
Sample A/D 1
is sample 1 < or > last sample value (if yes, calculate new time switch output if new timer < current timer time)
(if not go to do other functions)
Thanks, Dan