Hi,
I am learning PIC programming in assembly.
I am trying to light a led using PIC16F886.
I am able to light the led only on PIN 6 (RA4).
I have written the program so it lights all the pins of Port A.
Please have a look at the code below and let me know what I am doing wrong.
I am also attaching PIC16F886 diagram for reference.
I am learning PIC programming in assembly.
I am trying to light a led using PIC16F886.
I am able to light the led only on PIN 6 (RA4).
I have written the program so it lights all the pins of Port A.
Please have a look at the code below and let me know what I am doing wrong.
I am also attaching PIC16F886 diagram for reference.
Rich (BB code):
#include <p16F886.inc>
__config _CONFIG1, _DEBUG_OFF & _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _INTOSCIO
__config _CONFIG2, _WRT_OFF & _BOR40V
org 0
Start:
bsf 03h,5 ;to bank 1
movlw 00000000b ;put 00000000 into W register
movwf 85h ;Move 00000000 onto TRISA (all pins set to output)
bcf 03h,5 ;back to bank 0
movlw 11111111b ;write 11111111 into w register
movwf 05h ;move the contents of register w to Port A
end