-
Code snippets
08/01/2014 at 09:23 • 1 commentSo a few people have been asking about getting these working. I can tell you it was a nightmare as they DON'T follow the datasheet for the normal Noritake display.
They come with custom firmware to make them emulate the older controllers used on the Bell Fruit machines.
One problem is that I think they use inverted data/clock/reset etc lines compared to the datasheet specs. You will NEVER get any response if you are accidentally holding it in reset all the time :)
Here are the sendbyte and reset routines I used,
void sendbyte(uint8_t d_chr)
{
unsigned char bit_cnt;
for(bit_cnt=0; bit_cnt<8; bit_cnt++)
{
if(d_chr & 0x80) digitalWrite(VFD_Data,HIGH);
else digitalWrite(VFD_Data,LOW);
d_chr <<= 1;
digitalWrite(VFD_Clock,LOW);
digitalWrite(VFD_Clock,HIGH);
}
}
void Reset_VFD(void)
{
digitalWrite ( VFD_Reset, HIGH );
delay(10);
digitalWrite ( VFD_Clock, HIGH);
digitalWrite ( VFD_Reset, LOW );
delay(50);
}
Here are the commands I have worked out so far, these will enable almost full control of the screen. You first have to enable extended commands, then turn on the extra font. After this user defined chars and full graphics mode should work but I haven't decoded how to do these yet.
#define REVERSE_SCROLL 0xa3
#define FORWARDS_SCROLL 0xa2
#define REVERSE_NOSCROLL 0xa1
#define FORWARDS_NOSCROLL 0xa0
#define CLEAR_SCREEN 0xb1 // b3
#define FLASH_SCREEN 0xd1 // contents stay flashing new chars dont
#define FLASH_OFF 0xd2
#define FLASH_LASTCHAR 0xd8 // make last char sent flash
#define SCREEN_OFF 0x80 // Doesn't clear contents
#define SCREEN_ON 0x81 // contents re-display
#define BRIGHTNESS 0x84 // followed by brightness byte (0==full 7=lowest) needs extended commands
#define ENABLE_EXTENDED 0x85 // turn on extra commands
#define ENABLE_LOWERCASE 0xbc // turn on extended font
#define USER_DEFINED_SUMMIT 0xa8 // (for making user defined char)
#define SCROLL_FROM_0 0xe0
#define SCROLL_FROM_1 0xe1
#define SCROLL_FROM_2 0xe2
#define SCROLL_FROM_3 0xe3
#define SCROLL_FROM_4 0xe4
#define SCROLL_FROM_5 0xe5
#define SCROLL_FROM_6 0xe6
#define SCROLL_FROM_7 0xe7
#define SCROLL_FROM_8 0xe8
#define SCROLL_FROM_9 0xe9
#define SCROLL_FROM_10 0xea
#define SCROLL_FROM_11 0xeb
#define SCROLL_FROM_12 0xec
#define SCROLL_FROM_13 0xed
#define SCROLL_FROM_14 0xee
#define SCROLL_FROM_15 0xef
#define POS_1 0x90
#define POS_2 0x91
#define POS_3 0x92
#define POS_4 0x93
#define POS_5 0x94
#define POS_6 0x95
#define POS_7 0x96
#define POS_8 0x97
#define POS_9 0x98
#define POS_10 0x99
#define POS_11 0x9a
#define POS_12 0x9b
#define POS_13 0x9c
#define POS_14 0x9d
#define POS_15 0x9e
#define POS_16 0x9f
-
Firmware improvements
07/30/2014 at 10:53 • 0 commentsSo I have spent quite a bit of time working on the firmware.
After linking the BT Audio module via serial to the Spark Core I put in the ability to control it via SNMP, this is not the most convenient method of skipping a song however.
Using the Spark Core API I made a web page that calls routines in the core, this lets me send play/skip and volume controls etc via the web, much easier.
I also added a "sleep" timer mode, I can activate a timer with 15,30,45 and 60 minute intervals that will issue the "stop" and "disconnect" commands to the BT Audio module at the end. This means I can put on a LONG playlist or an internet radio as the source and have it stop after an hour (when I am asleep) rather than keep playing all night.
The next stage is an "Alarm" that activates the BT link and plays a song at a set time to wake me up. This sadly requires the song is pre-queued on the phone because I can't control the track that is played over the BT audio link.
-
QI Wireless Charger
07/30/2014 at 10:49 • 0 commentsafter "completing" The clock I decided that I wanted it to also have a wireless charger. I ordered a QI module (unboxed board and coil only) to install.
The 5v dc2dc provides enough current to run the clock and charger so I split the internal 5v out to the QI module as well as the clock, this prevents needing multiple inputs or a second 5v regulator off the 12v input.
The charge coil was glued to the lid of the box on the inside and aligned so that my phone would sit neatly on top of the clock, after drying I checked alignment and reassembled the box.
DANGER! It turns out that the QI charger generates a LOT of heat. The phone gets hot but also the heat builds up inside the clock. I didn't provide vents or airflow because I used the box as a sealed speaker cavity. This is a mistake.
When charging the whole thing gets too hot inside and causes problems, not the least of which being the BT audio module "crashing" and needing a power cycle to reset.
For now I am not using the QI charger but the solution is to somehow cool the components while not breaking the "seal" for the speaker. Maybe some kind of heat pipe to a heat sink on the back?
-
Finishing the box
07/30/2014 at 10:43 • 0 commentsAfter the whole thing is assembled and dried I applied red mahogany wood stain. This turns out to be a mistake in ordering.
The glue that soaks into the wood prevents the wood stain applying evenly. My advice is to apply wood stain to the wooden parts before fixing the box together in future. The 3mm Plywood is also quite good at soaking up the stain so a second coat after drying really gives it a great look.
I think a darker stain may be nicer on future boxes.
-
Laser cut Box
07/30/2014 at 10:40 • 0 commentsThe box for the clock was designed with Inkscape and uploaded to Razorlab.co.uk. The finished parts posted back it was simply a matter of gluing them together.
Unlike a lot of laser cut boxes I didn't use interlocking tabs as I don't like the look they give the finished box. Normal wood glue on the edges forms a good enough bond to hold the whole thing together.