Here is the actual seller: https://www.aliexpress.com/item/32991977705.html?spm=a2g0o.9042311.0.0.762d4c4dfXfR0D
Only this black board should be used when referencing the FFC pinout.
pin 37 - IM 3 is grounded through a via as well as the previous 2 pins 35 & 35, making FSMC 16 II impossible to achieve.
The other resistors are on pins 17 & 18 - (DB0 & DB1)
I need the 16 bit mode because it fits on the 407VET board pin for pin and 16 bit mode is desirable for speed for one point and I don't know if resolution is at play or not.
I don't why the China and other provided examples don't work...the all say they except the don't.
Please if you can help with a working example as this would take a year or more for a dimwit like me to understand.
FFC Pin#/Function
17 18 17 = DB0
| | 18 = DB1
▄ ▄
R6 R7
____▄ ▄
| |____? ? = Disappears through a micro via to parts unknown
| 13 | 13 = SPI SDI/SDA
| ▄| ▄
| R1 R4
|___▄ ▄____14 14 = SPI-SDO
In order to confirm your findings we are going to have to run some test's. This means writing test code designed to replicate the FSMC function but diving us more control. That is not easily done , we also need you to understand the bus a little more so you in turn understand things like bit shifting, bit bashing as thats needed in your lcd case.
In the manual it states that in 8 bit mode the UPPER 8-bits are used, in 16 then the upper and lower 8 bits are used. This means we need to reverse the bits when *writing in the different modes ,
so 0xFFAA becomes 0xAAFF , that is the lower 8 bits of OUR data get push to the top and the top goes to the bottom.
see this page that also mentions is,
http://www.lcdwiki.com/3.2inch_16BIT_Module_ILI9341_SKU:MRB3205another thing mentioned in the manual is we can read data, including the model number and ID's, this is good as we can use this to test the databus (confirm your findings too)
So lets first look at the read function as we know what it should give us hex value 0x93 and 0x41
in 16 bit mode thats one read of LCD and we should have two reads, one dummy byte and then actual 16 bit data,
e.g
uint16_t dummy=0x0
uint16_t value = 0x9341
and in 8 bit mode it should be
uint8_t ID1 = 0x0
uint8_t ID2 = 0x41
uint8_t ID3 = 0x93
which is three reads
in real code it could be something like this
uint8_t readData8()
{
return *(uint8_t*)DataAccess;
}
uint16_t readData16()
{
return *(uint16_t*)DataAccess;
}
so there are our code parts for the read data primary function, no we have to add more code to do actual reads
uint32_t readID()
{
return readRegister(0xD3, 0, 3); // 0xd3 is second ID register, 0x04 is first
}
uint32_t readRegister(uint8_t nr, uint8_t index, uint8_t bytes)
{
uint32_t rv = 0;
bytes = 4;
writeCommand(nr);
readData(); // dummy
for (uint8_t i = 0; i < index; i++)
{
readData(); // skip
}
for (; bytes > 0; bytes--)
{
rv <<= 8;
rv |= readData();
}
endTransaction();
return rv;
}
so once you have added the above code then in main you add
HAL_UART_write(readID());
and it should print out via serial port (if you have set it up that is, if not you should as its vital part of debug)
darkspr1te