In order to control DP501 HNV-07SS61 VFD in an effortless and efficient manner the following software driver has been implemented. The functionality is encapsulated in HT16512.cpp and HT16512.h files and designed for AVR processors. To drive communication interface the logic uses PinMode and DigitalWrite functions provided by Arduino low level library. Also new HT16512 class inherits Arduino’s Print class to simplify output to display even more. However, despite those Arduino’s dependencies the code might be easily ported to PIC or ARM architectures.
The driver’s logic is subdivided into several groups: initialisation and low-level methods, tests and visual effects, methods for direct access to HT16512 without intermediate buffer and methods for intermediate buffer operations.
1. Initialisation and low-level methods
|
1.1. HT16512 constructor Description Prototype Parameters Returns |
1.2. Reset method Description Prototype Parameters Returns |
|
1.3. DisplayOnCmd method Description Prototype Parameters Returns |
1.4. DisplayOff method Description Prototype Parameters Returns |
|
1.5. DisplayWriteCmd method Description Prototype Parameters Returns |
1.6. AddrSetCmd method Description Prototype Parameters Returns |
|
1.7. Command method Description Prototype Parameters Returns |
1.8. Data method Description Prototype Parameters Returns |
2. Tests and visual effects
Tests and visual effects are represented by methods with Test and Effect suffixes in method names. Each method has to be invoked more than once in order to be completed. Upon completion methods return FALSE. In order to perform all available tests one by one there is a testStep(void) method that might be invoked from user code by a timer routine. Current test is kept in _tstState variable that can be assigned to one of the following values:
NOT_STARTED, COLUMN_TEST, SEGMENT_TEST, DIMMING_TEST, GLOWING_TEST, CHARSET_TEST, CHARSET_TEST2, ROTOR_TEST, SLASH_EFFECT, SCROLL_EFFECT, COMPLETED
To run through all available tests subsequently, it is enough to invoke uint8_t HT16512::testStep() on a periodic basis and do it until the method returns COMPLETED result. Internally, this method invokes one by one the following tests:
uint8_t columnTest();
uint8_t segmentTest();
uint8_t dimmingTest();
uint8_t glowingTest();
uint8_t charsetTest();
uint8_t charsetTest2();
uint8_t rotorTest();
uint8_t slashEffect();
uint8_t scrollEffect();
3. Methods for direct access to HT16512 without intermediate buffer
|
3.1. Write byte method Description Prototype Parameters Returns |
3.1. Write byte array method Description Prototype Parameters Returns |
4. Methods for intermediate buffer operations
The is no way to read data from display memory and there are situations when it would be extremely good to have that feature – for example, to read and modify the content that is currently being displayed. Introduction of an intermediate buffer allows us to have this feature and it makes possible to implement ‘blinking’ (or ‘flashing’) functionality.
|
4.1. Write_f byte method Description Prototype Parameters Returns |
4.2. Write_f byte array method Description Prototype Parameters Returns |
|
4.3. Print_f_p method Description Prototype Parameters Returns |
4.4. ClearFrame method Description Prototype Parameters Returns |
|
4.5. FlipFrame method Description Prototype Parameters Returns |
4.6. SetFlashAttr method Description Prototype Parameters Returns |
|
4.7. GetFlashAttr method Description Prototype Parameters Returns |
4.8. FlipFlashState method Description Prototype Parameters Returns |
The code below demonstrates how to initialise our VFD driver:
#include <avr/interrupt.h>
#include <util/delay.h>
#include "wiring.h"
#include "HT16512.h"
#define VFD_CS_PIN 15 //PD7
#define VFD_SCLK_PIN 14 //PD6
#define VFD_DATA_PIN 13 //PD5
#define STANDBY_PIN 12 //PD4
HT16512 vfd(VFD_CS_PIN, VFD_SCLK_PIN, VFD_DATA_PIN); //VFD display
int main(void)
{
pinMode(STANDBY_PIN, OUTPUT);
digitalWrite(STANDBY_PIN, HIGH);
//Enable VFD power supply
digitalWrite(STANDBY_PIN, LOW);
_delay_ms(100);
digitalWrite(STANDBY_PIN, HIGH);
//Initialise VFD tube
vfd.reset();
vfd.addrSetCmd(0);
vfd.clearFrame();
vfd.flipFrame();
sei();
while (1)
{
vfd.testStep()
_delay_ms(200);
}
}
As you can see, apart from VFD_CS_PIN, VFD_SCLK_PIN, VFD_DATA_PIN pins that are dedicated to VFD communication there is also STANDBY_PIN pin that simulates POWER button and instructs to switch +5V power rail on.
Let’s get down to the hardware part. In this demo we will be using Freeduino board. In total we would need 4 (four) signal wires to connect it to the VFD panel. Of course, we will also need GND and +5V power rail.
Here is the signal mapping table between Freeduino board and VFD panel (please also refer to DVP630 Schematic Diagram):
| Signal | Freduino connector-pin | VFD panel connector-pin |
|---|---|---|
| VFD_CS | J3-8 | RB502-2 |
| VFD_CLK | J3-7 | RB502-1 |
| VFD_DATA | J3-6 | RB502-3 |
| STANDBY | J3-5 | CN503-3 |
| +5V Standby | JP1-3 | RB501-5 |
| GND | JP1-4, 5 | RB502-4 |
And here is the result: Freeduino board running VFDDemo, connected to the VFD panel and power supply from broken Philips DVP 630:
| To download VFD Demo library and VFD example for AVR please feel free to hit this button: |
Stay tuned, the most interesting things are still yet to come!




