Wacth

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

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

Wacth

Post by jgu1 »

Hi Team! :D

I am trying to make a simple wacth. I use a Pic18f4525 on EB006 board and 19.0668 Mhz Xtal. But already after few minute I lose second´s. Please would some of your expert be so kind to check the program and se if I made some fault. I suspect the hardware (Xtal). :oops:

Best regard

Jgu1
Attachments
Ur 4525.fcf
(12.4 KiB) Downloaded 263 times

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: Wacth

Post by Benj »

Hello,

I have made a couple of minor mods to your program and hopefully it should now run correctly for you. I think the problem before was that you were calling the display macro from the interrupt which means you may be in the interrupt routine too long and miss timer counts.

I also moved the reset of the timer count variable as there was a possibility that it would not be reset which again would lead to the timer not counting the time correctly.
Attachments
Ur 4525.fcf
(15 KiB) Downloaded 265 times

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

Re: Wacth

Post by jgu1 »

Hi Ben

Unfortunately did not help. I must try to change the crystal, it may well be not running as it should. But otherwise, many thanks for your help.

Best regard

Jgu1 :?:

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

Re: Wacth

Post by medelec35 »

Before you change crystal, try this version.
The problem you had with your Flowchart is you 1st check to see if seconds = 60, then if not the seconds are incremented by 1. So if seconds = 59 then 1 is added to the second.
This means that each minute is incremented every 61 seconds and not every 60 seconds.
So to correct I have changed Sek=60 to Sek=59 and same with mins. Normaly you add 1 to seconds, then check to see if seconds = 60.
I have also completed some other minor alterations.

Martin
Attachments
Ur 4525 Modidfied.fcf
(12.81 KiB) Downloaded 283 times
Martin

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

Re: Wacth

Post by jgu1 »

Hi medelec.

Yes, yes. Now fit the time, 100% Even small mistakes can have large fluctuations.
Now I can get on with the project. I must have created the opportunity to set the time, but it's no problem.
So far many thanks for the quick response and help when I find out how to do, you get many stars. :D :D :D

Best regard

jgu1

Post Reply