PDA

View Full Version : output doesn't stay high



dfort
- 5th November 2007, 15:28
Here's a simple line code:

high 0
End


The output will only stay on for about 5 seconds on the 12f629 and 12f675. Then it will go low and doesn't respond. However the same code works fine on the 12f683.

Is this a limitation of the chip type? Is there a specific code I have to put in for it to sustain a high output?

(Input voltage = 5VDC from 7805 regulator)

Thanks.

mackrackit
- 5th November 2007, 16:17
Try

HIGH GPIO.X

X being the pin number.

dfort
- 5th November 2007, 17:11
I tried this test:

TRISIO = %000000
TimeDelay CON 500

BlinkLoop:
GPIO = %111111
Pause TimeDelay
GPIO= %000000
Pause TimeDelay
Goto BlinkLoop
End




Basically, I am only interested in GPIO.0, GPIO.1 & GPIO.2. On 12f629 & 12f675, sometimes the pins will fire up and start working. Sometimes, I have to flip the switch couple times for it to work. However, it works every time on the 12f683.

This is all on 2 different breadboards with multiple 12f629 and one 12f675 and one 12f683. I don't think all the chips can be defective.

Also, when the 629 & 675 chips are not working, if I touch the chip or one of the I/O pins, the output would start working (driving an LED). I am very puzzled since I have only used the 12f683, but decided to buy cheaper 12f629 models since I don't need all the extra feature.


any more hints? Thanks.

mackrackit
- 5th November 2007, 17:49
How are the config fuses set?

Acetronics2
- 5th November 2007, 17:49
Hi,

And what about GPIO.3/MCLR ???

Alain

mackrackit
- 5th November 2007, 18:15
This is for the 12F675 using internal OSC


DEFINE OSC 4

ANSEL=%00000000
CMCON=7

LOOP:
HIGH GPIO.4
PAUSE 20
LOW GPIO.4
PAUSE 95

GOTO LOOP

dfort
- 5th November 2007, 18:19
for the 629 & 675:
Oscilator: INTOSC
Watchdog Timer: Enabled
Power-Up Timer: Disabled
MCLR Pin Function: Reset
Brown-Out Detect: Disabled
Code: N/P
Data EEPROM: N/P

NEVER MIND!!!!
Thanks. As I type in this message, I see that the MCLR Pin is for Reset. I changed it and reprogram and it works fine.

Thanks again for the help. I am the idiot of the day.

P.S. How come the 12f683 does not exhibit this problem? Does it have a built-in pull-up/down resistor?

Bruce
- 5th November 2007, 22:37
All 3 of these have analog features on GPIO pins, so you'll want to disable analog for each
pin you want to use for digital output.