This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Large JLX12864G not working
#1
Question 
Dear All,

I would like to request comments and guidance regarding the implementation of a JLX12864G-542-PC on tinypilot (image tinypilot_2024_07_17.img.xz) running on PiZero.

The JLX12864G-542-PC is a large screen (73mmx40mm) based on ST7565R that can be driven with SPI. Large size helps for cockpit viewing and LCD helps keeping overall consumption  low. The attached picture shows the back of the module ; the documentation (unfortunately in Chinese) is also attached.

After testing the setup with a Nokia5110, I switched to the JLX12864G-542-PC (modification of ./pypilot.hat.conf) but ran into the following issue:
  - Blank splash screen
  - The screen briefly appears for approximately one second at the end of boot process
  - Blank IHM screen

Complementary observations:
  - Connecting through ssh, the hat log gives:
Code:
024-02-11_11:00:23.25097 hat start 17.602637
2024-02-11_11:00:23.25139 have gpio for raspberry pi
2024-02-11_11:00:23.25141 hat import done 22.51625
2024-02-11_11:00:23.25143 loading config file: /home/tc/.pypilot/hat.conf
2024-02-11_11:00:23.25144 write config .bak
2024-02-11_11:00:23.25146 host 192.168.14.1 22.551825
2024-02-11_11:00:23.25147 failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
2024-02-11_11:00:23.25149 FILE hat_1.2.hex
2024-02-11_11:00:23.25150 firmware up to date
  - Shutting down hat service (sudo sv stop pypilot_hat), the screen appears (look like a zoom on some of the normal screen)
  - Restarting the hat service (sudo sv start pypilot_hat), the screen becomes blank

For reference, here follows the hat log with a nokia5110:
Code:
2024-02-11_11:00:23.12619 hat start 17.583348
2024-02-11_11:00:23.12653 have gpio for raspberry pi
2024-02-11_11:00:23.12656 hat import done 22.417756
2024-02-11_11:00:23.12657 loading config file: /home/tc/.pypilot/hat.conf
2024-02-11_11:00:23.12659 write config .bak
2024-02-11_11:00:23.12660 host 192.168.14.1 22.466891
2024-02-11_11:00:23.12662 failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
2024-02-11_11:00:23.12664 FILE hat_1.2.hex
2024-02-11_11:00:23.12665 firmware up to date

I would be very grateful if someone could provide comments and/or guidance on how to tackle the problem.

Best regards,

Damien


Attached Files Image(s)
   

.pdf   JLX12864G-542-PC.pdf (Size: 988.25 KB / Downloads: 350)
Reply
#2
Does the screen work at all? You said "look like a zoom on some of the normal screen" I am not sure what that means.

If you stop all the services, and run the splash program

/opt/splash jlx12864

Does anything appear?

Can you try the standard size jlx12864 to see if that works? Does the nokia work with editing the config? Can you translate the datasheet and compare it to the datasheet of the regular jlx12864? Maybe there is a slight difference needed

I was going to try also with a 256x160 display similarly larger but am unable to make progress at this time.
Reply
#3
Hello Sean,

Sorry for the long time replying ; I was away for a few days.

The result of the command /opt/splash jlx12864 after stopping all services is attached below ; the splash screen appears shifted and somewhat zoomed.
   

The connections with the PI are according to the following table (grey pins are unused):
   

