Timer0 not reset Pic 16f88 solved no bug!

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Timer0 not reset Pic 16f88 solved no bug!

Post 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
Attachments
PicUdfald.fcfx
(10.08 KiB) Downloaded 254 times
Last edited by jgu1 on Fri Jun 09, 2017 5:44 am, edited 1 time in total.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Timer0 not reset Pic 16f88!

Post 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
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Timer0 not reset Pic 16f88!

Post by jgu1 »

Hi Martin!

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

Br Jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

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

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

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

Post 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
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

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

Post by jgu1 »

Hi Martin!

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

Br Jorgen

User avatar
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: Timer0 not reset Pic 16f88 solved no bug!

Post 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?

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

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

Post 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

Post Reply