moving from 16F628A to12F629


Closed Thread
Results 1 to 2 of 2
  1. #1
    Camtronics's Avatar
    Camtronics Guest

    Default moving from 16F628A to12F629

    Hi all,

    I am quite new to PIC programming, although somewhere in my education I must have had it. I am working on a project, currently with the PIC16F628A. I have now made new electronics with the 12F629 in it, and having troubles making the right code for it.

    Below I have added the top of the old and new code files, without the main program though. What the program does is that it turns on ZEND with some pulses, to trigger and wake up another circuit.

    The old working file:

    Device 16F628A
    Config INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, LVP_OFF, MCLRE_OFF
    ALL_DIGITAL TRUE

    Symbol ZEND = PORTA.0
    Symbol CAM = PORTA.1
    Symbol SW = PORTB.5

    Symbol AAN = 0
    Symbol UIT = 1
    Symbol On = 1
    Symbol Off = 0

    TRISA = %00000000 ; PORTA is output
    TRISB = %11111111 ; PORTB is input

    Clear

    PORTA.0 = 1
    PORTB_PULLUPS On

    The new not working file:

    Device 12F629
    CONFIG INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, MCLRE_OFF
    ALL_DIGITAL TRUE

    Symbol ZEND = GPIO.4
    Symbol CAM = GPIO.5
    Symbol SW = GPIO.2

    Symbol AAN = 0
    Symbol UIT = 1
    Symbol On = 1
    Symbol Off = 0

    TRISIO = %11001111 ; 76543210, GPIO.4,5 output, GPIO.2 input

    Clear

    CAM = 0
    ZEND = 1
    PORTB_PULLUPS On

    Anyone got any suggestions? What am I doing wrong here?

    Thanks!

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: moving from 16F628A to12F629

    I would add:
    ADCON0=0
    ANSEL = 0
    EDIT:
    How sure about this config statement are you
    CONFIG INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, MCLRE_OFF
    ALL_DIGITAL TRUE
    especially the All digital true statement? I ask because I am unable to check right now.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Last edited by Archangel; - 22nd April 2011 at 20:41.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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