I sell on Tindie
Map
Grand Prize Winner
(Dec 2012)
Second Prize Winner
(July 2012)












TFT LCD Module Test Run

These days LCD modules become cheaper and cheaper and finally they are getting to the point when it is practical to use them for hobby projects without substantial budget increase. Not only projects significantly gain in functionality and usability but also in aesthetic matter. So we decided to test one of these LCDs and have a look what it can do and what it can’t. After some shopping around our choice has fallen to 3.2″ TFT LCD Module Display that was advertised on ebay. The list of claimed features was quite impressive: brand new display, 3.2 inches with resolution of 320×240 pixels, 262k colors, touch screen controller, SD card socket and 8/16 bit data bus – all this was for just US $13.98 with free shipping.

3.2" TFT LCD Module Display + Touch Panel PCB Adapter SD Card Socket 240X320

3.2″ TFT LCD Module Display + Touch Panel PCB Adapter SD Card Socket 240X320

The item was shipped next day after payment and was delivered a few days after – promising beginning. But there were a few little surprises upon close up visual inspection of the arrived item. First of all, it didn’t look like brand new. There were many scratches on the display’s protective film and evidences of manual re-soldering of one chip on the PCB’s bottom side. The seller didn’t want to damage his feedback history and quickly admitted that the item’s condition might be not immaculate. Then, to save his time and money, he basically suggested to refund half of the costs. Before we gave him a definitive answer we wanted to make sure if the display was functional at all. And immediately faced the second problem – it was absolutely unclear what type of display it was and where to find its 40-pin header pinouts. Normally, such displays have a pinout table on the bottom PCB’s layer, this one didn’t have anything. Also it would be very helpful to find schematic diagram to figure out what components have been used and how they interact with each other.

We searched the Internet for any similar display and found ITB02 module from Itead Studio which has been documented quite extensively and which came with circuit diagram, chip datasheets, detailed pictures and C libraries. Everything looked the same but the was… pinouts mismatch. ITB02 module had powerful software support of UTFT library designed by Henning Karslen but it order to use it we still needed to find pinout for our module.

LCD's pinouts mismatch

LCD’s pinout mismatch

Eventually a module with the same header pinout has been found, it was Connan TFT-3.2. Connan came with absolutely horrible schematic diagram, half-English / half-Chinese and messy library/demo code. As it turned out, in our possession was one of these modules with no silkscreen legend and SSD1289 LCD controller instead of HX8347. Further comparison with UTFT_Requirements.pdf from UTFT library revealed that pin designations were somewhat the same for both display types, the really difference was in the actual pin numbering – pins from 1 to 20 were numbered in the opposite order! As a result of the effort the following table below was created, defining relation between signal names and pin numbers for both display modules.

Signal name ITDB02 (orig.) Connan TFT – 3.2 Cmts
DB0 21 21
DB1 22 22
DB2 23 23
DB3 24 24
DB4 25 25
DB5 26 26
DB6 27 27
DB7 28 28
DB8 7 14
DB9 8 13
DB10 9 12
DB11 10 11
DB12 11 10
DB13 12 9
DB14 13 8
DB15 14 7
RS 4 17
WR 5 16
RD 6 15 Must be pulled high (3.3v)
CS 15 6
REST 17 4
LED-A 19 2 LED backlight, connect to +3.3v rail
GND 1 20
VCC 2 19 +5v or +3.3v (see descr. below)

UTFT library had a detailed description of how to connect LCD modules to a variety of Ardiinos and Chipkits. However, it had a few very important things missing.

First, it was not explicitly stated anywhere that these LCD modules ARE NOT 5v tolerant. Surely, it is possible to power them from 5v source but signal lines and LED backlight must not be exposed to levels greater than 3.3v. At the same time, many Arduinos work in 5v range so strictly speaking level converters should be used, for example, like ITDB02 Arduino Shield. All this, undoubtedly, makes the total project cost higher and dimensions bigger.

Secondly, it was not mentioned that LED backlight must be connected to +3.3v as well – without it the LCD’s usability becomes second to none as it is literary impossible to distinguish anything on its dark screen.

