PDA

View Full Version : 12629 ?'s



earltyso
- 8th August 2008, 21:21
Hello, before you turn your nose at my silly question, please know that I have read the manual several times and searched and searched the forum before asking my question.

that said.....

Why is only one of my GPIO's working??

I am attempting to use the internal oscillator without using CMCON register.

Are my fuse settings wrong?



'DEFINE OSCCAL_1K 1
'DEFINE OSC 4
CMCON = 7
TRISIO = %000000

MAIN:
PAUSE 200
HIGH GPIO.0
HIGH GPIO.1
HIGH GPIO.2
HIGH GPIO.3
PAUSE 200
LOW GPIO.0
LOW GPIO.1
LOW GPIO.2
LOW GPIO.3
GOTO MAIN



GPIO.0 is the only one that blinks...The timing looks right but no output from any of the other pins with my scope.

You can see that I have commented out the OSCCAL lines for now, I am not sure if it is necessary to mess with the RC oscillator settings or not???

The data sheet says the chipset comes with a .....

"Precision Internal 4 MHz oscillator factory calibrated to ±1%"

Does this mean it is an RC oscillator???

I have selected the following drop down under OSCILLATOR [INTOSC IOGP4 IOGP5]

Is this wrong?

I know this chipset gets alot of the same questions about it, I just hope I have asked some new ones...

skimask
- 8th August 2008, 21:37
Are my fuse settings wrong?
There are no fuse settings in your code...
Therefore, GPIO4 and 5 might be being being used by the external crystal, which if you don't have one attached, the program won't run unless it is in fact being run by an internal clock. But you said that GPIO.0 blinks, so it must be running from something.

GPIO.3 is input only...Can't get an output on that even if everything was correct. (HINT: look at the little arrows on the pins in the datasheet.)


The data sheet says the chipset comes with a .....
"Precision Internal 4 MHz oscillator factory calibrated to ±1%"
Does this mean it is an RC oscillator???
No, it means exactly what it says. The PIC contains an internal 4Mhz +/-1% internal oscillator, not an external R/C oscillator.

GPIO.1 and .2 are comparator inputs, but you've set CMCON to the right value...

Are you sure you are actually compiled/assembling the correct file? And actually programming a new file each time you reprogram the chip instead of an older file from way back when?

Archangel
- 8th August 2008, 21:42
Are my fuse settings wrong?


You have not posted any. Datasheet says you must configure the ANSEL or no Digital I/O, try ANSEL = 0
EDIT: Darn Skimask, I'm going to start calling you Quick Draw.

earltyso
- 8th August 2008, 21:56
Got it figured out,
just a wrong fuse setting in my K-149 drop down menu.
I have never tried including fuses in my code as I have always had this option in my GUI, could someone give me a tutorial on say a PIC12F629 OR 16F628A?

mackrackit
- 8th August 2008, 22:19
http://www.picbasic.co.uk/forum/showthread.php?t=543
Read the whole thing.

Darrel Taylor
- 8th August 2008, 22:22
Also,

GP3 is INPUT ONLY.
HIGH GPIO.3 won't work.
<br>
EDIT: Dang it, skimask already said that.
go back to sleep darrel.