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

Comments

  1. Chris_C says:

    ooooh *actual* tech info on hack-a-day….

  2. error404 says:

    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.

  3. If you have another source of those displays at $7, let us know! I’d love a few :)

  4. Josh McCormick says:

    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?

  5. localroger says:

    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.

  6. Agent420 says:

    I personally like the blue phosphor color, and have never used any kind of filter for my vfd projects.

    BG Micro has an inexpensive 1 line display:

    http://www.bgmicro.com/index.asp?PageAction=VIEWPROD&ProdID=12312

    Otherwise I often see deals on surplus vfd’s on ebay – just make sure you get or understand the interface because not all of them are identical to the std lcd protocol.

  7. Marco says:

    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.

  8. another_reader says:

    As an alternative, don’t forget Electronic Goldmine. http://www.goldmine-elec-products.com/prodinfo.asp?number=G17177

  9. twentyofone says:

    I’ve been using 4×20 lcds (blue/white) from sureelectronics. not as cool as vfd but can be had for $10.80 shipped.

  10. pokey says:

    @marco: You know, there’s a link to the data sheet above.

  11. WeblionX says:

    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.

  12. PunMaster says:
  13. ian lesnet says:

    @punmaster – I was excited about your link for a $4 20×2 version, but then I noticed that that VFD has no driver circuitry, so watch out.

  14. Agent420 says:

    @ ian:
    Actually, it appears all the driver circuitry is on board – I think they just have a particulary poor item description.

    Google returns several hits on that part #, including one detailing a project built around it:

    http://wiki.ovccorp.com/index.php?pagename=Futaba%20NA202MD13AA

  15. James says:

    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.

  16. Agent420 says:

    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.

  17. Agent420 says:

    @ 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.

  18. error404 says:

    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

  19. Hitek146 says:
  20. acausal says:

    Oh nice! I just got like eight of these in one of those “giant-grab-bag-of-components” boxes, and I’ve been trying to find this very info on them.

  21. CU20045-UW7J says:
  22. Santiago Suarez says:

    Greetings

    Do you may the opposite? Emulating a VFD display with an LCD screen?

    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93,850 other followers