Hi,
I am learning how does TFT LCD works and trying to send some command, but it does not work.
I am trying to put lcd into sleep mode.
This is link to LCD I bought: https://www.ebay.com/itm/3-5-Inch-TFT-LCD-Screen-Module-Supports-For-Mega2560-HD-320-480-for-Arduino/253121859308?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
I connected LCD data pins to portD, and control pins to portC.
this is my code, and documentation
void setup() {
////////////////////////////////////////////////////////////////////////////////
// kontrolni pinovi
// RS = Register select
// CS = Chip select
// WR = Write pin
// RD = Read pin
// RST = Reset
DDRC = 0x1F; // B 00011111 // PC0 = RD // PC1 = WR // PC2 = RS // PC3 = CS // PC4 = RESET
DDRD = 0xFF; // B 11111111 // D7, D6, D5, D4, D3, D2, D1, D0
////////////////////////////////////////////////////////////////////////////////
PORTC |= 0x10; // reset HIGH, dont reset
//reset();
PORTD |= 0x00;
_delay_ms(1000);
PORTC |= 0xF3; // CS-LOW, DC-LOW
PORTD |= 0x10; // sleep does not work
_delay_ms(10);
PORTC |= 0xFF;
PORTD |= 0x00;
}
void loop() {
}
// RESET FUNKCIJA
void reset() {
PORTC |= (0 << PC4); // Reset aktiv
_delay_ms(10);
PORTC |= (1 << PC4); // Reset inactiv
}
Thanks in advance, Sebastijan
