lHi All,
Would appreciate some help on a bit of coding for a Pic portB
I originally used the lcd routine written by Ron Kreymborg, but am now wanting to slightly change it, but I just cannot work out one line of the code, as shown in bold type. Radix is set to hex.
Its the ‘ 1 << lcd_RW ’ part of the movlw statement - 1, left shift, lcd-rw ?
The point of the exercise is that I am trying to fully detach the unused PortB,0 from the routine.
many thanks
Richard
; Ron Kreymborg
;******************************************************************
; Flags -
lcd_Bflg equ 0
lcd_RSflg equ 1
; I/O portB -
lcd_BUSY equ 7 ; input - LCD is busy (0x80)
lcd_R_W equ 3 ; output - LCD Read/Write (0x08)
lcd_RS equ 2 ; output - Register Select (0x04)
lcd_E equ 1 ; output - LCD Enable (0x02)
; Check whether the LCD is busy. Loop until it isn't. When
; it's free, output the byte passed in W, MS nibble first.
lcd_d bsf lcd_flags,lcd_RSflg ; set RS flag for data
goto lcd_o1
lcd_c bcf lcd_flags,lcd_RSflg ; clear RS flag for commands
lcd_o1 movwf lcd_temp ; save control word
dotris b'11110000',PORTB ; RB7-4 as inputs for busy
movlw 1 << lcd_R_W
movwf PORTB ; set up for read