To make it even more confusing, our LCD contained 3.3v onboard regulator that obviously does not work if only +3.3v is applied to VCC pin – the voltage is just not high enough. There is a way to bypass the regulator if you power your LCD off 3.3v source – JP1 should be closed, making regulator’s input and output pins connected together.

Bypassing voltage regulator - JP1 must be shorted

Bypassing voltage regulator – JP1 must be shorted

Now when it is clear with the LCD itself, it is time to physically connect it to a microcontroller and put everything together. We decided to test the LCD in tandem with Freeduino that had ATMega328p oboard with UTFT library. There was one trick to be made in order to fit everything into 32 kB – uncomment everything but #define DISABLE_SSD1289 in memorysaver.h so it would look like code snippet below. That way the final code was much more compact due to elimination of redundant code.

#define DISABLE_HX8347A     1 // ITDB32
#define DISABLE_ILI9327	    1 // ITDB32WC/TFT01_32W
//#define DISABLE_SSD1289   1 // ITDB32S/TFT_32/GEEE32/INFINIT32
#define DISABLE_ILI9325C    1 // ITDB24
#define DISABLE_ILI9325D    1 // ITDB24D/ITDB24DWOT/ITDB28/TFT01_24_8/TFT01_24_16
#define DISABLE_HX8340B_8   1 // ITDB22 8bit mode/GEEE22
#define DISABLE_HX8340B_S   1 // ITDB22 Serial mode
#define DISABLE_HX8352A	    1 // ITDB32WD/TFT01_32WD
#define DISABLE_ST7735      1 // ITDB18SP
#define DISABLE_PCF8833     1 // LPH9135
#define DISABLE_S1D19122    1 // ITDB25H
#define DISABLE_SSD1963_480 1 // ITDB43
#define DISABLE_SSD1963_800 1 // ITDB50
#define DISABLE_S6D1121     1 // ITDB24E
#define DISABLE_ILI9320     1 // GEEE24/GEEE28

We combined UTFT_Demo_320x240 with UTFT_Textrotation_Demo and UTFT_ViewFont, the resulting sketch is available here: Combined_UTFT_Demo_320x240

The Connan TFT-3.2″ LCD in action is shown below. There are the following drawbacks that we managed to find, both related to changing the displaying content. First, the overall transfer speed is not very impressive despite the fact that 16-bit bus was used. It takes a few moments to fill LCD’s video memory from its beginning to an end. This solution is obviously not for displaying moving sprites or updating the full screen a few times per second. Second problem is that there are some artifacts during the moments when graphical information is being updated – visually it looks like multiple flickering white dots and lines, there is also a possibility that we have a faulty LCD in our possession.

Connan TFT-3.2" LCD in action

Connan TFT-3.2″ LCD in action

As a conclusion it would be worthwhile to highlight pros and cons of this LCD. Let’s start from the positive side:
1. Cheap and affordable,
2. Makes hobby projects to look professional and modern,
3. Great for rapid prototyping,
4. Excellent software support.

However, there are the following disadvantages:
1. A limited edition of ITDB02-3.2S with poorer quality and confusing pinouts,
2. Absence of documentation,
3. Intolerant to 5v signal levels,
4. No 1:1 compatibility with Arduino pins,
5. Too many signal wires with no significant advantage in performance if compare with LCD’s with serial interfaces,
6. Not very compact when used with Arduino and ITDB02 Arduino Shield,
7. Not cheap when used with ITDB02 Arduino Shield.

As a bottom line, a few dollars difference between Connan TFT-3.2 and ITDB02-3.2S and due to the abovementioned problems is not worth of buying Connan. And if the dimensions do make a difference then probably it would be better to use a TFT LCD panel like this one: 3.2 Inch TFT LCD Panel with Resolution 320 x 240.

And finally, as you probably noticed, we haven’t described all signals that are wired up to the LCD’s 40-pin header. There are datalines for interfacing with SD card and touch screen controller – they will be topics for our future articles.

VFD MagiClock Designing and Assembling Process

The whole process from initial design to final assembling is presented in this video. We aimed to make it alive, entertaining and easy to watch. Hope you will like it!

VFD MagiClock Final Assembling

Assembling process is very simple and it is shown on the pictures below.

Step 1

Step 2

Step 3

Step 4

Step 5

Step 6

VFD MagiClock Assembled Greets You

VFD MagicClock Assembled Greets You

