output doesn't stay high


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2007
    Posts
    6

    Default output doesn't stay high

    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.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Try

    HIGH GPIO.X

    X being the pin number.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    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.
    Last edited by dfort; - 5th November 2007 at 17:26.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    How are the config fuses set?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Question

    Hi,

    And what about GPIO.3/MCLR ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This is for the 12F675 using internal OSC
    Code:
    DEFINE OSC 4
    
    ANSEL=%00000000
    CMCON=7
    
    LOOP:
    HIGH GPIO.4
    PAUSE 20
    LOW GPIO.4
    PAUSE 95
    
    GOTO LOOP
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Oct 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    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?

  8. #8
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    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.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 13:35
  2. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  3. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  4. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46
  5. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts