Discussion:
hymini-stm32 lcd bringup
(too old to reply)
a_pyles
2013-01-10 03:34:45 UTC
Permalink
I recently purchased a "hymini-stm32" from ebay that includes an attached 3.2" lcd touchscreen. I am having trouble enabling the screen.

Using the latest version nuttx, I enabled debug, and I see that in
configs/hymini-stm32v/src/ssd1289.c: in up_lcdinitialize() that:

read_reg(0x0) is returning 0.

Does this mean that my hymini has a different chipset?
The LCD that is attached to the "hymini-stm32" is labled "HY32D".

Andy
Gregory N
2013-01-10 14:13:18 UTC
Permalink
Hi, Andy,
Post by a_pyles
I recently purchased a "hymini-stm32" from ebay that includes an attached 3.2" lcd touchscreen. I am having trouble enabling the screen.
Using the latest version nuttx, I enabled debug, and I see that in
read_reg(0x0) is returning 0.
Does this mean that my hymini has a different chipset?
The LCD that is attached to the "hymini-stm32" is labled "HY32D".
That port was contributed and I do not have the Hy Mini STM32 board. So I cannot help. Perhaps there is someone else on the list using that board?

Greg
Dave Marples
2013-01-10 15:03:39 UTC
Permalink
Typically a zero readback from the ID register means you're not
communicating corectly with the LCD driver. I think this board uses a
SSD1289 chip so you should be expecting to read back 0x8989 from
location zero. Data sheet is at;

http://www.kosmodrom.com.ua/el/STM32-TFT/SSD1289.pdf

...beware that your board _may_ use a different LCD/chipset, but I'd
check your I/O pins and directions etc. before suspecting
software...once you've got something back from the chip, then software
becomes more of a candidate.

DAVE
Post by Gregory N
Hi, Andy,
Post by a_pyles
I recently purchased a "hymini-stm32" from ebay that includes an
attached 3.2" lcd touchscreen. I am having trouble enabling the screen.
Post by a_pyles
Using the latest version nuttx, I enabled debug, and I see that in
read_reg(0x0) is returning 0.
Does this mean that my hymini has a different chipset?
The LCD that is attached to the "hymini-stm32" is labled "HY32D".
That port was contributed and I do not have the Hy Mini STM32 board.
So I cannot help. Perhaps there is someone else on the list using that
board?
Greg
Andy Pyles
2013-01-11 13:10:46 UTC
Permalink
Thanks Dave for the info. I'm now thinking that the HY32D has a different
chipset per:
http://www.haoyuelectronics.com/Attachment/HY32D/HY32D%20LCD%20module%20schematic.pdf

Looks like an ILI9320 from that link. Weird thing is on the original
schematic (dated the same day) that I was sent did not include that tidbit.
Post by Dave Marples
**
Typically a zero readback from the ID register means you're not
communicating corectly with the LCD driver. I think this board uses a
SSD1289 chip so you should be expecting to read back 0x8989 from location
zero. Data sheet is at;
http://www.kosmodrom.com.ua/el/STM32-TFT/SSD1289.pdf
...beware that your board _may_ use a different LCD/chipset, but I'd check
your I/O pins and directions etc. before suspecting software...once you've
got something back from the chip, then software becomes more of a candidate.
DAVE
Hi, Andy,
Post by a_pyles
I recently purchased a "hymini-stm32" from ebay that includes an
attached 3.2" lcd touchscreen. I am having trouble enabling the screen.
Post by a_pyles
Using the latest version nuttx, I enabled debug, and I see that in
read_reg(0x0) is returning 0.
Does this mean that my hymini has a different chipset?
The LCD that is attached to the "hymini-stm32" is labled "HY32D".
That port was contributed and I do not have the Hy Mini STM32 board. So I
cannot help. Perhaps there is someone else on the list using that board?
Greg
Gregory N
2013-01-11 14:08:36 UTC
Permalink
Hi, Andy,
Post by Andy Pyles
Thanks Dave for the info. I'm now thinking that the HY32D has a different
http://www.haoyuelectronics.com/Attachment/HY32D/HY32D%20LCD%20module%20schematic.pdf
Looks like an ILI9320 from that link. Weird thing is on the original
schematic (dated the same day) that I was sent did not include that tidbit.
There is support for the ILI9320 for the STM3240G-EVAL, the STM3220G-EVAL, and the Shenzhou boards. Those configurations are at

