I have an Olimex usb dev board with a serial icsp. It's the 40 pin package, i got this hoping to interface it with my atmega168 microcontroller that i turned into a pong game.
I used C for the arduino but i wanted to learn asm with the pic so i wanted to start off simple on the pic with a simple asm led light up code,
problem is it won't light up porte or porta.
I compile the code with mplab ide and made sure the selected device was the 16f877a but when i open the .hex file in IC Prog and look at it in asm view i see it has a label for i 16F84 which is not what i selected from the options.
Also when i compile the code it gives me an error message 302 saying that the register in opperand is not in bank 0, but i'm possitive that i'm changing the status register bit 5 high/low to go to and from bank zero/one.
I did leave the pgm on to the pic the first 2 times i tried burning the program to the but i took it out and tried burning multiple prog's multiple times to the pic but does anyone think it might have burnt the pic or something?
;simple code
STATUS equ 03h
TRISE equ 89h
PORTE equ 09h
TRISA equ 85h
PORTA equ 05h
ORG 0x000
goto Initpic
ORG 0x004
goto Initpic
ORG 0x010
Initpic clrf PORTE
clrf PORTA
BSF STATUS, 5
clrf TRISE
clrf TRISA
BCF STATUS, 5
movlw 07h
movwf PORTE
movlw 0ffh
movwf PORTA
goto Initpic
end
the program is suposed to light the led up on any pin on port a/e but it doesn't on any pin can anyone please show me some flaw or error i'm not seeing?
Thanks in advanced i really have no clue why it's not working!
I used C for the arduino but i wanted to learn asm with the pic so i wanted to start off simple on the pic with a simple asm led light up code,
problem is it won't light up porte or porta.
I compile the code with mplab ide and made sure the selected device was the 16f877a but when i open the .hex file in IC Prog and look at it in asm view i see it has a label for i 16F84 which is not what i selected from the options.
Also when i compile the code it gives me an error message 302 saying that the register in opperand is not in bank 0, but i'm possitive that i'm changing the status register bit 5 high/low to go to and from bank zero/one.
I did leave the pgm on to the pic the first 2 times i tried burning the program to the but i took it out and tried burning multiple prog's multiple times to the pic but does anyone think it might have burnt the pic or something?
;simple code
STATUS equ 03h
TRISE equ 89h
PORTE equ 09h
TRISA equ 85h
PORTA equ 05h
ORG 0x000
goto Initpic
ORG 0x004
goto Initpic
ORG 0x010
Initpic clrf PORTE
clrf PORTA
BSF STATUS, 5
clrf TRISE
clrf TRISA
BCF STATUS, 5
movlw 07h
movwf PORTE
movlw 0ffh
movwf PORTA
goto Initpic
end
the program is suposed to light the led up on any pin on port a/e but it doesn't on any pin can anyone please show me some flaw or error i'm not seeing?
Thanks in advanced i really have no clue why it's not working!