Weird problem with 12F629


Closed Thread
Results 1 to 5 of 5
  1. #1
    martarse's Avatar
    martarse Guest

    Unhappy Weird problem with 12F629

    Hello,

    Here is the code I want to make it working :
    define OSC 3
    trisio = %001
    firstline:
    if (GPIO.0 = 0) then
    high GPIO.2
    else
    low GPIO.2
    endif
    goto firstline
    end

    It's a very simple program that works with 16f84a (if I change GPIO for PORTx) but do not works with a 12f629...

    In fact my real program is more complex than this one but the pattern is the same. A switch control an action on 2 output pins instead of only one for this program.

    That program is suposed to turn on a LED(GP2) with a ground applied to port GP0 and turn off the LED(GP2) if a 5V is applied on the GP0.

    Let me know is someone find some problem?? I've already try many way...but the program seems to be very simple...and probably there are something that I've forget to do.

    thanks

    Martin

  2. #2
    martarse's Avatar
    martarse Guest


    Did you find this post helpful? Yes | No

    Thumbs up Problem resolved

    I've read in the PBP Manual...the new version (2004)...my version was from 2002...that for pic micro with comparator (like the 12f629) we have to add a line to the program header.

    CMCON = 7

    This line is used to inform the Picmicro to use GPIO comparator pins as a digital pin.

    Everything works good for now!

    thanks! hihi!

    Hope this will help!

    byebye

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


    Did you find this post helpful? Yes | No

    Default

    Salut Martin!

    always great to know somebody find it by himslef

    this link could be kind of interest for some.
    Steve

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

  4. #4
    martarse's Avatar
    martarse Guest


    Did you find this post helpful? Yes | No

    Default Thanks

    allo Steve,

    Thanks for this link.

  5. #5
    Join Date
    Sep 2003
    Location
    INDIA
    Posts
    161


    Did you find this post helpful? Yes | No

    Default GR8 Link Steve

    Thank you for the URL's

    Rentron is even my favourite site. Learnt a lot from both the sites.

    regards

Similar Threads

  1. Weird code problem
    By Navaidstech in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th March 2009, 11:16
  2. Weird Problem
    By isaac in forum General
    Replies: 9
    Last Post: - 22nd September 2008, 19:30
  3. Problem with 12F629, servo and EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 1st March 2008, 09:53
  4. PIC18F got some weird problem?
    By NatureTech in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 19th February 2007, 16:18
  5. weird 12F629/675 problem
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th October 2004, 01:08

Members who have read this thread : 0

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