4D Systems Serial Terminal Test

The 4D systems display showing messages sent by an Arduino micro.

4D Systems are an Australian company that make a range of intelligent displays. These displays include microcontrollers which can be programmed using a language called 4DGL to create graphical displays complete with touch sensitive buttons, images and animations. The display is attached to the Arduino using a serial port, but because it can run sophisticated programs the bandwidth of the serial port need not be a limitation when creating elegant user interfaces. This project is a small serial terminal program that runs on a uLCD-28PT-GFX2 display displaying text sent to it. As text fills the display the serial terminal scrolls old text off the top.

The display seemed to have trouble buffering serial data while rendering text to implement scrolling so two modes are supported: line mode and character mode.

In character mode, characters are written to the display as they are received. If data arrives too quickly characters can be lost. Line mode implements handshaking. Characters are received and buffered until a carriage return is received. The buffered characters are drawn and when the display is ready to receive more text it sends a ‘>’ character back to the Arduino.

To switch to character mode, send the character 0x11. Switch to line mode by sending 0x12 and clear the screen by sending 0x0c. The character and line modes are implemented in two separate functions: you can strip out the bit you don’t need to save memory.

The source code for the serial terminal to run on the 4D system display, and a test program that runs on the Arduino, is shown below. The test program assumes the display is connected to serial port 3. You can also download the complete source code for the Arduino terminal display below.

4DSystems display program to implement a serial terminal.

Arduino Serial Terminal Test Program

This program runs on the Arduino and sends a simple text string to the display. It switches between character mode and line mode and clears the display every 50 messages.

4D Systems Display Serial Terminal Program

This program runs on the uLCD-28PT_GFX2 display, though it should be compatible with any Picaso display.

Recommended Posts
Showing 3 comments
  • Mick

    The 4dgl code does not compile

  • mick

    Looks like all the ” are in html tags like ‘ <‘ OK, i think i fixed them all ,

    • Philip Rowe

      Thanks for pointing that out. WordPress likes to convert them to html. Annoying!

Leave a Comment

Start typing and press Enter to search