configs/stm3220g-eval,
configs/stm3240g-eval, and
configs/shenzhou

The LCD drivers are at:

configs/stm3220g-eval/src/up_lcd,
configs/stm3240g-eval/src/up_lcd.c, and
configs/shenzhou/src/up_ili93xx.c

It should not be difficult to leverage those drivers to the HyMini.

Greg
Dave Marples
2013-01-11 14:15:37 UTC
Permalink
Post by Gregory N
Hi, Andy,
Post by Andy Pyles
Thanks Dave for the info. I'm now thinking that the HY32D has a
different
http://www.haoyuelectronics.com/Attachment/HY32D/HY32D%20LCD%20module%20schematic.pdf
Post by Andy Pyles
Looks like an ILI9320 from that link. Weird thing is on the original
schematic (dated the same day) that I was sent did not include that
tidbit.
There is support for the ILI9320 for the STM3240G-EVAL, the
STM3220G-EVAL, and the Shenzhou boards. Those configurations are at
configs/stm3220g-eval,
configs/stm3240g-eval, and
configs/shenzhou
configs/stm3220g-eval/src/up_lcd,
configs/stm3240g-eval/src/up_lcd.c, and
configs/shenzhou/src/up_ili93xx.c
It should not be difficult to leverage those drivers to the HyMini.
Greg
I'd still be suspicious of the connection to the LCD though - The IL9320
should return 0x9320 for a read of the ID register - if you're getting
zero then there's something more fundamental wrong than just some
initialization incantations.

DAVE
Andy Pyles
2013-01-11 14:41:37 UTC
Permalink
Greg thanks for the info! Assuming that's all there is to it, things should
be much easier than I first thought.

Dave,

Assuming there is no wiring problem, are you saying that you can read the
ID register from both chipsets the same way?
Correct me if I'm wrong, but on the SSD1298, it looks like in order to read
the (R00h) register appears to require a different setting than reading the
(R00h) register on the
ILI8320.

reference:
(page 54)
http://www.techtoys.com.hk/Displays/TY240240320/ILI9320.pdf

Andy
Post by Gregory N
**
Hi, Andy,
Post by Andy Pyles
Thanks Dave for the info. I'm now thinking that the HY32D has a different
http://www.haoyuelectronics.com/Attachment/HY32D/HY32D%20LCD%20module%20schematic.pdf
Post by Andy Pyles
Looks like an ILI9320 from that link. Weird thing is on the original
schematic (dated the same day) that I was sent did not include that
tidbit.
There is support for the ILI9320 for the STM3240G-EVAL, the STM3220G-EVAL,
and the Shenzhou boards. Those configurations are at
configs/stm3220g-eval,
configs/stm3240g-eval, and
configs/shenzhou
configs/stm3220g-eval/src/up_lcd,
configs/stm3240g-eval/src/up_lcd.c, and
configs/shenzhou/src/up_ili93xx.c
It should not be difficult to leverage those drivers to the HyMini.
Greg
I'd still be suspicious of the connection to the LCD though - The
IL9320 should return 0x9320 for a read of the ID register - if you're
getting zero then there's something more fundamental wrong than just some
initialization incantations.
DAVE
Dave Marples
2013-01-11 22:57:50 UTC
Permalink
Post by Andy Pyles
Greg thanks for the info! Assuming that's all there is to it, things
should be much easier than I first thought.
Dave,
Assuming there is no wiring problem, are you saying that you can read
the ID register from both chipsets the same way?
Correct me if I'm wrong, but on the SSD1298, it looks like in order to
read the (R00h) register appears to require a different setting than
reading the (R00h) register on the
ILI8320.
(page 54)
http://www.techtoys.com.hk/Displays/TY240240320/ILI9320.pdf
Andy
Andy,

