18F4520 XTAL Flashing LED speed

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Hi,

I have timing errors with a LED flash, on 18F4520 PIC

I have a circuit with these PICs using internals 8mHz timing. I am having problems as there is a start-up LED flash ON/OFF, that appeared to be going far too fast.

I made a simple circuit board, with a 20mHz Crystal plus Caps. The MCLR is 10K pulled-up. And a LED. With a simple program (LVP disabled) and a goto loop (LED on, waitms 1000, LED off, waitms 1000) The LED flashes at 75 ons and 75 offs/min. The crystal shows 20mHz on an oscilloscope.

Any ideas please.

Camerart.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,724
Where is your schematic?

Where is your code?


This should be posted in the embedded forum.
Hi s,

While checking the correct program to post, I noticed I had:
(Define CLOCK_FREQUENCY = 20 'Was 8) at the top
and farther down the program:
(Define CLOCK_FREQUENCY = 8)

It's flashing at the correct speed now, thanks.

P.S. what does embedded forum mean?

C.
 
Last edited:
Top