Welcome! Log In Create A New Profile

Advanced

SKR v1.3 with the Anet 12864 LCD display (will it ever work?)

Posted by mlefevre 
SKR v1.3 with the Anet 12864 LCD display (will it ever work?)
August 02, 2019 01:12PM
I'm trying to get the SKR V1.3 up and running with Marlin 2.0 and the Anet version of the 12864 (ReprapDiscount Full Graphics Display) with no luck so far. I know that the Anet version of the 12864 is nearly identical to the ReprapDiscount Full Graphics Display with the exceptions that the pin defintions are different. I don't have a ReprapDiscount Full Graphics Display to test so I'm just working with the Anet version. I have scoured the web for hints and have tried several solutions but nothing has worked.

What works:
1) The button in the encoder (I know because the beeper beeps when I push it)
2) The beeper (I know because of 1)
3) The backlight on the LCD lights up blue

This suggests that I have at least 4 pins connected & configured properly (5v, GND, BEEPER_PIN, and BTN_ENC).

What doesn't work:
1) No images are displayed on the screen. As a result, I can't tell if any other functions work.

This suggests that I don't have serial communication with the LCD module working correctly.

I'll list what I've done so far later in this post but I want to first ask for verification of a few things:

1) The LPS1768 is a 3.3v MCU and the 12864 (using the ST7920 LCD module) is a 5v system. As a result, I should need level translators on the signals that move data to the LCD. The ST7920 datasheet shows the min value for a logic high input is 0.7 * Vdd which would be 3.5v.
2) All of the signals I need to make the 12864 work (with the exception of the reset button) are on the LCD (not J3) ribbon cable so I'm focusing on that cable only right now. The reset button is connected via the J3 ribbon cable pin 7.
3) The ST7920 is operated in serial mode and the CLK is the Marlin signal LCD_PINS_D4, the DATA is Marlin signal LCD_PINS_ENABLE, and the CS is signal LCD_PINS_RS.
4) The three signals, plus 5v and GND are all that's needed to communicate with the LCD.

I build the latest version of Marlin-bugfix-2.0.x with
#define ANET_FULL_GRAPHICS_LCD
in Configuration.h and the following added to pins_BIGTREE_SKR_C1.3.h:
  #if ENABLED(ANET_FULL_GRAPHICS_LCD)
    #undef BTN_EN1
    #undef BTN_EN2
    #undef BTN_ENC
    #undef BEEPER_PIN
    #undef LCD_PINS_D4     
    #undef LCD_PINS_ENABLE 
    #undef LCD_PINS_RS     
    #undef ST7920_DELAY_1
    #undef ST7920_DELAY_2
    #undef ST7920_DELAY_3
    #define BTN_EN1            P1_20
    #define BTN_EN2            P1_22
    #define BTN_ENC            P1_18
    #define BEEPER_PIN         P1_30
    #define LCD_PINS_D4        P0_28
    #define LCD_PINS_ENABLE    P1_21
    #define LCD_PINS_RS        P1_23
    #define ST7920_DELAY_1 DELAY_NS(0)
    #define ST7920_DELAY_2 DELAY_NS(63)
    #define ST7920_DELAY_3 DELAY_NS(125)
    #define STD_ENCODER_PULSES_PER_STEP 4
    #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
  #endif

I verified the LPC1768 port numbers from the comment in the .h file and the SKR v1.3 schematic. The fact that the encoder button works and the beeper works tell me that I'm building the code that I want to build.

I put a 'scope on the CS, CLK, and DATA lines to observe what's going on after reset and there is almost no activity. The CLK signal does go to about 2v for around 2 seconds and then back to zero. The CS signal stays high and the DATA signal stays low. I have a level converter circuit on all three lines and I'm 'scoping them on the LCD module (5v) side.

The SKR V1.3 document says that the 12864 LCD is supported and the youTube video shows them enabling it in the Marlin Configuration.h file in VSCode, but there is no other information I can find. I don't know if the 3.3v vs 5v logic is an ignored issue or not.

