Himax HX8309 (Ampire AM176220)
Controller: Himax HX8309.
Panel: Ampire AM176220 and similar panels.
Type: TFT, color, 16 bits/pixel.
Locking: Supported, display picture stays stable for at least 1 second after the display is locked. Unfortunately, there appears to be a hardware bug in the HX8309. This bug causes one of the horizontal lines of the panel (usually, the top or bottom line) to display random garbage while the display is locked. We have some ideas for workaround — contact us if you encounter this problem.
Test hardware: TEV-LB2 test board. This board is a part of the EM1000TEV development system.
I/O Mapping for AM176220
The panel requires five I/O lines and a 17-bit data bus, of which only bits DB7~0 are used (8-bit interface mode). The control lines are RESET, RS, WR, RD, and CS. Each control line can be connected to any I/O pin of your device, and each such I/O pin must be configured as an output (if your device requires explicit I/O line buffer configuration). The data bus can be connected to any 8-bit port. DO NOT configure this port for output.
The controller also has IM0 and IM3 interface type selection pins. For proper operation, tie IM0 to Vcc and IM3 to the ground.
The value of the lcd.iomapping property must be set correctly for the display to work (see Preparing the Display for Operation). For this particular display, the mapping string consists of six comma-separated decimal values:
- Number of the I/O line connected to RESET.
- Number of the I/O line connected to RS.
- Number of the I/O line connected to WR.
- Number of the I/O line connected to RD.
- Number of the I/O line connected to CS.
- Number of the I/O port connected to DB7-0.
I/O line numbers are from the pl_io_num enum. The port number is from the pl_io_port_num enum. The line and port numbers are platform-specific. See the list of pl_io_num and pl_io_port_num constants in the platform specifications.
For the TEV-LB2, lcd.iomapping should be set to "44,43,42,41,40,4."
Code Example — TEV-LB2
This code will properly set up and enable this controller/panel (we assume that the testing is done using the TEV-LB2):
lcd.iomapping="44,43,42,41,40,4" 'RESET,RS,WR,RD,CS,DB7-0
io.num=PL_IO_NUM_44 'RESET
io.enabled=YES
io.num=PL_IO_NUM_43 'RS
io.enabled=YES
io.num=PL_IO_NUM_42 'WR
io.enabled=YES
io.num=PL_IO_NUM_41 'RD
io.enabled=YES
io.num=PL_IO_NUM_40 'CS
io.enabled=YES
'set resolution
lcd.width=176
lcd.height=220
'optionally set lcd.rotated here
lcd.enabled=YES 'done!
'turn on the backlight (strictly speaking, this is not related to the LCD control, but we still show it here)
io.num=PL_IO_NUM_47
io.enabled=YES
io.state=HIGH