Race Car Timer not working on PIC

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Race Car Timer not working on PIC

Post by JLeith »

Hello All

I have a very simple race car start timer. It is working in Flowcode but not in the PIC16F1827 ?

My Grandson's were asking if I could build a timer for there race car set.

I have posted my Drawing and Flowcode

Maybe I'm missing something simple.

John
Attachments
Race Car Timer.fcfx
(15.18 KiB) Downloaded 239 times
Race Car Gif.jpg
Race Car Gif.jpg (30.36 KiB) Viewed 2665 times

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: Race Car Timer not working on PIC

Post by medelec35 »

Hi John,
The issues I have spotted are:
1) You have not got a 19.6608 MHz crystal connected on your diagram yet Flowcode is configured as though there is one.
i.e within configuration settings osc is set to HS and not internal osc as the addition of osccon c code block suggests it should be.
If that is the case then clock speed should match the osccon value (0xf0 = 8MHz or 32MHz if pll is enabled)
2) You must have any I/o inputs tied to +5V or 0V via a pull-up or pull-down resistor e.g 2k2 to 10K.
If switch is to pull pin high then a pull-down resistor is required.
If switch is to pull pin low then a pull-up resistor or internal pull-up is required.

Martin
Martin

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: Race Car Timer not working on PIC

Post by JLeith »

Hello Martin

I thought I had checked everything from my old and very old notes but as the day is long I forgot about the OSC and the Bias resistor.

Corrected then and my Grand kids really enjoyed the action of the simple timer. My first Flowcode 6.

Thank you for your help.
Attachments
Project Completed.jpg
Project Completed.jpg (15.18 KiB) Viewed 2641 times

Post Reply