2021-10-11 01:43 AM
I have tried to read ILI9341 LCD controller ID (D3H), but it doesn’t work until now, the EXTC has been high, the result as below:
1. The leve1 command read/write is OK. The leve2 command (EXTC should be high to enable this command) write is OK, read by FMC port is OK but read by SPI is fail.
2.ID1/ID2/ID3 (leve1 command DAH/DBH/DCH) can be programmed by user(level2 command D1H/D2H) successfully .
3. The LCD acknowledges data is different between FMC port and SPI port, for example the 09H command, the first byte data will be invalid, when read by FMC port the acknowledge data will be ‘0x0000610000’, but when read by SPI port acknowledge data will be ‘0X00308000’ (after remove the first dummy bit will be ‘0x00610000’).
if anyone know the root cause?
2023-08-22 06:35 AM - edited 2023-08-22 06:42 AM
Dear EXUE.2,
To read RDID4(0xD3) value via serial interface,
you should throw undocumented serial register index commands(0xD9).
Here is the example of read device id sequence via serial interface.
/**************************************************************************/
/*!
Read ID ILI934x.
*/
/**************************************************************************/
static uint16_t ILI934x_rd_id(uint8_t cmd) /* cmd = D3h*/
{
uint16_t val;
uint16_t temp;
ILI934x_wr_cmd(0xD9); /* SPI Register Read Command */
ILI934x_wr_dat(0x10); /* Read Mode Enable,1st Byte */
temp = ILI934x_rd_cmd(cmd); /* Dummy Read */
ILI934x_wr_cmd(0xD9); /* SPI Register Read Command */
ILI934x_wr_dat(0x11); /* Read Mode Enable,2nd Byte */
temp = ILI934x_rd_cmd(cmd); /* Dummy Read */
ILI934x_wr_cmd(0xD9); /* SPI Register Read Command */
ILI934x_wr_dat(0x12); /* Read Mode Enable,3rd Byte */
temp = ILI934x_rd_cmd(cmd); /* Upper Read */
ILI934x_wr_cmd(0xD9); /* SPI Register Read Command */
ILI934x_wr_dat(0x13); /* Read Mode Enable,4th Byte */
val = ILI934x_rd_cmd(cmd); /* Lower Read */
val &= 0x00FF;
val |= (uint16_t)temp<<8;
return val;
}
And my STM32F4-Discovery projects includes ILI9341 driver is here.
http://nemuisan.blog.bai.ne.jp/?eid=192848#STM32F4
Cheers, Nemui.