what differences in the config settings would i have to use to use a program written for a PIC16F628 on a PIC16F628a.
What other things would I need to do to the program to get it working.
Sorry but I just dont understand the differences on the datasheets
Here is the start of the 628 file
list p=16f628a ; list directive to define processor
#include <p16f628a.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _INTOSC_OSC_NOCLKOUT & _LVP_OFF
errorlevel -302 ; suppress banksel warning messages during assembly
errorlevel -311 ; suppress HIGH operator warning messages during assembly
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;**********************************************************************
ORG 0x000 ; processor reset vector
goto main ; go to beginning of program
ORG 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
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt
init CLRF PORTA ;Initialize PORTA by setting
;output data latches
BSF PORTA,LED
MOVLW 0X07 ;Turn comparators off and
MOVWF CMCON ;enable pins for I/O
;functions
BCF STATUS, RP1
BSF STATUS, RP0 ;Select Bank1
MOVLW b'11111101' ;Value used to initialize
;data direction
MOVWF TRISA ;Set RA<1> as output
MOVLW b'00000000' ;Value used to initialize
;data direction
MOVWF TRISB ;Set Rb<7:0> as outputs
BCF STATUS, RP0 ;Select bank 0
return ;return from subroutine
I take it that all the variables can be used on either chip so i wouldnt need to change them (or not??)
Many thnaks
allen
What other things would I need to do to the program to get it working.
Sorry but I just dont understand the differences on the datasheets
Here is the start of the 628 file
list p=16f628a ; list directive to define processor
#include <p16f628a.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _INTOSC_OSC_NOCLKOUT & _LVP_OFF
errorlevel -302 ; suppress banksel warning messages during assembly
errorlevel -311 ; suppress HIGH operator warning messages during assembly
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;**********************************************************************
ORG 0x000 ; processor reset vector
goto main ; go to beginning of program
ORG 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
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt
init CLRF PORTA ;Initialize PORTA by setting
;output data latches
BSF PORTA,LED
MOVLW 0X07 ;Turn comparators off and
MOVWF CMCON ;enable pins for I/O
;functions
BCF STATUS, RP1
BSF STATUS, RP0 ;Select Bank1
MOVLW b'11111101' ;Value used to initialize
;data direction
MOVWF TRISA ;Set RA<1> as output
MOVLW b'00000000' ;Value used to initialize
;data direction
MOVWF TRISB ;Set Rb<7:0> as outputs
BCF STATUS, RP0 ;Select bank 0
return ;return from subroutine
I take it that all the variables can be used on either chip so i wouldnt need to change them (or not??)
Many thnaks
allen