VFD MagicClock Assembled Displays Day Of Week

VFD MagiClock Laser Cut Enclosure

To give any electronic project a neat look it is always very important to put it in an enclosure of appropriate sizes and shapes. Our VFD clock is not an exception and also needs a box. There are at least three ways to do so. First is to find something off-the-shelf. This is probably the cheapest and less time consuming solution. The problem is that there is literally no chances to find a box that does not look bulky and ugly and at the same time is capable of accommodating our long VFD panel and power supply along with some room for Freeduino board. Moreover, a box would still require some substantial efforts to secure boards and the panel inside by drilling many holes and in the end would look ugly anyway.

Second approach is to design a 3D model of enclosure in a CAD system then place an order with a manufacturing house and make it using 3D printing technology. This would probably give best results in terms of shape but would require rather advanced skills in 3D modelling and in addition would cost us a fortune.

A compromising solution would be the third approach – to make a box of acrylic panels that are laser cut by a manufacturing house like Ponoko making system. The design files could be prepared even in Corel Draw or Inkscape (although we would strongly recommend to use a 3D tool such as SketchUp and will explain later why). That way it would be possible to make a box as compact as possible, designing the required holes and making laser to do the hard job instead of us. It also will give us invaluable skills of making drawings for real things with opportunity to see and touch the end result. And all of this for a very reasonable price to pay for materials, machining time and shipping.

Now a few words why it is preferable to use 3D modelling tool instead of 2D one. The short answer is simple: while the overhead of complexity designing things in 3D is so low that it could be neglected there is a very powerful opportunity to fit all parts in 3D together, find and fix problems before the parts have been actually manufactured. By designing models of boards and VDF panel it is also possible to make sure that all of them fit inside our box without mutual interference.

VFD MagicClock Enclosure Design – Initial Dimensions

Designing PCB and VFD Panel models

Refining shapes, adding slots

Fitting Boards Inside The Enclosure

Making Holes In A Bulkhead

Making Holes In A Front Panel

Boards And VFD Panel Accomodated

Making Holes In A Top Cover

Disassembling And Getting Ready For Export To 2D

Panels Rotated And Placed On A Surface

Panel Faces Ready For Export

Assembled Enclosure X-Ray View

There are some tricks and tips that we followed designing this enclosure, they are described in detail at Ponoko’s article ‘How to make snug joints in Acrylic’. There is no sharp corners in design as they create weak points in the acrylic, that is why every corner has a small radii. Another trick is that slots are made slightly smaller than they would be in ideal world – to compensate the material that is burnt away by laser.

To export data in 2D Sketchup-svg-outline-plugin needs to be installed. Guys from Flights Of Ideas company have done a great job – now it is very easy to export paths from 3D SketchUp designs.

The final 2D drawing is ready to be submitted to Ponoko. An attentive reader has probably noticed that the number of parts is bigger than is needed. Yes, this is just to maximise the use of material – if you don’t need spare parts then just delete excessive elements before sending the design to the manufacturing house.

Exported To Ponoko Template

Enclosure Arrived From Ponoko

Downloads:

1. VFD MagiClock Enclosure Drawings Rev1.0

Second Prize in ‘RC Contest’ at Instructables.com

Our ‘Remotely Controlled Camera’ project grabbed second prize at Instructables.com. We’ve been given annual membership at Instructables, a T-shirt and a remotely controlled helicopter! Thanks to everyone who voted for us and special thanks to Instructables and contest sponsors! It was fun!

MagicTale Team and Instructables Theme

VFD Panel: Building Clock+Thermometer

Now when we have full control over VFD display, it is time to build something meaningful. How about remotely controlled clock with temperature sensor? Boring? Well, it will be unusual device: capable of working from virtually ANY type of remote control, with display activated by a motion sensor, with capability to log current temperature to an external USB host (i.e. PC, laptop or Android phone) and in custom made acrylic enclosure!

Freeduino

As a heart of the system Freeduino board would be probably an ideal choice: more than enough computational power, abundance of GPIOs, the amount of program memory is roughly just right for this type of project, compact dimensions (we really need it because the VFD panel and the power supply are rather bulky so we would aim to achieve to minimum possible size for our box). And finally, this board is really cheap.

