This page will help you set up the reprapdiscount.com Smart LCD controller to work on the RAMBo boards by UltiMachine. You will find all the instructions needed here to modify the cables (for now, until the adapter PCB is born), firmware mods, arduino mods and more to get your LCD controller working.
This has been tested on REVD and REVE boards from UltiMachine. There is an adapter PCB in the works hopefully soon (Dec. 2012) that will use the standard cables shipped with the smart controller, so no more wiring hacks will be needed. Until then, follow the simple steps below to make your own wiring adapter
The following file was created by user: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.
Step 1: Making the cables
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.
Step 2: Updating your Arduino IDE
This step has been tested and known to work with Arduino 0022 and 0023. If you try another version, and it works, post it here please.
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. It sounds hard, but 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
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.
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 #endif #ifdef ULTIPANEL #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_HOTEND_TEMP 170 #define PLA_PREHEAT_HPB_TEMP 60 #define PLA_PREHEAT_FAN_SPEED 0 // Insert Value between 0 and 255 #define ABS_PREHEAT_HOTEND_TEMP 240 #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 #endif #endif
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 #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!
Wiki page for the Rambo board
Wiki page for the RepRapDiscount_Smart_Controller