void write_8(unsigned char c)
{
PORTB = (PORTB & 0xF8)|(c & 07); // Read PORTB and mask to keep upper 5 bits, Mask c to keep lower 3 bits, OR both together and write back to PORTB
PORTC = (PORTC & 1F)|(c & F8); // Read PORTC and mask to keep lower 3 bits, mask c to keep upper 5 bits, OR both and write back to PORTC
}
void TFT_setup(void)
{
DDRB |= ((1<<PORTB0)|(1<<PORTB1)|(1<<PORTB2)|(1<<PORTB5))
DDRC |= ((1<<PORTC2)|(1<<PORTC3)|(1<<PORTC4)|(1<<PORTC5)|(1<<PORTC6)|(1<<PORTC7))
DDRD |= ((1<<PORTD2)|(1<<PORTD3))
}