Page 1 of 1

Timer0 not reset Pic 16f88 solved no bug!

Posted: Thu Jun 08, 2017 9:12 pm
by jgu1
Hi!

It is not possible to compile my program in FC7. I am trying to reset TMR0 by help of a C macro. But get an error code1 if I do this.

In FC5 it work fine.

Or am I doing something wrong.

Br Jorgen

Re: Timer0 not reset Pic 16f88!

Posted: Fri Jun 09, 2017 12:48 am
by medelec35
Hi Jorgen,
Since FC5 &n FC6 uses a different compiler from FC7 then the syntax will be different.
Instead of

Code: Select all

tmr0 = 0x00;
= BoostC format
You must use

Code: Select all

TMR0 = 0x00;
= XC format.
Take a look at this post

As its not a bug, I have moved topic to a more appropriate section.

Martin

Re: Timer0 not reset Pic 16f88!

Posted: Fri Jun 09, 2017 5:40 am
by jgu1
Hi Martin!

Well well, I did not knew this. I make a test later today. You hear. Thank you Martin.

Br Jorgen

Re: Timer0 not reset Pic 16f88 solved no bug!

Posted: Fri Jun 09, 2017 5:51 pm
by jgu1
Hi Martin!

Now I can compile. Do you know, is it correct in Arduino Mega if I want to reset INT0 the C code is : TCCR0A = 0;

Thanks in advance.

Jorgen

Re: Timer0 not reset Pic 16f88 solved no bug!

Posted: Mon Jun 12, 2017 12:57 am
by medelec35
Hi Jorgen,
Sorry for the delay.
I have been on a short holiday from Friday to Sunday.
Glad Flowchart compiles for you now.
Thaks for keeping us updated.
jgu1 wrote:s it correct in Arduino Mega if I want to reset INT0 the C code is : TCCR0A = 0;
Sorry I have not had anything to do with Arduino Mega.
I will leave that question to those that actually know.
I'm thinking of purchasing one so I can have a play,

Martin

Re: Timer0 not reset Pic 16f88 solved no bug!

Posted: Mon Jun 12, 2017 6:01 am
by jgu1
Hi Martin!

No sorry, it is weekend... offtime :lol: Again thank's for your help.

Br Jorgen

Re: Timer0 not reset Pic 16f88 solved no bug!

Posted: Wed Jun 14, 2017 3:23 pm
by Benj
Hello,
Now I can compile. Do you know, is it correct in Arduino Mega if I want to reset INT0 the C code is : TCCR0A = 0;
TCCR0A is the Timer 0 control register. If you want to reset the timer 0 count register then you need to use the following code.

Code: Select all

TCNT0 = 0;
You mention INT0, did you mean timer 0 or external interrupt pin INT0 on pin D0?

Re: Timer0 not reset Pic 16f88 solved no bug!

Posted: Wed Jun 14, 2017 4:22 pm
by jgu1
Hi Ben!

Yes timer 0, my mistake. Thanks for reply and info. By the way, test Tour bme280 program Thisted evening :D

Br. Jorgen