This is part of the code, it write to LCD.
Hitachi HD44780. It uses it in 4 bit mode
PORTB bits 0-3 are connected to the LCD data bits 4-7 (high nibble)
Code:lcd_putch(char c) { LCD_RS = 1; // write characters PORTB = (PORTB & 0xF0) | (c >> 4); LCD_STROBE; PORTB = (PORTB & 0xF0) | (c & 0x0F); LCD_STROBE; DelayUs(40); }
I cannot understand the next rows:
PORTB = (PORTB & 0xF0) | (c >> 4);
PORTB = (PORTB & 0xF0) | (c & 0x0F);