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
This commit is contained in:
josh 2009-05-03 23:34:16 +00:00
parent c0c55edfec
commit 6c72574c16
2 changed files with 6 additions and 1 deletions

5
VFD.cc
View File

@ -89,6 +89,11 @@ void VFD::setPPLines(unsigned char bits)
void VFD::sendNibble(unsigned char rs, unsigned char dat) 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) setPPLines( (rs << PP_OFFSET_RS)
| (E_DISABLE << PP_OFFSET_E) | (E_DISABLE << PP_OFFSET_E)
| (RW_WRITE << PP_OFFSET_RW) | (RW_WRITE << PP_OFFSET_RW)

2
VFD.h
View File

@ -71,7 +71,7 @@ class VFD
static const unsigned char PP_OFFSET_RW = 1; static const unsigned char PP_OFFSET_RW = 1;
static const unsigned char PP_OFFSET_E = 2; static const unsigned char PP_OFFSET_E = 2;
static const unsigned char PP_OFFSET_DATA = 3; 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 sendByte(unsigned char rs, unsigned char dat);
void sendNibble(unsigned char rs, unsigned char dat); void sendNibble(unsigned char rs, unsigned char dat);