On almost all the LCDs I've used there's a mechanism for recovering an
ID from register zero. The means of accessing the registers does vary
(e.g. pulling a pin or, in the case of SPI, setting a bit on the initial
word) but you've generally got to be able to get at the registers in
order to configure the thing anyway...although you really only need
write access usually.

Assuming I'm using a design with read access to the LCD my 'standard
procedure' for bringing up a new LCD is firstly to be able to read that
ID (or, specifically, a non-zero value, 'cos sometimes they lie about
the ID)...until you've got that much working, you're pretty much
shooting in the dark to do the rest. Just gone through this with a 9320
over SPI on a CNC controller board I'm playing with for a hobby-project.

DAVE
llatil
2013-01-11 23:48:30 UTC
Permalink
Hi,

Regarding your specific cpu board / LCD board, I do not think that they are actually the same as the ones I used. Indeed, my kit was based on a SSD1289 LCD controler and not an ILI9320.
There are dozen of different chinese STM32 boards, similar but not exactly the same. (particularly on Ebay...)

Let's try to help anyway...

You said your board is a hy-mini STM32, but it can be slightly different from the board I used for the port (yet named the same). And the LCD controler *is* different anyway, even if (according to my quick glance at the datasheet PDF) the ILI9320 looks very similar to the SSD1289. At least a lot of registers seem exactly the same.

Furthermore, as already written by Gregory, driver sources for the ILI9320 are already available for other STM32 boards.

