- #1
mario_
- 1
- 0
Hi there! I've got a small, but rather tedious problem with programming a PIC16F628A micro-controller using a USB programmer.
The assembly code is simple:
list p=16f628a
#include <p16f628a.inc>
ORG 0x000
goto main
main
clrf PORTA
movlw 07h ;Turn off comparators
movwf CMCON
bsf STATUS,RP0
clrf TRISA
movlw 00h
movwf VRCON
bcf STATUS,RP0
loop
movlw 01h
movwf PORTA
goto loop
END
This is just a test program to set one of the bits on PORTA high. Using MPLAB and the PICkit2 programmer, I'm able to build the project and program it, however when I check the value on the pin, it is always low. When I extracted the HEX file from the the PIC, it wasn't even close to the HEX file that was supposedly programmed onto the PIC!
Help Please!
The assembly code is simple:
list p=16f628a
#include <p16f628a.inc>
ORG 0x000
goto main
main
clrf PORTA
movlw 07h ;Turn off comparators
movwf CMCON
bsf STATUS,RP0
clrf TRISA
movlw 00h
movwf VRCON
bcf STATUS,RP0
loop
movlw 01h
movwf PORTA
goto loop
END
This is just a test program to set one of the bits on PORTA high. Using MPLAB and the PICkit2 programmer, I'm able to build the project and program it, however when I check the value on the pin, it is always low. When I extracted the HEX file from the the PIC, it wasn't even close to the HEX file that was supposedly programmed onto the PIC!
Help Please!