I am looking for some help with my programming. i am new to all this so was wondering if any one would be able to look at my code below and just let me know if there is a problem with it and where im going wrong. i am using hp-488-00-3 development board and i'm using pic16f84.
using a 16x2 line lcd screen. using mp lab with programming
Code: Select all
#DEFINE PAGE0 BCF STATUS,5
#DEFINE PAGE1 BSF STATUS,5
STATUS = 0x03
trisb = 0x06
portb = 0x06
w = 0
f = 1
c = 0
z = 2
org 4
org 5
CLRF portb
PAGE1
CLRF trisb
PAGE0
movlw 0x02 ;MSB ;Function Set
movwf portb
BSF portb,5 ;set B5 high
BCF portb,5 ;set b5 low
movlw b'00000000'
movwf portb
nop
movlw 0x08 ;LSB
movwf portb
BSF portb,5 ;set b5 high
BCF portb,5 ;set b5 low
nop
nop
movlw 0x00 ;MSB ;Display Controller
movwf portb
BSF portb,5 ;set b5 high
BCF portb,5 ;set b5 low
movlw b'00000000'
movwf portb
nop
movlw b'00001111' ;LSB
movwf portb
BSF portb,5 ;set b5 high
BCF portb,5 ;set b5 low
nop
nop
movlw b'00000000' ;MSB ;Clear Display
movwf portb
BSF portb,5 ;set b5 high
BCF portb,5 ;set b5 low
movlw b'00000000'
movwf portb
nop
movlw b'00000001' ;LSB
movwf portb
BSF portb,5 ;set b5 high
BCF portb,5 ;set b5 low
nop
nop
movlw b'00001110' ; n with scribble
movwf portb
BSF portb,5
BCF portb,5
movlw b'00000000'
movwf portb
nop
movlw b'00001110'
movwf portb
BSF portb,5
BCF portb,5
nop
nop
end