From RepRapWiki
Jump to: navigation, search

Crystal Clear action run.png

Release status: Working

Description Hook up an LCD display to RAMBo
License GPL
Author johnoly99 / os1r1s
Based-on none
Categories Electronics interface with display, Prusa_Mendel Development, Mendel Development
CAD Models
External Link

This page will help you set up the reprapdiscount.com Smart LCD controller to work on the RAMBo boards by UltiMachine. You will find here the firmware mods, arduino mods and more to get your LCD controller working. A SmartLCD Adapter exists for RAMBo which allows you to easily connect a Smart LCD controller to the RAMBo.

If you wish to connect the Smart LCD controller without the adapter, this page also contains all the instructions needed to modify the cables.




There are three simple steps to connecting a Smart LCD Controller to your RAMBo. First, you need to connect the cables, then update the Arduino IDE to recognize the extra pins used by RAMBo and finally, update your firmware to add support for the LCD controller.

If you have a RAMBo Smart LCD Adapter, then the first step will be done in a matter of seconds. However, If you do not the adapter, you can still modify the cables to connect the LCD to the RAMBo.

Step 1: Connecting the Smart LCD Controller

Using the RAMBo LCD Adapter

The RAMBo Smart LCD Adapter has three female headers on the bottom which need to be inserted into the ICSP2, EXT2 and SPI headers of the RAMBo board. The Adapter will be sitting directly on top of the Atmega chip.

The EXP1 and EXP2 connectors of the Smart LCD Controller will then connect to the male headers on top of the Adapter.


Rambolcd correct wiring.jpg

Making the cables

The following file was created by os1r1s and is a great guide to have handy while setting up your LCD controller. It's a good reference to go with the instructions below. Following these instructions using the Arduino 1.x IDE, the changes called for in pins_arduino.c must be made in pins_arduino.h, under {ArduinoRoot}/hardware/arduino/variants/mega/.

Media:Rambo-LCD.pdf Template:Clear

This step involves modifying two of the 10-pin ribbon cables supplied with the smart LCD controller. Depending on the length of cable you need, you may be able to just use one of the long cables and simply cut it in half to make the two cables needed. You will end up with two cables with the black connector on one end, and the other ends will be soldered onto the connectors. This step will be eliminated once the adapter PCB is done.

