|My 20x4 display and rotary encoder in a Panelolu casing|
The very best solution to make a display work with the printer would be of the Reprappro version of Marlin could support I2C displays directly. However, it does not, and all my attempts to add the necessary display-code to their version failed. Thanks to the guide at Think3dPrint3d I managed to make the display and the rotary encoder work by using the T3P3-version of Marlin instead of the Reprappro version.
I chose a simple I2C-display from dx.com (Deal Extreme). It comes with a PCA8574-compatible I2C-port expander. Luckily, the RA_CONTROL_PANEL, which is supported by the firmware, uses the same expander. All you have to do to make the dx.com display work is to define the RA_CONTROL_PANEL in Configuration.h in Marlin as such:
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
It is pretty straightforward to connect the Display to Melzi:
- GND connects to a free GND pin
- VCC connects to a free VCC pin
- SDA connects to SDA
- SCL connects to SCL
The rotary encoder I use is also from Deal Extreme. In order to make it work I had to define which pins to use in Pins.h. Look for the definitions for the Melzi-board (number 63) in the file.
//The encoder and click button
#define BTN_EN1 11
#define BTN_EN2 10
#define BTN_ENC 29
In addition i had to move the connection for the heated bed Mosfet to make the encoder work.
#define HEATER_BED_PIN 30
I think, but I am not quite sure, that the rotary encoder must use Interrupt pins 10 and 11 in order to work. I tried different configurations without moving the heated bed connection, but the above is the only configuration which made sense (and worked).
To connect the rotary encoder to Melzi:
- A connects to TX1
- B connects to RX1
- SW connects to A2
- VCC connects to VCC
- GND connects to GND