compiling and port error on Hp-488-00-03
Posted: Wed Feb 27, 2008 4:30 am
I am using the HP-488-00-3, and I am using the ASM IDE for compiling,I am writing in assembly
last two week I try to compile the program for 18f1320 in the ASM IDE but gives error
but when I use the MPLAB to compile there is no error,
the error given for the program is:
Error[108] C:\PROGRA~1\KUMAR\18FXX\187013~1.ASM 44 : Illegal character (,)
Error[108] C:\PROGRA~1\KUMAR\18FXX\187013~1.ASM 54 : Illegal character (,)
my code:
;======================================================================================
; setup configuration bits
;
;config OSC = RC ; External RC on OSC1, OSC2 as FOSC/4
;config FSCM = OFF ; Fail-Safe Clock Monitor disabled
;config IESO = OFF ; Internal External Switch Over mode disabled
;config PWRT = OFF ; Power up timer disabled
;config BOR = OFF ; Brown out reset disabled
;config WDT = OFF ; Watch dog timer off
;config MCLRE = OFF ; MCLRE off (pin available for input)
;config LVP = OFF ; Low voltage programming disabled
;config DEBUG = OFF ; Background debugger off
list p=18F1320
include <p18F1320.inc> ;IF we use this not need to declare port address
radix hex
;----------------------------------------------------------------------
; cpu equates (memory map)
Status equ 0xFD8
PORTA equ 0xF80 ; define the potA address
PORTB equ 0xF81 ;
TRISA equ 0xF92
TRISB equ 0xF93
ADCON0 EQU 0XFC2
ADCON1 EQU 0XFC1
LATA EQU 0XF89
LATB EQU 0XF8A
;----------------------------------------------------------------------
org 0x000
CLRF PORTA ;clearing the output
MOVLW 0X00
MOVWF ADCON0
MOVLW 0X7F ;configure the A/D
MOVWF ADCON1 ;for digital inputs
MOVLW 0xFF
MOVWF TRISA, 0
;MOVLW 0xD0 ;values used to set the port
;MOVWF TRISA
;MOVWF LATA ;'11111111'
CLRF PORTB ;clearing the output
MOVLW 0X70 ;
MOVWF ADCON1 ;digital I/O pins
MOVLW 0x00
MOVWF TRISB, 0
;MOVLW 0XCF ;values used to set the port
;MOVWF TRISB
;MOVWF LATB ;'00000000'
Start
bsf PORTB,0
bsf PORTB,1
bsf PORTB,2
bsf PORTB,3
;bsf PORTB,4
;bsf PORTB,5
;bsf PORTB,6
;bsf PORTB,7
goto Start
END
;============================================================================================
after I compile in MPLAB and get the HEX file and download in to the development board through the ASM IDE,
the outputs show in different LED. the following is the chip out put and the LED output at the board.
chip's B0 output at the development board's B2,B1 AT B3, B2 AT A0, B3 AT A1, B4 AT B4, B5 AT B5, B6 AT B6 B7 AT B7,
For the PortA A0 AT A2, A1 AT A3, A2 AT B0, A3 AT B1.
ie when we set the portB 0,1,2,3 the LED lights up in the board is B2,B3,A0,A1
Why like this where is the problem, or the board design in the way
last two week I try to compile the program for 18f1320 in the ASM IDE but gives error
but when I use the MPLAB to compile there is no error,
the error given for the program is:
Error[108] C:\PROGRA~1\KUMAR\18FXX\187013~1.ASM 44 : Illegal character (,)
Error[108] C:\PROGRA~1\KUMAR\18FXX\187013~1.ASM 54 : Illegal character (,)
my code:
;======================================================================================
; setup configuration bits
;
;config OSC = RC ; External RC on OSC1, OSC2 as FOSC/4
;config FSCM = OFF ; Fail-Safe Clock Monitor disabled
;config IESO = OFF ; Internal External Switch Over mode disabled
;config PWRT = OFF ; Power up timer disabled
;config BOR = OFF ; Brown out reset disabled
;config WDT = OFF ; Watch dog timer off
;config MCLRE = OFF ; MCLRE off (pin available for input)
;config LVP = OFF ; Low voltage programming disabled
;config DEBUG = OFF ; Background debugger off
list p=18F1320
include <p18F1320.inc> ;IF we use this not need to declare port address
radix hex
;----------------------------------------------------------------------
; cpu equates (memory map)
Status equ 0xFD8
PORTA equ 0xF80 ; define the potA address
PORTB equ 0xF81 ;
TRISA equ 0xF92
TRISB equ 0xF93
ADCON0 EQU 0XFC2
ADCON1 EQU 0XFC1
LATA EQU 0XF89
LATB EQU 0XF8A
;----------------------------------------------------------------------
org 0x000
CLRF PORTA ;clearing the output
MOVLW 0X00
MOVWF ADCON0
MOVLW 0X7F ;configure the A/D
MOVWF ADCON1 ;for digital inputs
MOVLW 0xFF
MOVWF TRISA, 0
;MOVLW 0xD0 ;values used to set the port
;MOVWF TRISA
;MOVWF LATA ;'11111111'
CLRF PORTB ;clearing the output
MOVLW 0X70 ;
MOVWF ADCON1 ;digital I/O pins
MOVLW 0x00
MOVWF TRISB, 0
;MOVLW 0XCF ;values used to set the port
;MOVWF TRISB
;MOVWF LATB ;'00000000'
Start
bsf PORTB,0
bsf PORTB,1
bsf PORTB,2
bsf PORTB,3
;bsf PORTB,4
;bsf PORTB,5
;bsf PORTB,6
;bsf PORTB,7
goto Start
END
;============================================================================================
after I compile in MPLAB and get the HEX file and download in to the development board through the ASM IDE,
the outputs show in different LED. the following is the chip out put and the LED output at the board.
chip's B0 output at the development board's B2,B1 AT B3, B2 AT A0, B3 AT A1, B4 AT B4, B5 AT B5, B6 AT B6 B7 AT B7,
For the PortA A0 AT A2, A1 AT A3, A2 AT B0, A3 AT B1.
ie when we set the portB 0,1,2,3 the LED lights up in the board is B2,B3,A0,A1
Why like this where is the problem, or the board design in the way