Shop OBEX P1 Docs P2 Docs Learn Events
Driving Noritake VFD displays from the Stamp: Code for ya — Parallax Forums

Driving Noritake VFD displays from the Stamp: Code for ya

xanatosxanatos Posts: 1,120
edited 2014-02-16 06:42 in BASIC Stamp
I've been playing with a new toy: the Noritake Vacuum Fluorescent Display. Nice display, good high-contrast, high-brightness display with a lot of options and a wide temperature range.

For anyone interested in driving it right out of the box (be sure you get the serial version and be sure you solder the jumper to set the baud to 9600!), here's a pack of code that covers setting display brightness, individual character brightness, cursor position, text magnification, character blinking, and a whole boatload of other stuff that can make a fun display.

Also I have attached the datasheet here. This is specifically for the Noritake CU24063-Y1A display. Be sure to order from Noritake, apparently there's a markup through the distributors.

Also note that this code was written for the BS2px, so be sure to change that line if you're using some other BS2 version. I think this display will work on any BS2. I've seen some posts that question the earlier BS2 chips ability to do 9600, but they've always worked for me. YMMV.

Have fun!

Dave

' =========================================================================
'
'   File....... VFD_Demo_Only.bs2
'   Purpose.... Basic functions for the Noritake VFD Serial 24 x 6 display, Noritake CU24063-Y1A
'   E-mail..... xanatos@xanatos.com
'   Updated.... 13 February 2014
'
'   {$STAMP BS2px}
'   {$PBASIC 2.5}
'
' =========================================================================

' -----[ Program Description ]---------------------------------------------
'
' Basic functions for the Noritake VFD Serial 24 x 6 display.  Read the comments to see what each part controls
'
' -----[ Revision History ]------------------------------------------------
'
' 1.0: Initial release
'
' -----[ I/O Definitions ]-------------------------------------------------

LCD             PIN     0                       ' Serial LCD Display (NHD 4x20)

' -----[ Variables ]-------------------------------------------------------

secs            VAR     Byte                    ' Phony seconds counter
sBrite          VAR     Nib                     ' Screen Brightness Var
cBrite          VAR     Nib                     ' Character Brightness Var
' -----[ Constants ]-------------------------------------------------------
#SELECT $STAMP
  #CASE BS2, BS2E, BS2PE
    T2400       CON     396
    T9600       CON     84
    T19K2       CON     32
  #CASE BS2SX, BS2P
    T2400       CON     1021
    T9600       CON     240
    T19K2       CON     110
  #CASE BS2PX
    T1200       CON     3313
    T2400       CON     1646
    T4800       CON     813
    T9600       CON     396
    T19K2       CON     188
    T38K4       CON     84
#ENDSELECT

LcdBaud     CON     T9600

' -----[ Initialization ]--------------------------------------------------

Init:

  PAUSE 50
  SEROUT LCD, LcdBaud, [$1B, $58, $FF]  ' Clear & reload jumper settings, interface, etc.  Clear rx buffer.
  SEROUT LCD, LcdBaud, [$14]            ' Cursor Off    ($13 is underline)
  SEROUT LCD, LcdBaud, [$1B, $41]       ' No Blinky
  SEROUT LCD, LcdBaud, [$1B, $53]       ' Flickerless Write mode  ($1b, $45 is quick write mode)
  SEROUT LCD, LcdBaud, [$1F, $01]       ' Display set to Overwrite Mode.


Display_Welcome:
  SEROUT LCD, LcdBaud, [$0C] ' Clear screen

  FOR sBrite = $01 TO $04
    SEROUT LCD, LcdBaud, [$1F, $58, sBrite]   'screen brightness incremented here.  01 = 25%, 2 = 50, 3 = 75, 4 = 100
    GOSUB GreetScreen
    PAUSE 500
  NEXT

  PAUSE 5000

' -----[ Program Code ]----------------------------------------------------