You need to know however how the LCD controller is wired to the CPU, and the schematic document you provided is not helpful here.
(Don't you have another, more detailed schematic ? Including the actual connection with the CPU ? yes, I know that finding the 'right' schematic for these boards can be challenging as the documentation provided by those EBay vendor is generally poor, or even totally inaccurate)

The LCD ctrl should probably be connected as a 16 bit data bus interface to the CPU, through the FSMC. The STM32F103VCT (is it the model on your board ?) provides only one bank useable for NOR/PSRAM type (as a 100 pin CPU). So if the CPU on your board is actually a F103VCT, the chip select for the LCD ctrl is on pin PD7 / NE1.

You need to know also the CPU pin used to control the RS line of the ILI9320. On my board it was connected to FSMC address bit 16, but it can be connected to another address line (A17 to A23 I think).

As already written in this thread, you know you have the 'right' pin configuration when you can read the LCD chip ID on the register 00 (9320h for the ILI9320).

You can re-use the driver source from the 'STM3240G-EVAL' board (for example), but be aware that you will need to change the STM3240G_LCDBASE value (set it probably to 0x60000000 as it is the base address of the FSMC bank 1), and you will need to change the logic of the RS line, as it is configured as the FSMC A0 line on the STM3240G-EVAL board.

Once again, you really need the *actual* schematic diagram for your board here (better than playing dice with pin config...).


Hope these infos may help you... (or not ?)

- Laurent -
Post by Andy Pyles
Greg thanks for the info! Assuming that's all there is to it, things should
be much easier than I first thought.
Dave,
Assuming there is no wiring problem, are you saying that you can read the
ID register from both chipsets the same way?
Correct me if I'm wrong, but on the SSD1298, it looks like in order to read
the (R00h) register appears to require a different setting than reading the
(R00h) register on the
ILI8320.
(page 54)
http://www.techtoys.com.hk/Displays/TY240240320/ILI9320.pdf
Andy
Post by Gregory N
**
Hi, Andy,
Post by Andy Pyles
Thanks Dave for the info. I'm now thinking that the HY32D has a different
http://www.haoyuelectronics.com/Attachment/HY32D/HY32D%20LCD%20module%20schematic.pdf
Post by Andy Pyles
Looks like an ILI9320 from that link. Weird thing is on the original
schematic (dated the same day) that I was sent did not include that
tidbit.
There is support for the ILI9320 for the STM3240G-EVAL, the STM3220G-EVAL,
and the Shenzhou boards. Those configurations are at
configs/stm3220g-eval,
configs/stm3240g-eval, and
configs/shenzhou
configs/stm3220g-eval/src/up_lcd,
configs/stm3240g-eval/src/up_lcd.c, and
configs/shenzhou/src/up_ili93xx.c
It should not be difficult to leverage those drivers to the HyMini.
Greg
I'd still be suspicious of the connection to the LCD though - The
IL9320 should return 0x9320 for a read of the ID register - if you're
getting zero then there's something more fundamental wrong than just some
initialization incantations.
DAVE
Andy Pyles
2013-01-12 00:42:53 UTC
Permalink
Laurent thanks for your help. I'm still reading over your email to respond
in more detail. In the meantime I do have the detailed schematic. Which is
here: (at least that was what I was given anyway)

http://www.haoyuelectronics.com/Attachment/HY-MiniSTM32V/HY-MiniSTM32V_SCH.pdf
**
Hi,
Regarding your specific cpu board / LCD board, I do not think that they
are actually the same as the ones I used. Indeed, my kit was based on a
SSD1289 LCD controler and not an ILI9320.
There are dozen of different chinese STM32 boards, similar but not exactly
the same. (particularly on Ebay...)
Let's try to help anyway...
You said your board is a hy-mini STM32, but it can be slightly different
from the board I used for the port (yet named the same). And the LCD
controler *is* different anyway, even if (according to my quick glance at
the datasheet PDF) the ILI9320 looks very similar to the SSD1289. At least
a lot of registers seem exactly the same.
Furthermore, as already written by Gregory, driver sources for the ILI9320
are already available for other STM32 boards.
You need to know however how the LCD controller is wired to the CPU, and
the schematic document you provided is not helpful here.
(Don't you have another, more detailed schematic ? Including the actual
connection with the CPU ? yes, I know that finding the 'right' schematic
for these boards can be challenging as the documentation provided by those
EBay vendor is generally poor, or even totally inaccurate)
The LCD ctrl should probably be connected as a 16 bit data bus interface
to the CPU, through the FSMC. The STM32F103VCT (is it the model on your
board ?) provides only one bank useable for NOR/PSRAM type (as a 100 pin
CPU). So if the CPU on your board is actually a F103VCT, the chip select
for the LCD ctrl is on pin PD7 / NE1.
You need to know also the CPU pin used to control the RS line of the
ILI9320. On my board it was connected to FSMC address bit 16, but it can be
connected to another address line (A17 to A23 I think).
As already written in this thread, you know you have the 'right' pin
configuration when you can read the LCD chip ID on the register 00 (9320h
for the ILI9320).
You can re-use the driver source from the 'STM3240G-EVAL' board (for
example), but be aware that you will need to change the STM3240G_LCDBASE
value (set it probably to 0x60000000 as it is the base address of the FSMC
bank 1), and you will need to change the logic of the RS line, as it is
configured as the FSMC A0 line on the STM3240G-EVAL board.
Once again, you really need the *actual* schematic diagram for your board
here (better than playing dice with pin config...).
Hope these infos may help you... (or not ?)
- Laurent -
Post by Andy Pyles
Greg thanks for the info! Assuming that's all there is to it, things
should
Post by Andy Pyles
be much easier than I first thought.
Dave,
Assuming there is no wiring problem, are you saying that you can read the
ID register from both chipsets the same way?
Correct me if I'm wrong, but on the SSD1298, it looks like in order to
read
Post by Andy Pyles
the (R00h) register appears to require a different setting than reading
the
Post by Andy Pyles
(R00h) register on the
ILI8320.
(page 54)
http://www.techtoys.com.hk/Displays/TY240240320/ILI9320.pdf
Andy
Post by Gregory N
**
Hi, Andy,
Post by Andy Pyles
Thanks Dave for the info. I'm now thinking that the HY32D has a
different
http://www.haoyuelectronics.com/Attachment/HY32D/HY32D%20LCD%20module%20schematic.pdf
Post by Andy Pyles
Post by Gregory N
Post by Andy Pyles
Looks like an ILI9320 from that link. Weird thing is on the original
schematic (dated the same day) that I was sent did not include that
tidbit.
There is support for the ILI9320 for the STM3240G-EVAL, the
STM3220G-EVAL,
Post by Andy Pyles
Post by Gregory N
and the Shenzhou boards. Those configurations are at
configs/stm3220g-eval,
configs/stm3240g-eval, and
configs/shenzhou
configs/stm3220g-eval/src/up_lcd,
configs/stm3240g-eval/src/up_lcd.c, and
configs/shenzhou/src/up_ili93xx.c
It should not be difficult to leverage those drivers to the HyMini.
Greg
I'd still be suspicious of the connection to the LCD though - The
IL9320 should return 0x9320 for a read of the ID register - if you're
getting zero then there's something more fundamental wrong than just
some
Post by Andy Pyles
Post by Gregory N
initialization incantations.
DAVE
llatil
2013-01-12 10:32:21 UTC
Permalink
Andy,

The schematic of your board is the same as mine.

So, I do not understand why the communication with the ILI9320 fails. Device identification for the SSD1289 and the ILI9320 are identical, so the code in the 'hymini-stm32v' config should be able to (at least) identify the LCD (reading an actual value for the register 00h).

May be you can test if the backlight is operating (keep only call to 'lcd_backlight()' in the driver init 'up_lcdinitialize()'.


I will try to take time today to test the current version of Nuttx on my board (as the board is running Nuttx code dating back to more than a year).

- Laurent -
Post by Andy Pyles
Laurent thanks for your help. I'm still reading over your email to respond
in more detail. In the meantime I do have the detailed schematic. Which is
here: (at least that was what I was given anyway)
http://www.haoyuelectronics.com/Attachment/HY-MiniSTM32V/HY-MiniSTM32V_SCH.pdf
**
Hi,
Regarding your specific cpu board / LCD board, I do not think that they
are actually the same as the ones I used. Indeed, my kit was based on a
SSD1289 LCD controler and not an ILI9320.
There are dozen of different chinese STM32 boards, similar but not exactly
the same. (particularly on Ebay...)
Let's try to help anyway...
You said your board is a hy-mini STM32, but it can be slightly different
from the board I used for the port (yet named the same). And the LCD
controler *is* different anyway, even if (according to my quick glance at
the datasheet PDF) the ILI9320 looks very similar to the SSD1289. At least
a lot of registers seem exactly the same.
Furthermore, as already written by Gregory, driver sources for the ILI9320
are already available for other STM32 boards.
You need to know however how the LCD controller is wired to the CPU, and
the schematic document you provided is not helpful here.
(Don't you have another, more detailed schematic ? Including the actual
connection with the CPU ? yes, I know that finding the 'right' schematic
for these boards can be challenging as the documentation provided by those
EBay vendor is generally poor, or even totally inaccurate)
The LCD ctrl should probably be connected as a 16 bit data bus interface
to the CPU, through the FSMC. The STM32F103VCT (is it the model on your
board ?) provides only one bank useable for NOR/PSRAM type (as a 100 pin
CPU). So if the CPU on your board is actually a F103VCT, the chip select
for the LCD ctrl is on pin PD7 / NE1.
You need to know also the CPU pin used to control the RS line of the
ILI9320. On my board it was connected to FSMC address bit 16, but it can be
connected to another address line (A17 to A23 I think).
As already written in this thread, you know you have the 'right' pin
configuration when you can read the LCD chip ID on the register 00 (9320h
for the ILI9320).
You can re-use the driver source from the 'STM3240G-EVAL' board (for
example), but be aware that you will need to change the STM3240G_LCDBASE
value (set it probably to 0x60000000 as it is the base address of the FSMC
bank 1), and you will need to change the logic of the RS line, as it is
configured as the FSMC A0 line on the STM3240G-EVAL board.
Once again, you really need the *actual* schematic diagram for your board
here (better than playing dice with pin config...).
Hope these infos may help you... (or not ?)
- Laurent -
Post by Andy Pyles
Greg thanks for the info! Assuming that's all there is to it, things
should
Post by Andy Pyles
be much easier than I first thought.
Dave,
Assuming there is no wiring problem, are you saying that you can read the
ID register from both chipsets the same way?
Correct me if I'm wrong, but on the SSD1298, it looks like in order to
read
Post by Andy Pyles
the (R00h) register appears to require a different setting than reading
the
Post by Andy Pyles
(R00h) register on the
ILI8320.
(page 54)
http://www.techtoys.com.hk/Displays/TY240240320/ILI9320.pdf
Andy
Post by Gregory N
**
Hi, Andy,
Post by Andy Pyles
Thanks Dave for the info. I'm now thinking that the HY32D has a
different
http://www.haoyuelectronics.com/Attachment/HY32D/HY32D%20LCD%20module%20schematic.pdf
Post by Andy Pyles
Post by Gregory N
Post by Andy Pyles
Looks like an ILI9320 from that link. Weird thing is on the original
schematic (dated the same day) that I was sent did not include that
tidbit.
There is support for the ILI9320 for the STM3240G-EVAL, the
STM3220G-EVAL,
Post by Andy Pyles
Post by Gregory N
and the Shenzhou boards. Those configurations are at
configs/stm3220g-eval,
configs/stm3240g-eval, and
configs/shenzhou
configs/stm3220g-eval/src/up_lcd,
configs/stm3240g-eval/src/up_lcd.c, and
configs/shenzhou/src/up_ili93xx.c
It should not be difficult to leverage those drivers to the HyMini.
Greg
I'd still be suspicious of the connection to the LCD though - The
IL9320 should return 0x9320 for a read of the ID register - if you're
getting zero then there's something more fundamental wrong than just
some
Post by Andy Pyles
Post by Gregory N
initialization incantations.
DAVE
Gregory N
2013-01-12 14:33:48 UTC
Permalink
So, I do not understand why the communication with the ILI9320 fails. ....
Can you get any sample code from http://www.haoyuelectronics.com? Almost all boards have some code that shows how to program the on-board devices.

Are there jumpers that need to be set to enable the LCD?

Looking at the different ILI930 implementations in the source tree. I see differences. I don't recall why there are differences but, for example, the Shenzhou driver enables the internal oscillators in LDC drivers, delays, then reads the ID.

The Shenzhou LCD also has a power pin. So you have to configure a GPIO output and enabled power to the LCD first.

Perhaps the pin connections are not the same with the ILI6320 LCD.

If you don't have any sample code, how do you know that the ILI9320 is functional to begin with?

Greg
Andy Pyles
2013-01-12 22:04:37 UTC
Permalink
Hi Greg and Laurent,

First off, thanks for all the help here in help me make progress on this.
Greg to answer your question, when I first purchased the device there was
a demo program running that clearly showed the screen working. So I know
it does work. After bugging the seller I was able to finally get some
sample code for the device. Here is a link to it:

https://github.com/apyles/hy-ministm32v-glcd

Believe it or not, it does work and the screen turns on. I would be curious
to see what it takes to port this to nuttx. Incidentally, the ID that I'm
reading back is 0x0046. Which according to the source indicates a HX8346A.

Andy
**
Post by llatil
So, I do not understand why the communication with the ILI9320 fails.
....
Can you get any sample code from http://www.haoyuelectronics.com? Almost
all boards have some code that shows how to program the on-board devices.
Are there jumpers that need to be set to enable the LCD?
Looking at the different ILI930 implementations in the source tree. I see
differences. I don't recall why there are differences but, for example, the
Shenzhou driver enables the internal oscillators in LDC drivers, delays,
then reads the ID.
The Shenzhou LCD also has a power pin. So you have to configure a GPIO
output and enabled power to the LCD first.
Perhaps the pin connections are not the same with the ILI6320 LCD.
If you don't have any sample code, how do you know that the ILI9320 is
functional to begin with?
Greg
Gregory N
2013-01-12 23:06:54 UTC
Permalink
Post by Andy Pyles
First off, thanks for all the help here in help me make progress on this.
Greg to answer your question, when I first purchased the device there was
a demo program running that clearly showed the screen working. So I know
it does work. After bugging the seller I was able to finally get some
https://github.com/apyles/hy-ministm32v-glcd
Believe it or not, it does work and the screen turns on. I would be curious
to see what it takes to port this to nuttx. Incidentally, the ID that I'm
reading back is 0x0046. Which according to the source indicates a HX8346A.
Should be super simple:

1) Copy the configs/shenzhou/src/up_ili93xx.c driver to hymini-stm32/src.
2) Modify the hymini-stm32/src Makefile so that builds the driver if the LCD is enabled.
3) Locate the initialization function in the driver provided code.
4) Copy that into the up_ili93xx.c initialization function, adjusting the code as necessary.
5) Verify that all of the GPIO pins and FSMC pins are being configured correctly.

