2011-09-25 10:23 PM
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));}2011-09-25 11:38 PM
''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:
2011-09-27 08:25 AM
2011-09-28 12:16 PM
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.2011-10-01 12:28 PM
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.