Send command to TFT ILI9341

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

You have an ILI9481 with 8080-8 interface.

Install MCUFRIEND_kbv library with the Library Manager.
Plug the Shield into Uno, Mega, Zero, Due, ...

It should work 100%.

Note that this particular Shield is prone to overheat.

If you want to know how to do "low-level" driving, study how to set a bit in C with |= and to clear it with &=~

Then ask as many questions as you like.

The 0x10 command is the same for any MIPI compliant TFT controller e.g. ILI9341 or ILI9481.

David.

Thanks for reply. I now realised that i used wrong library.
I'll learn bit operators, thanks for advice.
Sebastijan