Hola Amigos,
Quisiera solicitarles el favor de mirar el siguiente código. La idea es generar el encendido y apagado constante de una serie de leds conectados a los pines 5, 6, y 7 (GP2, GP1, y GP0) de un PIC 12F629. He escrito el código en assembler utilizando el MPLAB; después de simularlo con MPLAB SIM corre bien, pero los estados de los bits del registro GPIO no cambian; sin embargo los del registro TRISIO si van desde 0x09 - 0x0A - 0x0C. ¿está bien escrito? . He estado buscando en el foro y en internet, tengo el datasheet, pero por mas cambios que he hecho no consigo ver nada a la salida.
Algunas partes del código son de las plantillas que carga el MPLAB para cada PIC:
list p=12F629 ; list directive to define processor
#include <p12F629.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file
__CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT
; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
; See data sheet for additional information on configuration word settings.
;**********************************************************************
RESET_VECTOR CODE 0x000 ; processor reset vector
goto main ; go to beginning of program
INT_VECTOR CODE 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register
; these first 4 instructions are not required if the internal oscillator is not used
main call 0x3FF ; retrieve factory calibration value
bsf STATUS,RP0 ; set file register bank to 1
movwf OSCCAL ; update register with factory cal value
bcf STATUS,RP0 ; set file register bank to 0
bcf STATUS,RP0 ;banco 0
clrf GPIO ;inicializar GPIO
movlw 08h
movwf CMCON ;salidas digitales
bsf STATUS,RP0 ;banco 1
movlw 08h
movwf TRISIO ;GP<0:2> salidas y GP<3> entrada
inicio movlw 01h
movwf GPIO
nop
nop
movlw 2h
movwf GPIO
nop
nop
movlw 4h
movwf GPIO
nop
nop
goto inicio
; initialize eeprom locations
EE CODE 0x2100
DE 0x00, 0x01, 0x02, 0x03
END ; directive 'end of program'