cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 + ILI9325 question

tre2020067
Associate II
Posted on September 26, 2011 at 07:23

im trying to interface a ILI9325 and im not 100% understanding how the write function works.

the function was ripped from a driver file for the ILI9325 and the ports PC are used to control the control lines.

why is data shifted and sent twice on two different ports? wouldnt it make more since to send 16bit data at once?

void ili9320_WriteData(u16 data)

{

  u16 temp;

temp = GPIO_ReadOutputData(GPIOB);

GPIO_Write(GPIOB, (data<<8)|(temp&0x00ff));

temp = GPIO_ReadOutputData(GPIOC);

GPIO_Write(GPIOC, (data>>8)|(temp&0xff00));

}
4 REPLIES 4
Andrew Neil
Chief II
Posted on September 26, 2011 at 08:38

''the function was ripped from a driver file for the ILI9325 and the ports PC are used to control the control lines''

You would have to contact the original author for specific questions about that software!

''why is data shifted and sent twice on two different ports?''

 

You would have to contact the original author for specific questions like this about that software!

''wouldnt it make more sense to send 16bit data at once?''

You would have to contact the original author for specific questions like this about that software!

Have you studied the ILI9325 datasheet to see if it gives any clues?

There's lots of other projects using this - have you checked them:

http://www.lmgtfy.com?q=ILI9325

tre2020067
Associate II
Posted on September 27, 2011 at 17:25

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6aU&d=%2Fa%2F0X0000000brG%2F3ifGPASQkfCwNSQ5_nTTRp70m.Yepqmb9Ye.Ugdcnz8&asPdf=false
infoinfo980
Associate II
Posted on September 28, 2011 at 21:16

1. Your sample code is for the ILI9320 not the ILI9325. Unless you're very lucky the startup sequence is going to be different. And it does matter.

2. The backlight is not usually linked to the driver and is usually an independent circuit in the panel. You will need the panel datasheet to see how the LEDs are wired up (usually an array in parallel) and work out a suitable driving circuit for yourself. It is possible that more current is required to drive the backlight than can be supplied from a GPIO pin.

This does not apply if you've bought one of those panels with a board already attached that does 'something' with the backlight circuit. You'll need the board schematic to work out what that 'something' is.

3. The sample code bit-bangs the signals to the GPIO ports and presumably has delays to get the timing right. This is not necessary if you're using an STM32 with an FSMC. Much better to let the FSMC take the strain. Sample code is out there that uses the FSMC and is designed for the ILI9325, not the ILI9320. Google will find it.

tre2020067
Associate II
Posted on October 01, 2011 at 21:28

Thankyou Andy. I setup the fsmc and compiled the new source. however while signal lines are at nominal highs and lows, they dont do anything when i run the firmware. so i do SWD and step instruction by instruction. i watched the FSMC register and there is action but the signals arent working. 

since this is a new problem im going to start a new thread.