Camtronics
- 22nd April 2011, 12:25
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!
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!