That should be it.

Greg
llatil
2013-01-13 10:21:06 UTC
Permalink
Andy,
Incidentally, the ID that I'm reading back is 0x0046. Which
according to the source indicates a HX8346A.
So, the LCD ctrl is actually a Hymax HX8346A (and not a ILI9320...)
Hence, the driver code for the ILI9320 will not work for your board.

I did not find already available code for the HX8346A in the Nuttx source code, so I'm afraid you will need to create a new driver.

But this is very doable, as you already have driver code for SSD1289 and ILI9320 that you can use as a base, you have the vendor provided source (that is working, as you tested it).

So, I think you can start copying the code for the ILI9320 (as described by Greg in his post), rename files to HX8346A :-)
and adapt the code for the HX8346A (using the vendor code as reference, and the controller datasheet).

As you saw in the vendor provided code, those LCD controllers are very similar (as the code handle all of them). The register access is the same, the functionalities seem the same as well, but each function is attached to a different register depending on the controller

For example the 'set cursor position' function for SSD1289, ILI9320 and HX8346A is using different couple of registers, but code is basically the same.

Note: it could be great to create a 'unified' driver code in Nuttx for all these LCD ctrl (as done in the vendor provided code).
This would avoid to (re)create as many drivers for these chips (there is currently code for ILI9320 in some boards, code for SSD1289 in the hy-mini32, and soon... driver code for the HX8346A).