Main:

  SEROUT LCD, LcdBaud, [$1F, $28, $67, $40, $02, $02]   '2x magnify
  SEROUT LCD, LcdBaud, [$0C, $0B, "System Ready"]
  SEROUT LCD, LcdBaud, [$1F, $28, $67, $40, $01, $01]   '1x magnify
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $02, $00, "2014/02/14      12:22:48"]        ' Just some fake stuff to display that can be manipulated later
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $03, $00, "61", $F8, "F 34% RH 29.24", $22, " ", $5E]   ' notice $F8 is the degree sign. $22 is " and $5E is the ^ for Rising baro.
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $04, $00, "118.4v 5.12v"]
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $05, $00, "System Status: "]
  SEROUT LCD, LcdBaud, [$1B, $42]  ' Blinky ($41 for no blinky)
  SEROUT LCD, LcdBaud, ["Normal"]
  SEROUT LCD, LcdBaud, [$1B, $41]  ' No Blinky ($42 for blinky)

  FOR secs = 0 TO 59                                     'This section just shows how to reposition cursor to a point on teh display and overwrite text.
  SEROUT LCD, LcdBaud, [$1F, $24, $16, $00, $02, $00]    '[$1F, $24, $charpos, $00, $linepos, $00]   char = 00 to 23; line = 0 to 5
  SEROUT LCD, LcdBaud, [DEC2 secs]
  PAUSE 980
  NEXT

  PAUSE 10000


  GOTO Display_Welcome




' -----[ Subroutines ]-----------------------------------------------------
GreetScreen:
  SEROUT LCD, LcdBaud, [$0B, "       XANATRONICS      ", $0D]
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $01, $00]  ' Set character position - 3rd byte is char (0-23, or 0-17h) 5th byte is line (0-5)
  FOR cBrite = $08 TO $03
    SEROUT LCD, LcdBaud, [$1F, $28, $67, $50, cBrite, $00, $00, "="]   ' Set character brightness decrementing
  NEXT
  SEROUT LCD, LcdBaud, [$1F, $28, $67, $50, cBrite, $00, $00, "============"]
  FOR cBrite = $03 TO $08
    SEROUT LCD, LcdBaud, [$1F, $28, $67, $50, cBrite, $00, $00, "="]   ' Set character brightness incrementing
  NEXT
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $02, $00, "  Voice Controlled and"]
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $03, $00, "    Speech Responsive"]
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $04, $00, " Home Automation System"]
  SEROUT LCD, LcdBaud, [$1F, $24, $00, $00, $05, $00, "  V 2.0, February 2014"]
RETURN


' -----[ End of File ]----------------------------------------------------

