Parts: 4×20 VFD Character Display (NA204SD02)

futuba-serial

Futaba makes vacuum florescent character displays that can be used as a drop-in replacement for common character LCDs. VFDs have a wider viewing angle, and generally look cooler.

Futaba’s character displays can be interfaced using the standard 8-bit or 4-bit parallel LCD interface, or a simple two-wire protocol. The protocol type is set by resistors on the back of the display, so it’s not particularly easy to change without a hot-air rework station. Today we’ll demonstrate a serially-interfaced VFD using the Bus Pirate.

Futuba VFD character LCD replacement (NA204SD02, $7.00). Datasheet (PDF).

VFD (pin #) Bus Pirate
GND (1) GND
+5volts (2) +5volts, Vpullup
Data (3) MOSI
Strobe (4) CS
N/C (5)
Clock (6) CLK

We used our Bus Pirate universal serial interface to demonstrate the Futaba VFD, but the interface operations will be the same for any microcontroller implementation. The connections we made between the VFD and the Bus Pirate are shown in the table above.

We setup the Bus Pirate for raw2wire mode (menu M, 7) with open drain outputs (HiZ). The open drain outputs let us interface the 5volt VFD from the 3.3volt Bus Pirate using the on-board pull-up resistors (menu P, 2). Finally, we enabled the on-board power supply (capital ‘W’).

The VFD’s strobe pin is connected to the Bus Pirate CS pin.  The auxiliary pin doesn’t have it’s own pull-up resistor but CS does. CS is otherwise unused in raw2wire mode, so we reassigned the auxiliary commands to the CS pin (menu C,2).

Interfacing

vfd-serial

The two-wire interface uses a straight-forward 16bit (2byte)  protocol (datasheet page 20). The LCD control bits (R/W, RS) go in the first byte, and eight data bits go in the second. All transactions start with strobe low and end with strobe high. Read operations are similar to writes, except the R/W bit is set and the second byte is read.

vfd-command.pg27.

The Futaba VFD accepts all the standard HD44780 LCD commands (datasheet page 27), see these tables for a detailed description of each command. After a reset (power-up), the VFD expects the first command to be the function set command.

RAW2WIRE>@ <–start with strobe high
AUX HIGH IMP, READ: 1 <– aux pin (CS) is now input, pull-up resistor holds strobe high
RAW2WIRE>a 0b11111000 0b00111000 @ <–command
AUX LOW <–strobe low
WRITE: 0xF8 <–start byte (R/W=0, RS=0)
WRITE: 0x38 <–instruction byte (function set)
AUX HIGH IMP, READ: 1 <–strobe high
RAW2WIRE>

Function set configures the data interface length (bit 4), display lines (bit 3), and brightness/luminescence (bits 1,0).  Before we start we set the strobe pin high (@) in case it’s currently low. Then, we start the transaction by taking the strobe pin low (a), and send the first byte with the R/W and register select (RS) settings.

The second byte is the command. We set the data interface length to 8bits (bit 4 = 1), but in serial mode this is probably ignored. Our display has multiple lines (bit 3 = 1), and we set brightness to full (bits 1,0 = 0). The sequence concludes when the strobe pin returns high (@).

RAW2WIRE>a 0b11111000 0b00001111 @
AUX LOW <–strobe low
WRITE: 0xF8 <–start byte (R/W=0, RS=0)
WRITE: 0x0F <–instruction byte (display on/off control)
AUX HIGH IMP, READ: 1 <–strobe high
RAW2WIRE>

The display ON/OFF command enables the display (bit 3), toggles the cursor (bit 1), and blinks the cursor (bit 0). We enabled the display (bit 3 = 1) with a blinking cursor (bit 1,0 = 1) so it’s obvious that the display is working.

RAW2WIRE>a 0b11111000 0b10000000 @
AUX LOW <–strobe low
WRITE: 0xF8 <–start byte (R/W=0, RS=0)
WRITE: 0x80 <–instruction byte (DDRAM address set)
AUX HIGH IMP, READ: 1 <–strobe high
RAW2WIRE>

Before writing characters to the display we need to position the cursor by sending the DDRAM address set command (0b10000000) summed with the desired cursor position. We set the cursor to the first character on line 1.

The second character on line 1 is located at 0x01. To set this address we’d send 0b10000001 (0b10000000 +0b00000001).

Character display memory isn’t linear, the first line starts at 0x00, the second line starts on position 0x40, the third at 0x14, and the last line begins with position 0x54. Most displays have a similar configuration, here’s some tables for determining the layout of different character displays.

RAW2WIRE>a 0b11111010 0x48 0x61 0x63 0x6b 0x20 0x61 0x20 0x44 0x61 0x79 @
AUX LOW <–strobe low
WRITE: 0xFA <–start byte (R/W=0, RS=1)
WRITE: 0x48 <–ASCII letter ‘H’

WRITE: 0x79 <–ASCII letter ‘y’
AUX HIGH IMP, READ: 1 <–strobe high
RAW2WIRE>

Finally, we can enter some characters at the position set with the previous command. Characters are entered as their ASCII equivalent values. We displayed “Hack a Day” with proper capitalization.

Multiple characters can be entered at once, but because the memory space isn’t contiguous it’s necessary to manually position the cursor at the beginning of each new line. After writing the last position of line 1, the cursor will advance to the first character of line 3. Use another position command, 0b10010100, to set the cursor to the beginning of line 2 (0b10000000 + 0x14 = 0b10010100).

Like this post? Check out the parts posts you may have missed. Want to request a part post? Please leave your suggestions in the comments.

Hack a Day review disclosure: We bought the serial VFD demonstrated here on eBay, Futaba also sent us a sample with a parallel interface that we’ll demo later (shown here).

futuba-serial.ii

24 thoughts on “Parts: 4×20 VFD Character Display (NA204SD02)

  1. It’d be cool if you guys (or a commenter) could cover what filter materials to use with VFDs. That pale blue phosphor glow is pretty ugly, and contrast can be improved a good deal with a filter.

    I just don’t know what materials to use or where to get them. I wonder if lighting gels might work? Or just cheap coloured cello from the art shop? Try some stuff and let us know.

  2. That particular vendor is sold out, and I’m having trouble finding retail quantities for this item. Can anyone point to some other vendors for this or similar VFD models?

  3. I’ve been using a large 4×40 serially (as in RS232) interfaced display like this for terminal displays for some time. Of course large costs; it’s about five hundred bucks to get one fixed, and almost eight hundred for a new one.

    #1 problem to beware of: VFD’s burn. Do not leave the same message showing all the time or it will become permanent within a matter of months. You should use a screen saver to drop the brightness and make a short message wander around when the screen isn’t in use.

    Also @error404 we haven’t found a need for elaborate filter materials, but then ours are industrial controls and reading them is more important than them being pretty.

  4. dear hackaday folks, i hope you realize that for those of us not using bus pirate these command lines appear rather cryptic. tables and diagrams are a lot more useful.

  5. I don’t suppose anyone knows where to get a 40×4 display from? I’m currently in need of one for one of my projects, and I might just use a 40×4 LCD since they’re available, but I’m trying to replace a VFD and would prefer to keep the look.

  6. Personally think that VFDs are ugly and old-fashioned, present a project with a VFD display with no filtering to a group of normal users and they tend to ask why you’re not using LCDs in pretty colours etc. And I tend to agree, for most uses LCD are capable and cheap.

  7. oops – I stand corrected.

    while there is a driver on board, it uses a low level interface requiring all the pixel data to be bit-banged over a serial connection. so this is _not_ a drop in lcd type replacement, and thus the cheap $4 price.

    nonetheless, it appears that it is possible to successfully use this display with a microcontroller.

  8. @ james:

    it may be a matter of personal preference, but i hardly view most common lcd displays as any more ‘modern’ than vfd… if anything, the ubiquitousness of lcds makes them boring to me – vfd displays tend to stand out from the crowd. It has got to the point where I even prefer led’s to lcds. and I find both vfd and led to be more easily read under most conditions.

  9. VFDs can look excellent with good filters, easily better than LCDs can. You can pretty much choose any colour you like (the spectrum, while it favours blue/green colours, is quite wide), and including a filter really improves contrast and reduces the appearance of the display grid a good deal. Really a night-and-day difference, I’m just not sure what materials work well for this.

    For example see this guy’s preamp project: http://is.gd/1z2Ap

  10. Hallo IAN, Hi all,
    I try to find the PINOUT for the 20 pole Pinheader on a Futaba NA204SD01BA, I assume it could be the same as shown here. I tried to find Datasheet but there are no informations on the net. Maybe somebody can provide this informations?
    Thank you very much.

Leave a Reply to PunMasterCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.