Customizable lcd display menus

Basic Information:

Printer Model: Home Made
MCU / Printerboard: CB1 + MANTA 5M

Hi, I made my own menu for mini12864 LCD diplay.

[menu __main __user __auto_power_off]
type: list
enable: { 'gcode_macro POWER_DETECT_OFF' in printer }
name: Power supply

This menu works on the printer where Raspberry and Klipper are used.
It does not work on a printer with the CB1 module from BTT.

Does anyone know why?
And how do I set it up to make it work?

Sorry, but this always gives me shivers… :wink:

What does “working” mean? Are you sure that the macro correctly works on your second installation?

Yes, the macro works correctly, but the menu does not appear on the display.

On a second printer with a Raspberry and the same version of Klipper it’s fine.

Well, you see, I prefer them to Touch and Klipperscreen.
I can adapt it as I want and not as someone else did it.

I actually meant LCD display as for Liquid Crystal Display display

1 Like

I still can’t figure out why it works on the Raspberry and not on the CB1.

Klipper should be independent of Host MCU right?

Not in terms of a LCD menu

Post your klippy.log pls

Hi, Here are both logs from both the Raspberry and the CB1.

klippy (CB1).log (132.0 KB)

klippy (Raspberry).log (587.8 KB)

I have not spotted anything obvious in the logs. Sorry, no idea currently.

OK, maybe someone will figure out why this is happening.

As for the logs, you have different LCDs.

Is the one with the CB1 conrtolled by SPI or the first one (CS/A0/RST) ?

configuration

CB1

[display]
display_group: _klipper_logo
lcd_type: uc1701
cs_pin: EXP1_3
a0_pin: EXP1_4
rst_pin:  EXP1_5
contrast: 63

encoder_pins: ^EXP2_5, ^EXP2_3  
click_pin: ^!EXP1_2

spi_software_miso_pin:  EXP2_1
spi_software_mosi_pin:  EXP2_6
spi_software_sclk_pin:  EXP2_2

Raspberry

[display]
lcd_type: st7920
display_group: _klipper_logo
cs_pin: ar19             	#EXP1_4
sclk_pin: ar18        		#EXP1_5
sid_pin: ar42         		#EXP1_3
encoder_pins: ^ar11, ^ar12   	#EXP2_3, EXP2_5
click_pin: ^!ar43     		#EXP1_2
#kill_pin: ^!ar46     		#EXP2_8

As for this:

https://www.klipper3d.org/Config_Reference.html#uc1701-display

just cs and a0 (and maybe rst) are used. Why have you setup the spi ports?

if i disable SPI then nothing is shown on mini12864 display

#spi_software_miso_pin:  EXP2_1
#spi_software_mosi_pin:  EXP2_6
#spi_software_sclk_pin:  EXP2_2

Cause UC1701 controller is using strictly SPI bus.

You might have a look here GitHub - bitbank2/uc1701: A C library (Linux + Arduino) to control the UC1701/ST7565/ST7920 128x64 monochrome LCD and here Modify UC1701 LCD to use I2C instead of SPI - #7 by bitbank - Displays - Arduino Forum.

The Klipper doc you mention above is (in my eyes) a little confusing.

These are special functions for the UC1701 chip. Especially “contrast” settings.

Though, one thing should be noticed from the doc.

#rst_pin:
#   The pin connected to the "rst" pin on the lcd. If it is not
#   specified then the hardware must have a pull-up on the
#   corresponding lcd line.

Maybe @DrumClock did it with the RPi and not with the CB1 in his configs.

Raspberry has a display: st7920
CB1 has a display: uc1701

However, if Klipeer’s code is dependent on a certain display chip, then something is wrong with Klipeer, don’t you think?

Just wanted to mention the same: The discussion seems to go into the wrong direction. It is not about a non working display but about a working display and an issue with a customized menu entry.

This should be (in theory):

  • independent of the Klipper host
  • independent of the used display (as long as it is working in general)
1 Like

Yes @Sineos , exactly as you write.

I don’t know your macro and I probably won’t understand it. I’m more a HW guy.

Why don’t you give it at least a try? It’s a different display controller (ST7920 vs UC1701) :wink:!.. …and here is nothing to loose.

CB1 config:
rst_pin: ^EXP1_5