vinodstanur
Advanced Member level 3

- Joined
- Oct 31, 2009
- Messages
- 755
- Helped
- 114
- Reputation
- 234
- Reaction score
- 114
- Trophy points
- 1,333
- Location
- Kerala (INDIA)
- Activity points
- 7,090
Today I just started to learn ASM for PIC.
I could build the ABSOLUTE CODE successfully and it is tested ok in both simulator and Hardware.
There after, i tried to download that code using a bootloader in PIC16F877A.
But that code(LED blinking) is not working when i use bootloader to download the code to PIC.
Then i guess, i should generate RELOCATABLE code....Is it?
IF YES:
But it is showing many errors...
Then what modifications are to be done in below LED blinking program, so that i could generate RELOCATABLE CODE?
I could build the ABSOLUTE CODE successfully and it is tested ok in both simulator and Hardware.
There after, i tried to download that code using a bootloader in PIC16F877A.
But that code(LED blinking) is not working when i use bootloader to download the code to PIC.
Then i guess, i should generate RELOCATABLE code....Is it?
IF YES:
But it is showing many errors...
Then what modifications are to be done in below LED blinking program, so that i could generate RELOCATABLE CODE?
Code ASM - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 ;*****Set up the Constants**** STATUS equ 03h ;Address of the STATUS register TRISD equ 88h ;Address of the tristate register for port A PORTD equ 08h ;Address of Port A COUNT1 equ 20h ;First counter for our delay loops COUNT2 equ 21h ;Second counter for our delay loops COUNT3 equ 23h ;Second counter for our delay loops ;****Set up the port**** bsf STATUS,5 ;Switch to Bank 1 movlw 00h ;Set the Port A pins movwf TRISD ;to output. bcf STATUS,5 ;Switch back to Bank 0 movlw h'10' movwf COUNT3 ;****Turn the LED off**** Start call Delay movlw h'00' movwf PORTD ;****Turn the LED on**** call Delay movlw h'ff' movwf PORTD goto Start ;delay routine Delay Loop1 decfsz COUNT1,1 goto Loop1 decfsz COUNT2,1 goto Loop1 decfsz COUNT3,1 goto Loop1 movlw h'5' movwf COUNT3 return end
Last edited: