Panelolu with Printrboard
Update: The Panelolu2 has replaced the Panelolu. It is much quicker to install, has adapter boards to no messing with cables and uses less pins. The blog post with the information is here, it is available to buy in our webshop.
The Printrboard is a based on the Teensylu which is itself a derivative of the Sanguinololu; the main difference is the use of the AT90USB1286 in place of the ATmega644P or 1284P.
Thanks to the work of Lincomatic, Marlin firmware will run on the AT90USB1286. The Printrboard section of the RepRap wiki page has information on the board and an outline of how to upload the firmware - you will need Lincomatic's fork of Marlin. The Printrboard I bought was supposed to come with a bootloader but that did not work. I followed Lincomatic's instructions to install the CDC bootloader using the Pololu ISP I have used previously on ATmega644P and ATmega1284P micros. It's worth ensuring you have a working setup with the Printrboard connecting to your control software (Pronterface for me) and firmware uploading before you go any further.
Built in SD card reader or SDSL?
The Printrboard has a build in SD card reader so you do not need an SDSL. That said I prefer to have the electronics hidden away, so using the SDSL in the Panelolu is my preference. Both options will work and are described below.
Hardware and wiring the Panelolu
The wiring internal to the Panelolu is identical to that described in my previous post, with the option not to bother with wires 13,15,16,17,19,20,21,22 and the 10 pin IDC connector if you are going to use the build in SD card reader on the Printrboard.
Unfortunately the design of the expansion headers on the Printrboard does not keep to the standard 2.54mm spacing between the expansion header and the ISP header (and 4 pins on ext1 are not I/O by default) - a simple IDC connector will not fit without bending the pins . The solution is to use the same connectors that are used on the LCD and circuit board within the Panelolu.
The pin out is as follows:
Ribbon cable wire
number
|
Printrboard Pin
Label
|
Marlin Pin
number
|
Marlin Pin
name
|
1
|
Not used *
|
---
|
---
|
2
|
Not used *
|
---
|
---
|
3
|
GND
|
---
|
---
|
4
|
5V
|
---
|
---
|
5
|
PD4
|
4
|
LCD_PINS_D7
|
6
|
A3
|
41
|
LCD_PINS_RS
|
7
|
PD6
|
6
|
LCD_PINS_D6
|
8
|
TX1
|
2
|
ENC1
|
9
|
PE1
|
9
|
LCD_PINS_D5
|
10
|
RX1
|
3
|
ENC2
|
11
|
PC1
|
11
|
LCD_PINS_D4
|
12
|
SDA
|
1
|
LCD_PINS_ENABLE
|
13
|
A2***
|
40
|
SDSS
|
14
|
SCL
|
0
|
|
18
|
RESET**
|
---
|
---
|
* Wire 1 and 2 are not connected/used but kept in for consistency with the original instructions.
** Can come either from the RESET pin on the expansion header or the ISP header.
*** Only required if a SDSL is used rather than the on board SD card reader
Update There was a mistake in the table above, thanks to Colin Bradburne for bringing the problem to my attention. It is fixed now - the lines in red have been amended.
If using the SDSL rather than the on board SD card reader then the following connections to the ISP header are used as well.
Ribbon cable wire
number
|
Printrboard Pin
Label
|
Marlin Pin number
|
Marlin Pin name
|
17
|
GND
|
---
|
---
|
18
|
RESET
|
---
|
---
|
19
|
MOSI
|
22
|
MOSI_PIN
|
20
|
SCLK
|
21
|
SCK_PIN
|
21
|
5V
|
---
|
---
|
22
|
MISO
|
23
|
MISO_PIN
|
The Printrboard I bought does not have the expansion header pins labelled, I have annotated the pins on the screen shot of the board below:
The 4 pins labelled "JTAG PINS" are set to the
JTAG interface by default - I have done a
separate blog post about how to change the fuse settings to gain access to these pins as I/O. This does mean that we can't fit the Panelolu connections onto just one expansion header, hence the 4 pins on the second expansion header towards the centre of the board
The ribbon cable with the connectors will look like this:
Pairing this picture with the annotated screen shot of the board should show how to plug in the cables. (note that wire 1 and 2 are not in this picture as they are not used and that a 4 pin connector is used for MISO,SCLK and RESET because I ran out of 3 pin connectors)
Firmware configuration
The following firmware changes to Marlin are required to get the Panelolu working with a Printrboard. Please note that line numbers are based on my version of Lincomatic's branch of Marlin - they may be slightly different with a different version or after additional changes are made.
Configuration.h
line 34-40:
#define MOTHERBOARD 81
#if (MOTHERBOARD == 81) //printrboard
#define SDSUPPORT
//comment out the following line to use onboard SD card reader
#define USESDSL
#endif
line 234:
#define ULTIMAKERCONTROLLER
Pins.h
within the Printrboard (81) section
line 953 -984:
#ifdef ULTRA_LCD
#ifdef NEWPANEL
//we have no buzzer installed
#define BEEPER -1
//LCD Pins
#define LCD_PINS_RS 41
#define LCD_PINS_ENABLE 1
#define LCD_PINS_D4 11
#define LCD_PINS_D5 9
#define LCD_PINS_D6 6
#define LCD_PINS_D7 4
//The encoder and click button
#define BTN_EN1 2 //must be a hardware interrupt pin
#define BTN_EN2 3 //must be hardware interrupt pin
#define BTN_ENC 0 //the click
//not connected to a pin currently
#define SDCARDDETECT -1
//from the same bit in the RAMPS Newpanel define
//encoder rotation values
#define encrot0 0
#define encrot1 2
#define encrot2 3
#define encrot3 1
#define BLEN_C 2
#define BLEN_B 1
#define BLEN_A 0
#endif //Newpanel
#endif //Ultipanel
Sd2PinMap.h
Line 224-236
// SPI port
#if MOTHERBOARD == 81 //printrboard
#ifdef USESDSL //SDSL with Panelolu
uint8_t const SS_PIN = 40; //F2
#else
uint8_t const SS_PIN = 26; // B6
#endif
#else
uint8_t const SS_PIN = 20; // B0
#endif
uint8_t const MOSI_PIN = 22; // B2
uint8_t const MISO_PIN = 23; // B3
uint8_t const SCK_PIN = 21; // B1
To explain what the firmware changes actually do:
- Add the USESDSL define to configuration.h which allows easy toggling between the onboard SD card reader and the SDSL
- Enable the ULTIMAKERCONTROLLER which the PanelMax and Panelolu are derivatives of.
- Define the pins that are used for the Panelolu within the Printrboard section of the pins definition file
- Add a check to the SdPinMap to see if SDSL on onboard card reader is selected with the USESDSL define.
Summary
To get a Panelolu working on Printrboard:
- Confirm you can connect to the Printrboard and upload firmware - if not follow Lincomatic's instructions for loading a bootloader.
- Get Lincomatic's branch of Marlin and make the changes listed in the Firmware section above.
- Get the components required for a Panelololu and wire up the Panelolu end as described in my previous post.
- Wire up the end of the ribbon cable that is going to the Printrboard as described above.