According to the JLX12864G-542-PC documentation attached in the original post : LCD driver IC instruction table, please refer to the Chinese manual of "JLX12864G-542-PN". Unfortunately, I have not found this documentation ; however, there is a small code example provided disclosing the following commands :
Code:
// *******************************************************************************
// Commands for JLX12864G-542-PC (ST7565R)
// 0xe2: /*Soft reset*/
// 0x2c: /*Boost step 1*/
// 0x2e: /*Boost step 2*/
// 0x2f: /*Boost step 3*/           
// 0x24: /*Coarse contrast adjustment, adjustable range 0x20~0x27*/
// 0x81: /*Fine-tune contrast*/
// 0x2a: /*0x1a, fine-tune contrast value, setting range 0x00~0x3f*/
// 0xa2: /*1/9 bias ratio (bias)*/
// 0xc8: /*Row scan order: from top to bottom*/
// 0xa0: /*Column scan order: from left to right*/
// 0x60: /*Start line: Start from the first line*/
// 0xaf: /*Turn on display*
// *******************************************************************************
Comparing to the class class JLX12864G from the driver code in pypilot/hat/ugfx/ugfx.cpp, minor differences appears:
Code:
        unsigned char cmd[] = {
            0xe2, // Soft Reset (*** JLX12864G-542-PC: OK ***)
            0xc2, // Line scan sequence : from top to bottom (*** JLX12864G-542-PC: not found in the doc ***)
//            0x2c, // Boost 1 (*** JLX12864G-542-PC: OK ***)
            0x2e, // Boost 2 (*** JLX12864G-542-PC: OK ***)
            0x2f, // Boost 3 (*** JLX12864G-542-PC: OK ***)
            0xa2, // 1/9 bias ratio (*** JLX12864G-542-PC: OK ***)
           
            0x23, // Coarse Contrast, setting range is from 20 to 27 (*** JLX12864G-542-PC: NOK ; expected is 0x24 ***)
            0x81, // Trim Contrast (*** JLX12864G-542-PC: OK ***)
            (uint8_t)contrast, // Trim Contrast value range can be set from 0 to 63                             
            0xa0, // column scan order : from left to right (*** JLX12864G-542-PC: OK ***)
            0xa6, // not reverse (*** JLX12864G-542-PC: not found in the doc ***)
            0xa4, // not all on (*** JLX12864G-542-PC: not found in the doc ***)
            0x40, // start of first line (*** JLX12864G-542-PC: not found in the doc ***)
            //0xb0,
            //0x10,
            0xaf // Open the display (*** JLX12864G-542-PC: OK ***)
        };
I'll continue looking for the JLX12864G-542-PN manual ; the alternative is to consult the ST7565 datasheet.

Regarding the standard JLX12864, I am not sure about the controller used there ; in the case of the JLX12864G-542-PC, the controller is a ST7565R. Could you indicate which controller is used on the standard JLX12864 you are using with the pypilot hat you have designed ?

For reference, I have checked the U8g2 library and found list of controllers used with JLX12864 (https://github.com/olikraus/u8g2/wiki/u8g2setupcpp). The ST7565R is indeed used for JLX12864 but also the UC1604, ST7567 and ST7588. The u8g2 code for the ST7565 can be found here : https://github.com/olikraus/u8g2/blob/ma...d_st7565.c ; if you can confirm which controller is used normally, I should be able to check the differences in term of commands but also mapping.

A last question : 256x160 ; is it for pypilot or is it for the MFD ?

Thanks again for your time,

Best regards,

Damien
Reply
#4
It looks like it is just out of order. Checkout ugfx.cpp line 831

You should be able to modify it. For example (7-col) should be instead ((11-col)&7) or someting like that
if(*(uint8_t*)(s->p + (127-y)*s->line_length + (7-col)*8+bit))

No idea without trying to verify. Then type "make" in that directory and try "./splash jlx12864" see what happens.

Anyway the 256x160 was for both pypilot and the MFD.. the idea was to have a larger screen and might as well have better resolution.


Alternately there might be some registers in the cmd[] list that you could tweak to get the same effect.
Reply
#5
Hello Sean,

I was reading the ST7565 datasheet to clarify line/column addressing when I noticed your reply.

Thanks for the suggestion on changing ugfx.cpp line 831 :
if(*(uint8_t*)(s->p + (127-y)*s->line_length + (7-col)*8+bit))
by ;
if(*(uint8_t*)(s->p + (127-y)*s->line_length + ((11-col)&7)*8+bit))

It indeed works ; the wiring between the ST7565 and the LCD has changed compared to the original JLX12864.

I'll pursue with tests and will report.

Thanks again,

Best regards,

Damien.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)