The board comes as a kit so it is a good chance to practice in soldering yet all components are very easy to solder.

As an advantage, the board does not need any external programming equipment – it has serial-to-USB converter and could be connected directly to a PC and programmed by means of Arduino IDE. In fact, it is possible to program it even without Arduino IDE as such – everything that needs to be installed is AVRdude.

After programming procedure serial port might be user for debugging output or, in our case, for logging current temperature to external device.

Also we would need extra components, such as real time clock module, temperature sensor, PIR sensor and a basic speaker or buzzer, all of them are available at Sparkfun Electronics. Real time clock module would keep accurate track of the current time with a calendar up to year 2100, capable of surviving power outages and requiring just two signal wires for communication with main processor. Digital temperature sensor with 12-bit precision would require even less – just one signal line to control it. The job of PIR passive motion sensor would be to activate display when motion is detected so that after a predefined timeout the display goes to standby mode saving energy and VFD resource and making the device more interactive. The purpose of buzzer is to demonstrate that the microcontroller still has some computational power to generate primitive sound so the clock might be easily converted into alarm clock.

RTC Module Sparkfun (BOB-00099)

DS18B20 Sparkfun (SEN-00245)

Buzzer Sparkfun (COM-07950)

PIR Motion Sensor Sparkfun (SEN-08630)

We also would need a remote control to manipulate clock settings and the type of RC (whether it is NEC, SONY, RC5 or RC6 standard) really does not make any difference simply because we are going to support… all types! To say more, the initial set up of a remote control for use with our clock will be done by means of… a remote control! How? Read on and it will be explained for you later.

Time to connect modules together. Two pictures below show pinouts for signal and power lines on our Freeduino board.

Freeduino Schematic Diagram Pinout

Freeduino PCB Pinout

There are couple of tricks again. Firstly, the PIR sensor works stable from +12V and allows false alarms when the voltage is +5V (which is exactly our case). This is because it has voltage regulator 7805 and +5V is not enough for proper regulation. Bypassing the regulator (connecting +5V to its output leaving input unconnected) solves the issue.

Secondly, the standby mode on VFD panel is controlled by a chip IC581 that flips the state of its PCON output when it detects a pulse on its POWER input. It has been discovered that sometimes it may detect a false pulse induced by appliances located nearby. Besides, there is no way for our Freeduino to detect which mode (ON or STANDBY) is currently active. The solution is very simple – to unload R582 and therefore disconnect IC581 from controlling the standby line and instead connect Q581 via 1K resistor to our Freeduino board. So the ON/STANDBY mode will be controlled not by pulses but by levels.

VFD MagiClock PIR sensor bypassing voltage regulator

VFD MagiClock StandBy Wire Connection

Here is the signal mapping table between Freeduino board and the remaining components (please also refer to DVP630 Schematic Diagram):

Signal Freduino connector-pin Component-Connector-pin
VFD_CS J3-8 VFD panel-RB502-2
VFD_CLK J3-7 VFD panel-RB502-1
VFD_DATA J3-6 VFD panel-RB502-3
STANDBY J3-5 VFD panel-Q581-base, via 1kOhm; R582 must be unloaded
IR_RECV J3-3 VFD panel-RB502-5
+5V Standby JP1-3 VFD panel-RB501-5, RTC Module-5V Pin, DS18B20-VCC Pin, PIR Sensor-in bypass of voltage reg.
GND JP1-4, 5 VFD panel-RB502-4, Buzzer-‘-‘ Pin, RTC Module-GND Pin, DS18B20-GND Pin
SPEAKER J1-2 Buzzer-‘+’ Pin
PIR_SNSR J3-4 PIR Motion Sensor-ALARM (AL) Pin
TEMP_SNSR J2-3 DS18B20-Data pin
SCL J2-6 RTC Module-SCL pin
SDA J2-5 RTC Module-SDA pin

Fully assembled electronics is shown on the picture below (though the connector to RTC module is temporary disconnected and PIR sensor is not shown yet wires on the bottom on the picture lead to it).

VFD MagiClock Electronics Assembled

Electronics is ready but firmware is not programmed yet. Next step briefly tells how to do it. Download the firmware (following the link at the end of this post). To program the firmware connect Freduino board to PC using USB cable wait until a new virtual port is installed then just type the following in Windows Command Prompt (but before make sure that AVRdude is installed on your PC):


