Questions? Call us: +1 760-918-6722

ILI9341 SPI life sign?

I have connected the SDT028ATFT to a PIC32 and configured it for 4-line 8bit-data serial interface II. And I can NOT get any life sign from the device, it doesn't matter what commands I send to the SPI interface, nothing comes back to me... Has anyone used the SPI interface with success?

Replies

dtechsupport's picture
dtechsupport
January 9, 2012

For the 2.8", you will need to use a 3 wire 9 bit protocol or you can also use the parallel bus interface, 8 bit bus or 16 bit bus. The factory has hard-wired the ILI9341 into 3-wire 9-bit mode on the FPC, so you will need to use that method for communications. It does work with the PIC24FJ256DA210, you'll just need to change the tri-state of the MOSI line after sending a command requesting data. The following code handles the D/CX bit setting (assuming you're big-banging the SPI as with the Microchip graphics demos).

/************************************************************************

* Function: void GfxTconWriteCommand(BYTE value)
*
* Overview: This writes a word to SPI by calling the write byte
* routine.
*
* Input:
* value - The value that will be written to the register.
*
* Output: none
*
************************************************************************/
void GfxTconWriteCommand(BYTE value)
{
//The CS is already high
GfxTconSetIO(BB_CS, 0);
//Send the D/CX bit
GfxTconSetIO(BB_SCL, 0);
GfxTconSetIO(BB_SDO, 0);
GfxTconSetIO(BB_SCL, 1);
Delay10us(1);
//Send the command
GfxTconWriteByte(value);
GfxTconSetIO(BB_SCL, 0);
Delay10us(1);
GfxTconSetIO(BB_CS, 1);
}
/************************************************************************
* Function: void GfxTconWriteParameter(BYTE value)
*
* Overview: This writes a word to SPI by calling the write byte
* routine.
*
* Input:
* value - The value that will be written to the register.
*
* Output: none
*
************************************************************************/
void GfxTconWriteParameter(BYTE value)
{
//The CS is already high
GfxTconSetIO(BB_CS, 0);
//Send the D/CX bit
GfxTconSetIO(BB_SCL, 0);
GfxTconSetIO(BB_SDO, 1);
GfxTconSetIO(BB_SCL, 1);
Delay10us(1);
//Send the command
GfxTconWriteByte(value);
GfxTconSetIO(BB_SCL, 0);
Delay10us(1);
GfxTconSetIO(BB_CS, 1);
}