PIC External or Internal Clock

Thread Starter

JDR04

Joined May 5, 2011
356
Hi everyone. I'm using a PIC16F690 and have a simple program that flashes two LED's alternatively.

At the moment the PIC is plugged into a low pin count demo board and is programmed with the PICKit2 programmer.

My program is done with FLOWCODE 5 and works great.

What I want to know is how to run the PIC in its own circuit without the PICKit2 programmer or low pin count demo board. I think the PIC is currently being run by an internal clock, and can I also use it independantly from the programmer etc???

I'm totally new to this and would appreciate any help.
Thanks a lot-JDR04
 
Last edited:

tshuck

Joined Oct 18, 2012
3,527
I'm not entirely sure what you are asking.
Do you mean to ask if the microcontroller can be run off of its internal oscillator? If so, yes, it can. How you'd configure that with FLOWCODE, I'm not sure...

Or, do you mean to ask if you can use the PIC without the demo board/pickit connection? Again, yes, you can.
 

Thread Starter

JDR04

Joined May 5, 2011
356
Thanks tshuck. Would you be able to explain to me how I can run the PIC without the PICKit2 conection.

Thanks again JDR04
 

tshuck

Joined Oct 18, 2012
3,527
Well, one thing people usually miss when starting out is the MCLR. This is a reset that can be disabled (see "Configuration Words "), and is typically associated with an input only pin. A pull-up resistor will allow your PIC to run. 10k is my typical value pull-up.

Next, you need to set the oscillator configuration in the configuration word(s). See page 201 and following, in the datasheet (from Microchip), for the configuration bits and what they do.

After that, you weep probably want to disable the watchdog timer, also configuration word.

Once that is done, you will probably want to set the internal oscillator to a specific frequency; use the OSCCON register for this.

You should also put a ~100uF cap across the supply pins as close to the PIC as reasonable.
 

ErnieM

Joined Apr 24, 2011
7,993
One thing I don't see mentioned is POWER. What's going to power your PIC without a PICkit?

5 volts is nominal, 4.5 volts is acceptable, so you could use 3 batteries in series.
 

t06afre

Joined May 11, 2009
5,936

On your board. You can solder a power source to the P2 connector. If you have some old cell-phone charger. This may be used. As long as it is labeled with an output voltage in range 4 to 5 volt
 
Top