Let me preface this post with the statement that the code found here is written with the assumption of a modified display (larger mcu and higher speed crystal). It also uses an LM34 Temperature IC placed where the DS18B20 would go.
Let me continue with that modification. As you know if you already have one of these boards, is that there are provisions for several extra components to be added. One such component is a Dallas Semiconductor DS18B20 Temperature sensor IC. This sensor looks like a transistor, uses the Dallas One Wire protocol, and has 3 pins VCC, Data, and GND.
I then looked at the schematic and noticed that the data output for the DS18B20 went to one of the ADC pins on the microcontroller (Notice the DQ line is ADC2 on the MEGA8).
This got me thinking… since I had some LM34 Temperature IC’s handy could I substitute that for the DS18B20? Again back to the schematic, there was only one thing that would be of issue. That would be the resistor that acts as a pullup for the data line of the DS18B20.
Once I removed the LM34 would be wired correctly. So I located that resistor on the board (which was a 10K instead of the 5.1K the schematic shows) and removed it.
I then installed the LM34 and it works perfectly.
That’s all the hardware changes I’ve made so far. As for coding this, a while back I had purchased some Sure Electronics 16×24 displays and had sourced some libraries for driving the HTC1632C on them. I found one that was pretty stripped down and went to work.
The job I had before me was this. I wanted to be able to use the routines I had written for my other LED Array projects. This meant whatever driver library I came up with, I had to be able to manipulate the display as an x/y grid in a memory array that would be compatible with my current functions. I had to be able to read the ADC value and interpret that to characters on the display. I wanted to use my current 5×8 font file.
You probably don’t care much about the how I went about all this, but suffice it to say, most of it was pretty simple except one part. That was coming up with the formula for determining what memory location in the HT1632C controller the data needed stored in. I spent hours on that one with many diagrams but finally it all came together.
This is the result so far.
As you can see, the special effects all seem to work well.
There you have it. One thing, this source as compiled will not fit in the mega8 onboard a stock display. You may be able to modify it by eliminating some of the functions to shrink it down enough to fit, but I haven’t tried that.