Comments

  • wcumminswcummins Posts: 12
    edited 2014-02-13 14:23
    xanatos, I just received one of these VFD's and can't wait to try out your code. Thanks!

    Wayne
  • xanatosxanatos Posts: 1,120
    edited 2014-02-13 14:44
    Happy to be of service!

    Just remember to solder J1 (top center of display board - SEE DATASHEET!) to make it 9600 baud. Load the code and run it. You'll see the boot screen for my home automation screen... But look through the code line by line and you'll see I've commented everything. The datasheet has a chart of how the codes control the display, and once you line up a few of mine to that chart, you'll get the picture pretty quick.

    Really liking the display.

    Also got an offer from Noritake today for a free 16 x 144 serial dot matrix display! So I've put my dibs in for one, and when I get it, I'll follow up on here with a similar BS2 coding example.

    Have fun!

    Dave
  • wcumminswcummins Posts: 12
    edited 2014-02-14 06:12
    Dave, I'll be sure to solder the jumper. Thanks for the foot notes. Yea, the 16x144 display looks good. They must have had only a dozen to sample out. Today they are "Out of Stock."

    Wayne
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-14 11:28
    Thanks for the code, if they ever will get cheap, I'll try one.

    But currently they are very expensive. For lower price, I can get 3.5' LCD from ebay+Maxim OSD chip and have much more featured display than this one.
  • xanatosxanatos Posts: 1,120
    edited 2014-02-14 14:06
    CuriousOne wrote: »
    Thanks for the code, if they ever will get cheap, I'll try one.

    But currently they are very expensive. For lower price, I can get 3.5' LCD from ebay+Maxim OSD chip and have much more featured display than this one.

    Hi Curious,

    You may have been seeing prices through distributors? Not sure - I paid $34.00 for the 24 x 6, which I really don't think is all that bad. But you have to order from Noritake-vfd.com direct - apparently there is about a 40% markup to distributors, according to the local Noritake rep.

    For comparison, the 4 x 20 LCDs I use frequently I get from Newhaven Display, and they're around $25.00.

    What OSD chip are you using - I'm actually interested in doing some graphic LCD work, looking for a good entry point...

    Dave
  • RDL2004RDL2004 Posts: 2,554
    edited 2014-02-14 17:42
    For comparison, the 4 x 20 LCDs I use frequently I get from Newhaven Display, and they're around $25.00.

    If you pay less than this, such as off eBay (China), you will get garbage - slow updates, ghosting, poor contrast, etc.

    Newhaven, Optrex, Microtips, Noritake, and other reputable brands make good displays.

    Thanks for the code, I think I'll buy one of those VFDs, I've always like the way they look.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-15 00:26
    Well, it looks like we're living in the totally different worlds.

    $34 for VFD display?

    OMG

    $25 for 20x4 LCD?

    OMG X 2.

    I' buy from ebay chinese 20x4 LCD's for around $7, and they have everything OK, including contrast, refresh rate and so on. If interested, can share a link.

    Regarding the OSD, I'm using MAX7456 chip: http://www.maximintegrated.com/landing/index.mvp?lpk=198&CMP=4265

    The basic stamp code is available here, and if you need, I've designed a breakout board for that chip, so it fits into standard DIP24 socket.

    This chip, bundled with something like this: http://www.ebay.com/itm/3-5-Digital-TFT-LCD-Screen-Rear-View-Monitor-For-Car-Reverse-Camera-DVD-VCD-/161052693327?pt=US_Rear_View_Monitors_Cams_Kits&hash=item257f7d134f
    provides much more flexibility than any graphic or character LCD for basic stamp; It has all user definable charset stored in eeprom. The display is "gapless", so you can draw graphical elements and you have choice of 3 colors, white, black and "transparent".
  • xanatosxanatos Posts: 1,120
    edited 2014-02-15 07:34
    Hi Curious,

    Are those SERIAL displays?

    For $7 I'll order one and test it out, but your statement about different worlds may hold true for a very serious reason on my part - a lot of my products are used in the petroleum distribution industry, and I can't afford to have 30 displays in the field, and six months later, have those displays start croaking on me. So my thinking goes: Save $27, wait six months, spend $140.00 to service a bad display.

    So yes, do field the link, and I will check. I'll probably hook the display up and have it hanging out of my window for a few months, and if it's still working, I may consider looking more closely at it :)

    Dave
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-02-15 10:28
    Dave, Did you try it at the default baud rate of 38400? The Stamp, even the original BS2, has no problem sending at that rate. When the original Stamp uses baudmode $6, it will transmit at 38461 bits per second, which is only a 0.16% error. The BS2px can send at 38400 easily.

    There is all the buzz about the Stamps not working well at 9600 and above, but that mostly relates to receiving data, not to sending. The Stamp would have trouble only with the Status Information Read command. Even at high baud rates, the Stamp can work fine if the pacing of incoming data is permissive.

    Those VFD displays look good, and thanks for the demo code. I've been using the Newhaven I2C serial chip-on-glass LCD displays. Their big advantage for battery powered systems is 1mA current drain, 45mA with backlight on.

    I too value reliability of the supply chain and support over cost. Time to develop the short-run systems for customers adds up much faster that the cost of the modules.
  • xanatosxanatos Posts: 1,120
    edited 2014-02-15 10:54
    Hi Tracy,

    Actually I didn't try at the default rate - never even occurred to me to try it! I will with the next one, although 9600 is usually fine for what I am displaying... but if I don't have to solder a jumper, that saves me a step. Why do something unnecessary? :)

    I'll have a look at those I2C CoG displays, though I do very little battery powered stuff at the moment. I do know the 4x20 with backlight on uses somewhere around 200mA if I recall correctly!

    And yes - compared to the final system cost... $34 vs $7 is not even entering the picture! If I was mass producing thousands, though (wishing), then the difference could add up to someone's yearly salary. Let's hope I can get to that point! LOL

    Dave
  • CuriousOneCuriousOne Posts: 931
    edited 2014-02-16 01:54
    Here they are:

    http://www.ebay.com/itm/LCD-2004-20x4-black-on-yellpw-backlight-/261121602730?pt=LH_DefaultDomain_0&hash=item3ccc0f74aa

    Sure, I haven't did a mil-spec tests on them, but one of them installed in my wifes car for about 6 months and going just fine.
  • xanatosxanatos Posts: 1,120
    edited 2014-02-16 06:42
    CuriousOne wrote: »
    Here they are:

    http://www.ebay.com/itm/LCD-2004-20x4-black-on-yellpw-backlight-/261121602730?pt=LH_DefaultDomain_0&hash=item3ccc0f74aa

    Sure, I haven't did a mil-spec tests on them, but one of them installed in my wifes car for about 6 months and going just fine.

    That links to a Parallel display, not a serial display. My application for this display doesn't have room for a fat ribbon, or a pair of 595s to do the P>S work... did you have a serial display from this guy as well?
Sign In or Register to comment.