From 6c72574c1672c7b9cd8af416548e822bbef16889 Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 3 May 2009 23:34:16 +0000 Subject: [PATCH] Working! Had to insert an extra "enable" phase in VFD::sendNibble() git-svn-id: svn://anubis/misc/parport-2x20vfd@114 bd8a9e45-a331-0410-811e-c64571078777 --- VFD.cc | 5 +++++ VFD.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VFD.cc b/VFD.cc index b31355c..4dafd2d 100644 --- a/VFD.cc +++ b/VFD.cc @@ -89,6 +89,11 @@ void VFD::setPPLines(unsigned char bits) void VFD::sendNibble(unsigned char rs, unsigned char dat) { + setPPLines( (rs << PP_OFFSET_RS) + | (E_ENABLE << PP_OFFSET_E) + | (RW_WRITE << PP_OFFSET_RW) + | ((dat & 0xF) << PP_OFFSET_DATA) ); + usleep(1); setPPLines( (rs << PP_OFFSET_RS) | (E_DISABLE << PP_OFFSET_E) | (RW_WRITE << PP_OFFSET_RW) diff --git a/VFD.h b/VFD.h index 172a63f..2a0211d 100644 --- a/VFD.h +++ b/VFD.h @@ -71,7 +71,7 @@ class VFD static const unsigned char PP_OFFSET_RW = 1; static const unsigned char PP_OFFSET_E = 2; static const unsigned char PP_OFFSET_DATA = 3; - static const int INIT_DELAY = 2400; + static const int INIT_DELAY = 10000; void sendByte(unsigned char rs, unsigned char dat); void sendNibble(unsigned char rs, unsigned char dat);