12F629 CONFIG

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

Moderator: Benj

Post Reply
siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

12F629 CONFIG

Post by siliconchip »

hi all ive been away from flowcode and electronics for a while and decided to get back with it by programming a 12F 629 which would simply light a led at 1HZ but ive only managed to permanately light the led, ive looked at the datasheet and messed with the OSCCAL settings but on reflection I'm not sure I need to touch this any pointers to guide me would be appreciated :oops:

cheers in advanced bob
Attachments
12f629.fcfx
(7.81 KiB) Downloaded 206 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: 12F629 CONFIG

Post by LeighM »

Can't say I'm familiar with this chip, but in the config you have "RC clock out" and looking at the datasheet it looks like clock out is on the same pin as you have chosen for the LED. So maybe there is a permanent clock out that is activating the LED.

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: 12F629 CONFIG

Post by siliconchip »

hi leigh thanks for the reply, the output I used was because of the clock out thinking it would flash the led, I tried no clock out but the led didn't lite

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: 12F629 CONFIG

Post by siliconchip »

right after playing around abit more I'm now using GP0 as the output and hay presto the led flashes, BUT as I understand it GP4 can be used as an output how do I manage this ive looked through the data sheet and cant find the answer

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: 12F629 CONFIG

Post by Benj »

Hello,

On some of the earlier PIC devices you need an external pull up resistor for pin A4/GP4. The pin can sink current to ground (output low) but cannot source current (output high). I think this is often called an open collector configuration. If you're driving an LED then try wiring in the active low configuration and that should work as expected.

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: 12F629 CONFIG

Post by siliconchip »

Hi benj thanks for the reply i shall give it ago and see what happens

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: 12F629 CONFIG

Post by Benj »

Hmm, Just checked the 629 datasheet and the pin GP4 seems fully featured. I'll have a dig and see if anything comes up.

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: 12F629 CONFIG

Post by siliconchip »

hi benj ive been looking on youtube and found that GP4 when using internal oscillator clockout provides a 1MHz pulse at this pin I believe which would probably mean why my LED on this port is always on which initially gave me the impression it wasn't flashing, if this is the case I guess this when configured as an output and with this oscillator config it would be used as a clock source to drive some other part of circuitry ???

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: 12F629 CONFIG

Post by LeighM »

That's what I was trying to tell you in #2 :)
Have you tried changing the config? ...
no_clock.jpg
no_clock.jpg (65.36 KiB) Viewed 4470 times

Post Reply