12F629 help


Closed Thread
Results 1 to 5 of 5

Thread: 12F629 help

  1. #1
    Join Date
    Sep 2005
    Location
    California USA
    Posts
    7

    Cool 12F629 help

    I have wired up a 12f629 to flash some LEDs on the GP0 and GP1 pins and I also use a 4 Mhz Xtal on GP4 and GP5.

    The code I wrote is

    loop:
    high GPIO.0
    pause 750
    low GPIO.0
    pause 750
    high GPIO.1
    pause 750
    low GPIO.1
    pause 750
    goto loop
    end

    But when I power it up it dose nothing.

    Can someone help.

    Willie

  2. #2
    Join Date
    Feb 2005
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Dont forget to set the analogue ports to digital.
    I believe it to be cmon = 7
    Pete

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    AND be sure you correctly set the config fuses. See the FAQ about that.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Sep 2005
    Location
    California USA
    Posts
    7


    Did you find this post helpful? Yes | No

    Cool 12F629 help

    Pete and Steve thank for your reply.
    Pete I do have the cmcon = 7 at tie top of my code.
    And Steve I set the fuses to XT,MCLR to reset,Watchdog Timer on,Power-up Timer off.
    But I still don't get anything.

    Willie

  5. #5
    Join Date
    Sep 2005
    Location
    Dayton, Ohio
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    Set MCLR to OFF, so it is an I/O pin, (otherwise you need a 5K resistor from MCLR (GP3) to +5V). Depends on your application. Do you need RESET? If not, then disable it and you get another input to use (GP3).

    CMCON = 7 ' this turns the COMPARATOR off
    ANSEL = 0 ' this turns the A/D convertors off

    And don't forget that if you decide to use GP3 it is INPUT ONLY.

    BTW - ALWAYS read the Datasheet!!! Look at the first few pages where is shows all the functions for each pin (especially the pin that is causing problems). If there are more functions than just "I/O" then you MUST go to those sections in the datasheet to see what the defaults are. Usually I/O is NOT the default. It's a little tedious at first, but saves a lot of headaches later. And usually you will find the answer quicker than asking here (but when you are really stuck, this forum is a life saver).

    regards,
    Jim
    Jim Robertson
    "MilesTag" DIY Lasertag
    www.lasertagparts.com/mtdesign.htm
    Dayton, Ohio

Similar Threads

  1. Input problems with 12F629?
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 24th April 2018, 06:25
  2. 12F629 LDR - Light Dependant Resistor
    By Dennis in forum Schematics
    Replies: 15
    Last Post: - 18th February 2010, 22:33
  3. 12f629 config settings
    By Dennis in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st December 2009, 22:39
  4. Basic help for 12F629
    By Gene Choin in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd September 2009, 04:06
  5. Servo control with 12F629
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd June 2005, 23:34

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