avrdude -p m328p -c avrisp -v -P comXX -b 57600 -U flash:w:VFD_MagiClock_Rev1.0_2012_09.29.hex

where comXX is your newly installed COM port name (i.e. COM10, COM15).

When the programming procedure is completed, our application starts and Freeduino activates VFD display straight away displaying greeting information and then awaiting for RC setup. If within a few seconds no commands from RC have been received, the device goes to its normal mode displaying periodically time, date, day of week and temperature.

Downloads:

1. VFD MagiClock binaries and source code for AVR Rev1.0

VFD Driver Demo

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
Constructs a new instance of HT16512 class and assigns three interface pins for communication. For more information about mapping between pins and pin numbers please refer to pins_arduino.cpp;

Prototype
Constructor HT16512(uint8_t cs, uint8_t sclk, uint8_t data);

Parameters
CS, SCLK and DATA pin numbers appropriately for physical communication with VFD;

Returns
None;

1.2. Reset method

Description
Sets three pins as outputs and their initial states, sets VFD driver mode (7 digits, 15 segments), switches display on with maximum brightness. Resets flashing attributes;

Prototype
void reset(void);

Parameters
None;

Returns
None;

1.3. DisplayOnCmd method

Description
Switches display on and sets display brightness;

Prototype
void displayOnCmd(uint8_t dimming);

Parameters
The 8-step dimmer value from 0 to 7 defines accordingly 1/16, 2/16, 4/16, 10/16, 11/16, 12/16, 13/16 and 14/16 pulse width. The 1/16 pulse width indicates minimum lightness. The 14/16 pulse width represents maximum lightness;

Returns
None;

1.4. DisplayOff method

Description
Switches display off;

Prototype
void displayOffCmd(void);

Parameters
None;

Returns
None;

1.5. DisplayWriteCmd method

Description
Writes data to display memory. The address might be set in advance by means of addrSetCmd(uint8_t addr) method;

Prototype
void displayWriteCmd(uint8_t addr_inc, uint8_t nodata);

Parameters
If addr_inc is set to true then HT16512 increments address after data has been written.
If nodata is set to false then CS line is set back to HIGH after command byte is sent to HT16512 meaning end of command transmission;

Returns
None;

1.6. AddrSetCmd method

Description
Sets the address of the display memory;

Prototype
void addrSetCmd(uint8_t addr);

Parameters
Addr has the value to be set to. If address 0x16H or higher is provided, data is ignored until a valid address is set;

Returns
None;

1.7. Command method

Description
Low level function for sending a command;

Prototype
void command(uint8_t value, uint8_t nodata);

Parameters
Value is a command to be sent, nodata set to true if there will be data bytes following the command;

Returns
None;

1.8. Data method

Description
Low level function for sending data;

Prototype
void data(uint8_t value, uint8_t init_cs, uint8_t finalise_cs);

Parameters
Value is a data byte to be sent,
init_cs should be set to true to pull CS line LOW before initiating data transmission (and normally this parameter is set to false because CS is already set to LOW before command byte transmission),
finalise_cs must be set to true only for the very last data byte in a single transmission;

Returns
None;

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
Outputs ASCII character to display memory using current address. The address should be set in advance by means of void HT16512::addrSetCmd(uint8_t addr). When address is set more than one character might be sent to display memory as address is automatically incremented by VFD driver. To display one character two bytes are used so the address is incremented twice per a character resulting maximum of 7 (seven) consecutive invocations of this method after which address must be set to 0 (zero) again. Not all characters from ASCII table could be displayed – please refer to const PROGMEM uint8_t FONT_PGM array;

Prototype
void write(uint8_t value);

Parameters
value – ASCII character to be displayed;

Returns
None;

3.1. Write byte array method

Description
Outputs raw byte array to display memory using the provided address start value. No need in setting address in advance as it will be overriden in this method. Unlike the previous void write(uint8_t value) method no conversion of ASCII code to VFD segment codes is performed;

Prototype
uint8_t HT16512::write(uint8_t* buffer, uint8_t dstIndex, uint8_t len);

