| Author |
Message |
koky
Joined: 12 May 2001 Posts: 156 Helped: 3 Location: Italy
|
30 Apr 2006 23:44 what (1<<LCRW) mean ? |
|
|
|
|
I have found this source, but i don't understand why is used movlw (1<<LCRW)
what is the result ? why is not used a real value?
LCEN equ 1 ;rb1
LCRW equ 2; rb2
LCRS equ 3;rb3
tst_lcd_busy
movlw (1<<LCRW)
movwf PORTB
waitbusy
bsf PORTB,LCEN ; get hi-Nibble
rlf PORTB,w ; Busy-flag to Carry
bcf PORTB,LCEN
bsf PORTB,LCEN ; get lo-Nibble
bcf PORTB,LCEN
btfsc STATUS,C ;
goto waitbusy ;
return
|
|
| Back to top |
|
 |
Google AdSense

|
30 Apr 2006 23:44 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
BeeBop
Joined: 19 Feb 2006 Posts: 161 Helped: 15
|
01 May 2006 1:51 Re: what (1<<LCRW) mean ? |
|
|
|
|
Hi Koky,
I may be wrong here, but, are you sure that is not (LCRW<<1) which means shift reg defined as LCRW (2) left one bit?
Regards,
Robert
|
|
| Back to top |
|
 |
koky
Joined: 12 May 2001 Posts: 156 Helped: 3 Location: Italy
|
01 May 2006 10:49 Re: what (1<<LCRW) mean ? |
|
|
|
|
is : movlw (1<<LCRW)
and the software work, but i don't like use sw with strange assembler, i prefer rewrite it in more readable system
|
|
| Back to top |
|
 |
dragan
Joined: 08 Apr 2001 Posts: 55 Helped: 3
|
01 May 2006 11:59 Re: what (1<<LCRW) mean ? |
|
|
|
|
THIS IS A PROGRAMED SHIFT.Shift 1 left for a value writed in LCRW.It is a common use in a IAR C compiler.
EG: /* Enable receiver and transmitter */
UCSR0B = (1<<RXEN)|(1<<TXEN);
/* Set frame format: 8data, 2stop bit */
UCSR0C = (1<<USBS)|(3<<UCSZ0);
}
Greetings
Dragan
|
|
| Back to top |
|
 |