What I need help with is verifying the assumptions I stated above and suggestions on where to go next or what I'm doing wrong.
Re: SKR v1.3 with the Anet 12864 LCD display (will it ever work?)
August 02, 2019 01:47PM
I forgot to mention that I'm attaching the Anet 12864 via single ribbon cable to the SKR v1.3 on the EXP1 connector. Because 5v and GND are on opposite ends of the connector on EXP1 (compared to the 12864), the ribbon cable is flipped over so that pin 1 of the ribbon cable is on the pin 10 end of the EXP1 connector. In addition, to get 5v and GND in the right place, the outermost 2 wires are split out and flipped as well. I assume that this will work since I have proper power going to the 12864 and at least 2 buttons work.

What I'm not sure about is that the LPC1768 GPIOs I have configured for serial comm with the LCD module are appropriate for the job. I see from the SKR schematic that P0.28 (configured as LCD_PINS_D4 or CLK) is an open drain output. The schematic shows a 10K pullup so I don't see a problem with it.
Re: SKR v1.3 with the Anet 12864 LCD display (will it ever work?)
August 08, 2019 05:39PM
So, I finally got this working. As I stated originally, I was connecting the Anet 12864 panel to the SKR v1.3 using a single 10-pin ribbon cable from the LCD (not J3) connector on the panel to the EXP1 connector on the controller. The pin assignments dictated that, if I flip the ribbon cable over to get the power and ground at the right end of the connector, the CLK signal (named LCD_PINS_D4 in Marlin) fell on EXT1 pin 2 (diagonally opposite the GND pin) which is connected to P0.28 on the LPC1768. This GPIO is open drain and the board is configured with a 10Kohm pull-up resistor to 3.3v. It turns out that 10K is not small enough to make the clock signal go all the way to 3.3v at the frequencies used. As a result, no data was getting to the LCD module.

My options included:

1) Add an additional, offboard pull-up resistor to speed up the transitions of the clock.

2) Pick a different GPIO pin (not open-drain) to drive the CLK signal. This would make it so that I couldn't just plug the ribbon cable directly into the controller without doing more than just flipping the ribbon cable.

In the end, I decided to go with option 2 and built a small adapter that would allow me to drive LCD_PINS_D4 from P1.30 which works. This also allowed me to use the unused signal on the LCD ribbon cable (on pin 7) to connect the reset button from the panel to the SKR reset on pin 8 of EXP2. This option required a jumper on the LCD panel to route the reset signal on the J3 connector to the unused pin on the LCD cable. As a result of this, I only need a single (LCD) 10-pin ribbon cable between the panel and the SKR.

I found that during a reset, the GPIOs go high long enough to blast the piezo beeper long enough to be annoying so I just left that signal off the adapter I made.
Re: SKR v1.3 with the Anet 12864 LCD display (will it ever work?)
November 04, 2019 09:13AM
Hello,

I have the same problem as you had. I try to follow your instructions but still it doesn't work. Could you post here (maybe someone else will have same problem in the future) the final code in pins_BIGTREE_SKR_V1.3.h and the scheme of the connetcions in the adapter you've made, please.

Thanks
Re: SKR v1.3 with the Anet 12864 LCD display (will it ever work?)
November 04, 2019 03:25PM
I attached a crude diagram that I used to wire the adapter that made my LCD display work. The adapter has two connectors for EXP1 and EXP2 on the bottom and a 2x5 header on the top for the LCD Ribbon Cable. In the diagram, there is a table that shows which EXP connector pin (A, B, C...) is connected to which LCD cable header pin (1, 2, 3...). EXP1 does almost everything but I needed to get access to the board RESET signal on EXP2 so that the display reset button would work. I also pull another signal (P1.31) off of EXP2 to drive an offboard fan control circuit. It controls a fan that blows on the stepper drivers and makes use of the Marlin feature where you can enable that fan to run only when one or more stepper drivers are enabled. I only used a 2x2 connector for EXP2 since I only needed a couple of signals from it.

The attached photos show the adapter board from different angles.

I also attached the pins file from the firmware I built for the board.

I hope this helps.
Attachments:
open | download - A.jpg (474.1 KB)
open | download - C.jpg (578.5 KB)
open | download - B.jpg (586.7 KB)
open | download - D.jpg (414.2 KB)
open | download - LCD Display Ribbon Cable Adapter Diagram.pdf (505.9 KB)
open | download - pins_BIGTREE_SKR_V1.3.h (8.2 KB)
Re: SKR v1.3 with the Anet 12864 LCD display (will it ever work?)
November 05, 2019 12:10PM
Thanks a lot.
Sorry, only registered users may post in this forum.

Click here to login