Sunday, 24 February 2013

Working Panelolu 2 I2C...

I managed to configure and compile the latest version of Marlin on Huxley #710. Huxley #710 consists of a Sanguinololu board upgraded with an ATMEGA 1284 PU. Now with a Microchip MCP23017 I²C I/O Expander controlling a Hitachi HD44780 compatible display device. The prototype hardware configuration previously tested worked a treat, however the new Marlin software did not work quite so readily. The new Marlin software makes Huxley #710's display compatible with Tony's Panelolu 2 implementation but at a cost.

Huxley #710 - Panelolu 2 Using I2C interface
The enabling addition to Marlin is that it now includes references to the LiquidTWI2 library selected by Tony for Panelolu 2. This Arduino library provides support for the Microchip I2C integrated circuit and a connected Hitachi HD44780 compatible display device.

The library extensions also allows for buttons, LED's and a buzzer to be included. The buttons, buzzer and additional LED's are not included on the prototype hardware.

The display shown in the image is a Radio Spares (RS) 720-0226 Fordata FDCC2004B-FLYYBW-51SE. Note that only 4 wires are used in the multi colour ribbon cable 0v, +5v and two for the I2C communication.

The software issue was associated with the Buzzer implementation in the Panelolu 2 implementation. It seems from the error report that the, 4000) function can't be located in the LiquidTWI2 library. The reported error was 'Error undefined reference to LiquidTWI2::buzz(long, unsigned char)'. For the moment I have commented out this line in the ultralcd.cpp module, as I don't have a buzzer attached to my prototype hardware.

The compiled size using the LiquidTWI2 library came to 100,650 of 129,024 bytes in the ATMEGA 1284 PU part. This is an increase of 27,130 bytes above the 73,520 of my PCF8574 implementation based on the LiquidCrystal_I2C for the Arduino using a Phillips (NXP) I2C chip PCF8574P. That's quite a footprint increase in the memory. At the moment I don't know what the root cause is, or what scope there might be to improve the situation.

I like the updated screen format on the display and the custom font definitions for indications of temperature and time for example. The screen update rate seems to perform reasonably well and the only thing I think I need to change is the 'Mendel Ready.' to suit Huxley #710. It would be nice if Marlin pulled up a machine name string from the configuration.h file.
Huxley #710 - Marlin LCD Menu

Next I need to design a panel for Huxley #710 based on my display type and I hope to allow support for the larger bezels that often seem to be used in the Panelolu display. Additionally I need to decide how much of the Panelolu 2 hardware to implement and if to use a custom PCB or a strip board implementation.

HD44780 Compatible display used on Huxley #710