A unified driver could probably help here, and avoid 're-inventing the wheel'.
Of course, such driver could be difficult to test / maintain if you do not own all of these LCD controllers.

May be Greg can have an opinion on such driver ?

- Laurent -
Andy Pyles
2013-01-14 02:06:23 UTC
Permalink
Hi Laurent,

Thanks for the detailed information. It certainly looks doable. I finally
figured out why I kept getting 0x00 for the device id. From the driver code:

else /* special ID */
{
DeviceCode = LCD_ReadReg(0x67);

if( DeviceCode == 0x0046 )
{
LCD_Code = HX8346A;
...

So for some reason, this device stores the ID at register at 0x67 instead
of 0x00. Go figure..
**
Andy,
Incidentally, the ID that I'm reading back is 0x0046. Which
according to the source indicates a HX8346A.
So, the LCD ctrl is actually a Hymax HX8346A (and not a ILI9320...)
Hence, the driver code for the ILI9320 will not work for your board.
I did not find already available code for the HX8346A in the Nuttx source
code, so I'm afraid you will need to create a new driver.
But this is very doable, as you already have driver code for SSD1289 and
ILI9320 that you can use as a base, you have the vendor provided source
(that is working, as you tested it).
So, I think you can start copying the code for the ILI9320 (as described
by Greg in his post), rename files to HX8346A :-)
and adapt the code for the HX8346A (using the vendor code as reference,
and the controller datasheet).
As you saw in the vendor provided code, those LCD controllers are very
similar (as the code handle all of them). The register access is the same,
the functionalities seem the same as well, but each function is attached to
a different register depending on the controller
For example the 'set cursor position' function for SSD1289, ILI9320 and
HX8346A is using different couple of registers, but code is basically the
same.
Note: it could be great to create a 'unified' driver code in Nuttx for all
these LCD ctrl (as done in the vendor provided code).
This would avoid to (re)create as many drivers for these chips (there is
currently code for ILI9320 in some boards, code for SSD1289 in the
hy-mini32, and soon... driver code for the HX8346A).
A unified driver could probably help here, and avoid 're-inventing the wheel'.
Of course, such driver could be difficult to test / maintain if you do not
own all of these LCD controllers.
May be Greg can have an opinion on such driver ?
- Laurent -
Loading...