The two ribbon cables supplied with the smart LCD have one red wire on one side of the cable. That is wire 10, so anywhere you see a wire label called out, you can start at the red wire (#10) and count back, or the opposite side (#1) and that will help you in wiring the cables.

The smart LCD board has two connectors on the back. One is labeled EXP1 on the other is EXP2. EXP1 will also be called A in these instructions, and EXP2 will be called B


Make up one 2X8 or 2X10 connector and one 2X4, if you don't have any, by using female header pins and super-gluing them together. Now, using the PDF, solder the wires coming from the smart LCD to the headers. Take note of the location of the U$2 and U$7 symbols on the RAMBo SPI and EXT pics, they are oriented on the board just as they are shown in the pictures. Remember, EXP1 is A in the PDF, and EXP2 is B, and that the red wires are wire number 10. When you are done, you should have two wires left unused, A9 and A10. Also, notice that in the pics, I used a 2X8 header on the EXT connector, so the first 2 rows of pins are exposed on the board. Notice the red wires orientation on the 2X4 pin connector going to the SPI header on the RAMBo.

Rambospi.jpg Ramboext2.jpg

Rambolcd4.jpg Rambolcd5.jpg

Step 2: Updating your Arduino IDE

This step has been tested and known to work with Arduino 0022 and 0023 and Arduino 1.0.5.

The Arduino IDE does not have all the pins mapped out because the MEGA 2560 boards didn't have them broken out and accessible. UltiMachine broke these un-used pins out knowing that one of us out there would find a use for them and a way to get at them eventually. So, we need to update a file in our Arduino IDE to show it how to talk to those pins.

Arduino 0022 or 0023

All you need to do is download the following zip file, extract the file named arduino_pins.c and copy it into arduino-(yourversion)/hardware/arduino/cores/arduino

File:Update arduino pins.zip

Go ahead and overwrite/replace the existing file, or if you'd like, rename the original file first to something like arduino_pins_ORIG.c then paste this file into the folder. That's it for updating your arduino IDE.

Arduino 1.x.x

All you need to do is download the following zip file, and extract the rambo directory into arduino-(yourversion)/hardware/. You should end with a boards.txt file at arduino-(yourversion)/hardware/rambo/boards.txt.

File:Arduino 1.x.x.zip

Step 3: Modifying your firmware

For Marlin firmware

Open up your marlin.pde and go to the fastio.h tab. Go down to line 1387 and copy/paste the following lines directly below the line that reads #define DIO69_PWM NULL

#define DIO76_PIN    PINJ5
#define DIO76_RPORT  PINJ
#define DIO76_WPORT  PORTJ
#define DIO76_DDR    DDRJ
#define DIO76_PWM    NULL
#define DIO77_PIN    PINJ6
#define DIO77_RPORT  PINJ
#define DIO77_WPORT  PORTJ
#define DIO77_DDR    DDRJ
#define DIO77_PWM    NULL
#define DIO78_PIN    PINE2
#define DIO78_RPORT  PINE
#define DIO78_WPORT  PORTE
#define DIO78_DDR    DDRE
#define DIO78_PWM    NULL
#define DIO79_PIN    PINE6
#define DIO79_RPORT  PINE
#define DIO79_WPORT  PORTE
#define DIO79_DDR    DDRE
#define DIO79_PWM    NULL
#define DIO80_PIN    PINE7
#define DIO80_RPORT  PINE
#define DIO80_WPORT  PORTE
#define DIO80_DDR    DDRE
#define DIO80_PWM    NULL
#define DIO81_PIN    PIND4
#define DIO81_RPORT  PIND
#define DIO81_WPORT  PORTD
#define DIO81_DDR    DDRD
#define DIO81_PWM    NULL

Now save that file. Next open up the configuration.h file, and scroll down to about line 250. Make the changes so your firmware looks like what is below

//LCD and SD support
// #define ULTRA_LCD  //general lcd support, also 16x2
// #define SDSUPPORT // Enable SD Card Support in Hardware Console
// #define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
#define ULTIPANEL  //the ultipanel as on thingiverse
#ifdef ULTIMAKERCONTROLLER    //automatic expansion
 #define ULTIPANEL
 #define NEWPANEL

#define NEWPANEL  //enable this if you have a click-encoder panel
  #define SDSUPPORT
  #define ULTRA_LCD
  #define LCD_WIDTH 20
  #define LCD_HEIGHT 4
// Preheat Constants
  #define PLA_PREHEAT_FAN_SPEED 0    // Insert Value between 0 and 255
  #define ABS_PREHEAT_HPB_TEMP 100
  #define ABS_PREHEAT_FAN_SPEED 255    // Insert Value between 0 and 255
#else //no panel but just lcd 
  #ifdef ULTRA_LCD
    #define LCD_WIDTH 16
    #define LCD_HEIGHT 2    

Save that file. Now, open up your pins.h file. Scroll down to the bottom of the Rambo pins area, around line 1205. We need to change a few pin numbers here

change SDSS to 53
change KILL_PIN to 80

Now we need to add some pin definitions. Copy and paste the following defines directly below the SUICIDE_PIN line

#ifdef ULTRA_LCD
  #ifdef NEWPANEL
 //arduino pin which triggers an piezzo beeper
    #define BEEPER 79      // Beeper on AUX-4
    #define LCD_PINS_RS 70 
    #define LCD_PINS_ENABLE 71
    #define LCD_PINS_D4 72
    #define LCD_PINS_D5 73 
    #define LCD_PINS_D6 74
    #define LCD_PINS_D7 75
   //buttons are directly attached using AUX-2
    #define BTN_EN1 76
    #define BTN_EN2 77
    #define BTN_ENC 78  //the click
    #define BLEN_C 2
    #define BLEN_B 1
    #define BLEN_A 0
    #define SDCARDDETECT 81    // Ramps does not use this port
     //encoder rotation values
    #define encrot0 0
    #define encrot1 2
    #define encrot2 3
    #define encrot3 1
  #else //old style panel with shift register
   //arduino pin witch triggers an piezzo beeper
    #define BEEPER 33    No Beeper added
   //buttons are attached to a shift register
   // Not wired this yet
   // #define SHIFT_CLK 38
   // #define SHIFT_LD 42
   // #define SHIFT_OUT 40
   // #define SHIFT_EN 17
    #define LCD_PINS_RS 75 
    #define LCD_PINS_ENABLE 17
    #define LCD_PINS_D4 23
    #define LCD_PINS_D5 25 
    #define LCD_PINS_D6 27
    #define LCD_PINS_D7 29
   //encoder rotation values
    #define encrot0 0
    #define encrot1 2
    #define encrot2 3
    #define encrot3 1
   //bits in the shift register that carry the buttons for:
   // left up center down right red
    #define BL_LE 7
    #define BL_UP 6
    #define BL_MI 5
    #define BL_DW 4
    #define BL_RI 3
    #define BL_ST 2
    #define BLEN_B 1
    #define BLEN_A 0
#endif //ULTRA_LCD

Now, save and upload your new modified firmware to your RAMBo using the arduino IDE that you modified with the file above, and you should have a working smart LCD controller. ENJOY!


More Resources

Wiki page for the Rambo board

Wiki page for the RepRapDiscount_Smart_Controller

Github page for the Arduino 1.x.x AddOns

Github page for the Rambo SmartLCD Controller Adapter

Where to Buy

Smart LCD Controller

RAMBo Smart LCD Adapter