Parameters
buffer points to an array of raw bytes to be displayed,
dstIndex defines address in display memory,
len is a number of bytes to be written;

Returns
Number of bytes written;

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
Outputs ASCII character to intermediate buffer. Similar to 3.1 Write byte method but uses intermediate buffer instead of direct access to display memory;

Prototype
void write_f(uint8_t value, uint8_t dstIndex, uint8_t dispColon);

Parameters
value – ASCII character to be sent to buffer,
dstIndex defines address in buffer,
dispColumn is set to TRUE if ‘:’ colon should be displayed as well (applicable only for digits 3 and 5, counting from left to right starting from 1);

Returns
None;

4.2. Write_f byte array method

Description
Outputs raw byte array to intermediate buffer. Similar to 3.2 Write byte array method but uses intermediate buffer instead of direct access to display memory;

Prototype
uint8_t write_f(uint8_t* buffer, uint8_t dstIndex, uint8_t len);

Parameters
buffer points to an array of raw bytes to be displayed,
dstIndex defines address in intermediate buffer,
len is a number of bytes to be written;

Returns
Number of bytes written;

4.3. Print_f_p method

Description
Outputs string located in program memory to intermediate buffer. Clears internal buffer and sets start address to 0 (zero) then uses internally 4.1. Write_f byte method in a loop;

Prototype
void print_f_p(const prog_char str[]);

Parameters
str char array stored in program memory;

Returns
None;

4.4. ClearFrame method

Description
Initialises intermediate buffer by filling it with zeroes;

Prototype
void clearFrame();

Parameters
None;

Returns
None;

4.5. FlipFrame method

Description
Sends the content of whole intermediate buffer to display memory;

Prototype
void flipFrame();

Parameters
None;

Returns
None;

4.6. SetFlashAttr method

Description
Sets one digit or whole row to blinking state;

Prototype
void setFlashAttr(uint8_t index, uint8_t value);

Parameters
index defined as zero or greater but less than VFD_DIGITS sets appropriate digit to blinking state. Otherwise all 7 (seven) digits will be blinking;

Returns
None;

4.7. GetFlashAttr method

Description
Gets blinking state of a particular digit or whole row;

Prototype
uint8_t HT16512::getFlashAttr(uint8_t index);

Parameters
index defined as zero or greater but less than VFD_DIGITS gets a blinking state of a digit. Otherwise blinking states for all digits will be given as a result;

Returns
TRUE if a digit is in blinking mode and FALSE otherwise. If as input argument a value equal to VFD_DIGITS or greater was used then the result indicates blinking states of all 7 (seven) digits in 0…6 bits;

4.8. FlipFlashState method

Description
Flips flash state of the display content. Should be periodically invoked by user code to visualise blinking. Note, than this method only changes the logical state of blinking, immediately after 4.5. FlipFrame method should be invoked;

Prototype
void flipFlashState();

Parameters
None;

Returns
None;

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.

Freeduino Schematic Pinout for VFDDemo

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:

Downloads:

1. Magictale VFD Demo lib and example for AVR Rev1.0

Stay tuned, the most interesting things are still yet to come!

A DVD Player Hack

Vacuum fluorescent displays (VFD) make any consumer device looking eye-catching, compelling and unusual. A VFD emits a very bright light with high contrast and can support display elements of various colors, some of them are capable of rendering not only seven-segment numerals but characters and even graphical information. VFDs are equally great for anything from professional devices to basic do-it-yourself things. Yet VFDs are rather expensive for small hobby projects and notorious for their non-trivial control as they require voltages higher than just TTL levels, necessity to drive grids in addition to segments or dots and therefore make presence of dedicated VFD controllers highly desirable just to simplify communication with microprocessors.

But what if all this infrastructure already existed, would it be that difficult to combine together something like Arduino controller and VFD? The answer is no, not at all! Most modern DVD players equipped with VFDs and when less reliable mechanical parts (DVD ROM drives) fail devices are simply thrown away. Instead, some electronics could still be reused to give your project a completely new look reducing costs at the same time and saving the environment. In addition to a VFD with controller onboard and a power supply which provides everything with all vital voltage levels there is a bonus – an IR receiver and buttons. VFD controller takes care of refreshing display, handling events from buttons and IR receiver encapsulating whole control into a serial interface and making integration with even primitive controllers very possible, giving in exchange fully functional remotely controlled system.

