Page 1 of 1

setting Timer-0 offset in C

Posted: Sun Sep 13, 2009 8:11 pm
by rmr
I thought this is no problem.....
I wanted to set the offset of TMR_0 to a value of 240 in an Interrupt-Subroutine in Flowcode V4 for PIC
The properties of Timer 0 don't allow this. So I tried to use C-Code in a C-Code window like

tmr0=240;

(As I saw somewhere here in the forum)

I got this messages:
------start messages---------------------------

Starting preprocessor:.......

..........

error: unknown identifier 'TMR0'
error: invalid operand 'TMR0'
error: failed to generate expression
Balancer 16_test1 aus 16c mit TIMER0 Startwert.c success

failure

------end of messages---------------------------

(I also tried tmr0, tmr_0, TMR_0 ....)

Thanks for a reply
rmr

Re: setting Timer-0 offset in C

Posted: Mon Sep 14, 2009 7:32 am
by Steve
What chip are you using??

Re: setting Timer-0 offset in C

Posted: Mon Sep 14, 2009 1:10 pm
by rmr
Hallo Steve,
I am using Eico 40pin.
Does this depend on the chip? I thought all PICs are using this Interrupt the same way.

Thank You for your Help

rmr

Re: setting Timer-0 offset in C

Posted: Mon Sep 14, 2009 1:40 pm
by Benj
Hello

The names of the registers change depending on the device family.

For the ECIO40 you need to use register name "tmr0l"

In C code this is:

Code: Select all

tmr0l = 240;

Re: setting Timer-0 offset in C

Posted: Mon Sep 14, 2009 2:25 pm
by rmr
Thank You for your quick Help!
It works!
I have seen this command already, but I always thought the last character is the Number "1" but it's an "l" (lowercase of "L"). In Courier it looks just the same!

rmr