Making the LCD 12864 work on the DuetWifi, please advise

  • As I understand, the set of lcd connectors on the Duet2 Wifi/Ethernet were thought for connecting a 2004 LCD, which will never get support so they are of no use (except for using the pins for I/O and maybe for motors 9 and 10).

    On the Duet Maestro, there are also RAMPS-like connectors but they are designed to plug a ReprapDiscount-like graphics LCD with rottary encoder and buzzer. And the last firmware have gone forward with supporting it, as is described here:

    Now, I have a DuetWifi and I would like to fit a 12864+encoder on it. Now that the worst part is done (firmware support), I guess I can manage to make a daughter board that adapts the display to the right pins on the duet.


    • will the firmware just work, once the hardware is fitted, or will it know that it's not a maestro and disable support for it?
    • can anyone (@dc42?) give some advice about it?

    I'm comfortable with the electronics, just new to the duet itself.

    Thank you!

  • administrators

    The firmware build for the Duet 2 Ethernet/WiFi doesn't include the 12864 support. This is because you would need additional hardware to support it. The CONN_LCD socket was intended for a 20x4 text display, not a 12864.

    To support a 12864 you would need to pick up the SCLK, MOSI and one of the CS signals from the temperature daughter board connector or the expansion bus, gate the SCLK signal with CS and level shift it to 5V, and also level shift CS and MOSI to 5V. On the Maestro we use a 74HCT08 chip to do all of this.

    You would need to make up special cables or an adapter board to connect the 12864 to the correct pins in the Duet.

    Then you would need to modify the firmware build to reduce DRIVES from 12 to 10 (to free up pins for the encoder), define the pins for the encoder and the CS pin you used, and enable the 12864 code. In principle only the Pins_DuetNG file would need to be changed.

  • Thank you very much for the insights. I will try to put together the hardware part and maybe come back for a little more help 😁

  • @dc42 said in Making the LCD 12864 work on the DuetWifi, please advise:

    o pick up the SCLK, MOSI and one of the CS signals from the temperature daughter board connector or the expansion bus,

    Ok, after some time studying all the connectors on RAMPS, Duet2 and Duet Maestro I think I got what needs to be done. Already got the 74HCT08 chip.


    1. Would any of the other pins on CONN_LCD work as a CS (like for example LCD DB7, LCD DB6, LCD DB5, LCD DB4, LCD RS or LCD E) or is it really necessary to use on of the official SPI CS pins?

    2. In case the answer to the above is that I really need a CS pin from the temp daughter board, which one would be best? I see there is CS0, CS2, CS3 and CS4 there. I take it that CS0 is already used on the SD card (since it's the only one on the CONN_SD connector) and I should use one of the others. I would like to use the same that Maestro use, if possible, so the code does not need to be changed, but on the Maestro board there is only "LCD CS" written on the hardware diagram.

    3. Will there be support for the BEEP pin that drives the buzzer? I guess it's a simple matter of enabling the pin (or enabling a PWM on the pin in the case of the buzzer that can make tones) and that can be done with simple gcode (M42, por example), but it would be nicer to integrate with the M300. But this is of low importance now. Edit: I see that there is a BEEP pin on the Maestro too so I get that this is supported.

    4. To support the SD also I would have to level-shift in both directions because the SD itseld will use 3.3v but the RepRapDiscount board is already levelshifting that to/from 5v because the whole thing is supposed to use 5v on the RAMPS. That means one more 74hct08 chip at least. Any other observations?

    Thank you!!!

  • administrators

    1. Yes it should be possible to use a spare CONN_LCD pin for CS.

    2. On the Maestro we don't level shift the SD card pins. The 5V to 3.3V level shifters work OK with 3.3V inputs, and the RepRapDiscount schematic shows that there is no level shifter coming the other way for the MISO signal.

  • @dc42

    I've been following the pin mappings equivalents between the duet2 wifi and the maestro to make sure I'll be using the best pins, but I can't define what to use as BEEP and LCD_CS on the duet wifi. On the maestro, the BEEP is TIOA1 / PIN 30 and the LCD_CS is PC9 / PIN 62.

    Are those two signals present on any other place on the duet wifi board? I would prefer to find the same signals on the board and pick them, keeping firmware modifications minimal. If that is not possible, then I'l chose two spare pins on the LCD connector themselves and change pins on firmware.

  • administrators

    I suggest you use CS3 and CS4 on the daughter board connector for those two pins, because they won't be used for anything else unless you configure a temperature sensor to use them.

Log in to reply