But enough theory, let’s have a look at a real example. We found a broken DVD player literally lying in the street. Quick test indicated that VFD board and power supply were functional. VFD was 16-segment and therefore capable of displaying not only digits but characters as well. After a few minutes of internet search model name was identified: Philips DVP 630.

Philips DVP630

Philips DVP-630 VFD PCB

Philips DVP-630 Power Supply

A few more minutes – and service manual with schematic diagrams was found as well. After opening up Philips DVP630_632_642 schematic diagram and looking at page 3 it becomes obvious that the player utilises DP501 HNV-07SS61 display from Samsung which is controlled by HT16512. Then downloading datasheet for HT16512 – it is a VFD driver with 11 segment output lines, 6 grid output lines, 5 segment/grid output lines 4 LED output ports, a control circuit, a display memory and a key scan circuit. Serial data inputs to the HT16512 through a three-serial interface – just what we need!

Returning back to the page 3 of the service manual, checking RB502 connector – there are V-CLK, V-CS, V-DATE to control VFD. Also we will need GND, IR (output from infrared receiver) and +5V. An attentive reader should notice that there is also +5V_STB at RB501 connector. It is 5V standby voltage that is always applied. +5V appears only after pressing either ‘StandBy’ TA501 button on DVD’s front panel or On/Off button on a remote control. The power supply is instructed to activate/deactivate +5V via PCON signal. But in order to wake up the player from a remote control only original RC must be used otherwise IC581 won’t recognise the command. We want to make our device working with ANY type of RC that is why our microcontroller must take responsibility of decoding RC commands and controlling PCON signal.

Philips DVP630 VFD PCB hacking points

Let’s have a closer look at the VFD and its driver. For an external device VFD is accessible through a serial interface as static RAM. The display has 7 digits (symbols) by 16 segments. Each symbol is defined by two bytes (16 bits), so in total 14 bytes are used. A symbol is encoded by a combination of bits, a bit set to ‘1’ makes a segment to glow. Most significant byte comes first, most significant bit also comes first. So, in order to display very first symbol on the display as ‘1’ the first byte of RAM should be set to value 0x20 and the second one – to value 0x6. In other worlds, we need to
set bits 13, 2, 1 to logical ‘1’ and in binary representation it looks as 0010000000000110b.

HNV-07SS61 HT16512 Segment to Bitmapping

Note, that colon is controlled with one single bit 5 and it is available for 3-th and 5-th digits only. Two vertical segments in the middle of digit are simultaneously driven by a single bit 9, there is no way to activate only one out of two segments.

In order to simplify output to the display a software driver has to be implemented. In the next article we will go through this process.

Instructables.com: Remote Control Challenge Finalists

Our project is among ‘Remote Control Challenge’ finalists at http://www.instructables.com/contest/rc2012!

Please visit the link and vote for a project you liked most!

Remote Control Challenge Contest 2012 - Finalists

Speccy2010 – Assembling, Testing, Having Fun

There are not so many people on Earth who haven’t heard anything about sir Clive Sinclair and his legendary ZX-Spectrum. His compact and affordable personal computer was just perfect not only for gaming but for educational activities, it found its place as a favorite gadget for millions boys and girls. This computer has shaped the way computer and game industries evolved and it is still remembered nowdays by grown up children especially by those who decided to link their own future with amazing wold of computers.

In 2010 a person calling himself SYD designed a fully functional clone of ZX-Spectrum 48/128 using modern electronic components that are currently available on the market. His Speccy was built upon FPGA Cyclone II, ARM processor and SDRAM making it relatively simple to replicate and at the same time very attractive as a great platform for experiments with those components. Not to mention that the source code is open and freely available for download and subsequent modification. Taking into account that the hardware part incorporates 8-bit color VGA, Composite and S-Video outputs for physical connection to either TV or monitor, 8-bit stereo output, SD card slot, two PS/2 ports for keyboard and mouse and two joystick ports – all this makes the platform a great starting point on the way to design your own game console.

We decided to buy a bare PCB and bunch of components and assemble it by ourselves. That is what we’ve got as a result:

All documentation is available at Google Project Hosting (unfortunately, in Russian only).