A Graphics Display for the Sceptre [100652]
Add a graphic display to the Elektor Sceptre and a little trackball and the Sceptre smartphone comes within reach…
The Elektor Sceptre is a 32-bit fast prototyping platform designed for mobile applications. So what could be more normal that to fit it with a display from the world of mobile phones? And while we’re at it, what would you say to a little trackball à la BlackBerry for navigating around the graphical interface you’ve always been wanting to create? We’re not far away from a Sceptre smartphone…
This is article is part of a large project published in 2010 & 2011 covering several articles:
The colour graphics display for the Nokia 6100 phone is very popular, thanks to its low cost, its serial interface, and the availability of open-source drivers. It is a 132x132 pixel square 4096-colour display with an effective area of around 30x30 mm. And the icing on the cake: you can buy ready-made PCBs with this display already fitted. For my prototype, I went for a display module from Sparkfun (#LCD-09363). This module, in the form of an Arduino shield, includes the display itself, three push-buttons, and a voltage booster for the backlight.
From the same manufacturer, we also find a little module (#COM-09320) with a trackball from a BlackBerry mobile phone, a push-button, and four LEDs (red, green, blue, and white). The transparent trackball is mounted above the four LEDs and the push-button. This lets us change the colour of the ball and press on it. The ball rotation direction is detected by four digital Hall-effect sensors.
The display communicates via an SPI bus, while the trackball requires nine ports: four inputs and five outputs. By adding an SPI bus port expander, it becomes possible to control the trackball and display over a single SPI bus. Adding a 16 Mbit flash memory, for example, to this SPI bus costs us only one extra pin (for the CS signal), so why stint ourselves? And connecting all this to the Sceptre requires only six pins — three for the SPI bus and three selection signals.
Given that the display module used is an Arduino shield, we need an adaptor to be able to connect it to the Sceptre. In that case, why not make a universal adaptor that will let us connect any Arduino shield to the Sceptre? An Arduino has 13 digital I/Os (including two that are also used as an asynchronous serial port) and 6 analogue ports (which can also be digital). If the asynchronous serial port is connected directly to the Sceptre’s UART0, the port expander can take care of the remaining 11 digital ports. This chip can communicate at 10 Mbit/s, fast enough for most shields. The analogue ports are connected to six of the Sceptre’s analogue ports. This enables us to control a shield with just 12 ports instead of 19.
So what we end up with is a universal Arduino adaptor for the Sceptre (an Arduino InterSceptre). But if you fit it with the other components and modules, you’ll have an expansion board with display, trackball, and flash memory.
Let’s end with a few words about the software side. On the Internet, you can find dozens of drivers for the Nokia display. However, they almost all suffer from the same drawback: they don’t use the SPI bus in SPI mode, but in bit-banging. This aberration is due to one document that has become the reference and which details the way to control the display. Even though this document is quite well written, the software that goes with it is not. So the Sceptre will be driving the display in genuine SPI, as we’re not afraid of the 9-bit words used by the display. Using our driver, based on this one, it’s easily possible to display more than ten images per second (which already corresponds to 2 Mbit/s). Since several devices are sharing the same SPI bus, it’s easy to get in a muddle, especially if the devices aren’t all using the same SPI mode. So it’s important to properly segregate the transactions on the SPI bus and to avoid having an SPI transaction in progress interrupted by another, otherwise it’s guaranteed to crash.
The software with examples and the Eagle CAD file for the PCB design are available below. Note that the latest Sceptre core is available from the main Sceptre page.
This is article is part of a large project published in 2010 & 2011 covering several articles:
- The Sceptre - hardware (main article)
- The Sceptre - software
- Debugging the Sceptre over JTAG
- The InterSceptre - I/O expansion board
- The Sceptre meets Arduino
- The Sceptre meets Oberon
- Graphic display shield for the Sceptre (this article)
The colour graphics display for the Nokia 6100 phone is very popular, thanks to its low cost, its serial interface, and the availability of open-source drivers. It is a 132x132 pixel square 4096-colour display with an effective area of around 30x30 mm. And the icing on the cake: you can buy ready-made PCBs with this display already fitted. For my prototype, I went for a display module from Sparkfun (#LCD-09363). This module, in the form of an Arduino shield, includes the display itself, three push-buttons, and a voltage booster for the backlight.
From the same manufacturer, we also find a little module (#COM-09320) with a trackball from a BlackBerry mobile phone, a push-button, and four LEDs (red, green, blue, and white). The transparent trackball is mounted above the four LEDs and the push-button. This lets us change the colour of the ball and press on it. The ball rotation direction is detected by four digital Hall-effect sensors.
The display communicates via an SPI bus, while the trackball requires nine ports: four inputs and five outputs. By adding an SPI bus port expander, it becomes possible to control the trackball and display over a single SPI bus. Adding a 16 Mbit flash memory, for example, to this SPI bus costs us only one extra pin (for the CS signal), so why stint ourselves? And connecting all this to the Sceptre requires only six pins — three for the SPI bus and three selection signals.
Given that the display module used is an Arduino shield, we need an adaptor to be able to connect it to the Sceptre. In that case, why not make a universal adaptor that will let us connect any Arduino shield to the Sceptre? An Arduino has 13 digital I/Os (including two that are also used as an asynchronous serial port) and 6 analogue ports (which can also be digital). If the asynchronous serial port is connected directly to the Sceptre’s UART0, the port expander can take care of the remaining 11 digital ports. This chip can communicate at 10 Mbit/s, fast enough for most shields. The analogue ports are connected to six of the Sceptre’s analogue ports. This enables us to control a shield with just 12 ports instead of 19.
So what we end up with is a universal Arduino adaptor for the Sceptre (an Arduino InterSceptre). But if you fit it with the other components and modules, you’ll have an expansion board with display, trackball, and flash memory.
Let’s end with a few words about the software side. On the Internet, you can find dozens of drivers for the Nokia display. However, they almost all suffer from the same drawback: they don’t use the SPI bus in SPI mode, but in bit-banging. This aberration is due to one document that has become the reference and which details the way to control the display. Even though this document is quite well written, the software that goes with it is not. So the Sceptre will be driving the display in genuine SPI, as we’re not afraid of the 9-bit words used by the display. Using our driver, based on this one, it’s easily possible to display more than ten images per second (which already corresponds to 2 Mbit/s). Since several devices are sharing the same SPI bus, it’s easy to get in a muddle, especially if the devices aren’t all using the same SPI mode. So it’s important to properly segregate the transactions on the SPI bus and to avoid having an SPI transaction in progress interrupted by another, otherwise it’s guaranteed to crash.
The software with examples and the Eagle CAD file for the PCB design are available below. Note that the latest Sceptre core is available from the main Sceptre page.
Discussion (0 commentaire(s))