How to connect a 12864 screen to an BTT Octopus v1.1 F429 Version

Overview

The information here is aimed at connecting a Fysetc Mini v1.2 12864 display but it can also be applied to other 12864 displays (as long as they are ST7567 or ST7920 based).

Wiring

Connect EXP1 to EXP1 and EXP2 to EXP2.

Board.txt modifications

Add the following lines to the board.txt file

//Fysetc MINI 12864
lcd.encoderPinA=BTN_EN1
lcd.encoderPinB=BTN_EN2
lcd.encoderPinSw=BTN_ENC
lcd.lcdCSPin=LCD_EN
lcd.lcdDCPin=LCD_RS
lcd.spiChannel=0
//lcd.lcdBeepPin=NoPin
heat.spiTempSensorCSPins = {F.8, NoPin, NoPin, NoPin, NoPin, NoPin, NoPin, NoPin}

Config.g

Add this line to config.g

M950 P1 C"LCD_D4"
M42 P1 S0
G4 P500
M42 P1 S1
M918 P2 C30 F100000 E4

Overview

The information here is aimed at connecting a RepRap 12864 display but it can also be applied to other 12864 displays (as long as they are ST7567 or ST7920 based).

Board.txt modifications

Add the following lines to the board.txt file

lcd.encoderPinA=BTN_EN2
lcd.encoderPinB=BTN_EN1
lcd.encoderPinSw=BTN_ENC
lcd.lcdCSPin=LCD_RS
lcd.spiChannel=0
heat.spiTempSensorCSPins = {F.8, NoPin, NoPin, NoPin, NoPin, NoPin, NoPin, NoPin}

Config.g changes

Add the following line to the end of your config.g

M918 P1 E4 F100000

Overview

The information here is aimed at connecting a Fysetc Mini v2.1 12864 display but it can also be applied to other 12864 displays (as long as they are ST7567 or ST7920 based).

Wiring

Connect EXP1 to EXP1 and EXP2 to EXP2.

Board.txt modifications

Add the following lines to the board.txt file

//Fysetc MINI 12864
lcd.encoderPinA=BTN_EN1
lcd.encoderPinB=BTN_EN2
lcd.encoderPinSw=BTN_ENC
lcd.lcdCSPin=LCD_EN
lcd.lcdDCPin=LCD_RS
lcd.spiChannel=0
//lcd.lcdBeepPin=NoPin
heat.spiTempSensorCSPins = {F.8, NoPin, NoPin, NoPin, NoPin, NoPin, NoPin, NoPin}
led.neopixelPin=LCD_D5

Config.g

Add the following line to the end of your config.g

M98 P"screen.g"

Add a file in your sys folder called screen.g and add the following contents

; ST7567 Init for FYSETC Mini12864 Panel V2.1

; Turn off backlight
m150 X2 R0 U0 B0 S3 F0
; Configure reset pin
M950 P1 C"LCD_D4" 
; hardware reset of LCD
M42 P1 S0
G4 P500
M42 P1 S1
; Turn display on
M918 P2 C30 F1000000 E4
; Fade in backlight
while iterations < 256
    m150 X2 R255 U255 B255 P{iterations} S1 F0
    G4 P20
; flash Button 3 times
while iterations < 3
    m150 X2 R255 U255 B255 P255 S1 F1
    m150 X2 R0 U255 B0 P255 S2 F0
    G4 P250
    m150 X2 R255 U255 B255 P255 S1 F1
    m150 X2 R0 U255 B0 P0 S2 F0
    G4 P250
; Display "ready" button state  
m150 X2 R255 U255 B255 P255 S1 F1
m150 X2 R255 U0 B0 P255 S2 F0

Menu files must be uploaded to allow the display to generate the correct information. This can be done in two ways. First, obtain the recommended menu files from here

Method 1 - WiFi Mode only

Extract the contents of the zip file you downloaded above and place them in a folder called “Menu” on the SD card of the GTR.

Method 2

Activate the display using the config.g changes above.
A side menu called “Display” should appear in DWC. Navigate to it and upload the zip file.

Troubleshooting

If the screen is showing artifacts/random characters on the screen, the following may improve/eliminate the issue

  • Lower the SPI frequency by half. This is the F value in M918.
  • Reduce the length of the cable between the screen and the board.
  • Ensure that the cable between the screen and the board is routed away from other cables, especially motor cables.
  • Add a ferrite ring to the cable between the screen and the board.

Using the SD card slot on the screen

It is possible to use the external SD card.
To do so, add the following lines to your board.txt

sdCard.external.spiChannel=0
sdCard.external.csPin=LCD_SS
sdCard.external.cardDetectPin=LCD_CD
Tags: