Well I just got a 2.5digit 7 Segment LCD display running with a 16F917. It was a little tricky at first as I could find few examples on the net for a Static type display & the PIC16F917 LCD driver.
But finally got the hang of it. Easy as 123 once you understand it. Nice high contrast reflective super low power LCD; teriffic for a thermostat as it creates almost no heat and super low current draw.
The 16F917 does all the work driving the display, it even can run it during sleep. Here's the code to display "188" on the display. I'll post the schematic soon.
It's a Lumex LCD-S2X1C50TR less than $2 each. 3V to 5V operating. https://www.lumex.com/product.aspx?id=462
Thanks for the bump. Now there is something useful for the 16f917 debugger board laying around (Digikey had them for $5 a while back, clearing the way for the 16f887 board). Those bare glass displays are really cheap. What would be cool is one of those with the battery indicator, voltage, etc.
Admit to just glossing over the datasheet. Were the problems encountered with getting the voltage bias, setting up particular registers, or ?
I was under the impression that I didn't need VLCD (externally) enabled since its 5V glass and they refer to it as VDD so I assumed it was connected internally (another term might have been nice). It was tough to find any info for Static (one COM) glass.
The app notes provided the key, although the midrange LCD reference is WAY off for the 16F917.
The 16F917 double duties the USART & MSSP pins. I was going to use an SPI or I2C temperature sensor but think I'll go with an LM34 or LM35 and a 2.5V precision reference instead.
I've got the prototype running with a 32768Hz crystal and a supercap 1F for power failure clock backup. That works quite well. Another fun part is a two coil latching relay to keep the current consumption and internal heating down to a minimum.
Too bad about the double duty pins, bound to be some tradoffs somewhere. The I2C DS1721 is nice because of the Tout(Thermostat) pin for controlling whatever your trying to heat/cool with. What surprises me about the lm35, or its offshoots, is the price ranging from around $1 to over $5. One wire temp sensor would be less parts, but probably more on cost.
Need to google on the 16f917, to see if that would work with a GLCD or not.
The 16f917 lcd mode is embarrasingly easy to use, the datasheet has 24 pages but I had to read it a few times before I understood it.
Once its setup properly it's completely automatic, you simply set bits in the LCDDATAx registers to turn pixels on and off.
The static displays are the highest contrast with wide viewing angles but require the most pins to use.
The large 1F supercap is there to test the simple power backup system. Runs the PIC, tmr1 32KHz & display for about 2.5hrs The PIC LCD driver can be programmed to run the display in sleep.
The display is slightly higher contrast than in the photo (very black segments)
The prototype boards are made locally by LAB-EASY (site down) he makes scads of different types and they're very thin so you can cut them with sissors.
The 917 can drive some pretty fancy displays, the Lumex LCD-S301C31TR has 3digits plus dp. It'll work but needs lots of I/O as it's a static display.
1 common + number of segments 23 + VLCD power 1 = 25 pins...
**broken link removed**
A muxed display will also work but the higher the mux (up to 4) the lower the contrast (you can use the B waveform to improve the contrast but you can only write to the display at specific intervals ie IRQ)
It's harder to find the 1/3duty displays
Mouser page 67 has lots of LCD displays the one I've used in Cricket is the first one on the page. All those displays are the static type though (seems that's all Lumex makes) https://www.mouser.com/catalog/631/67.pdf
I'm adding a [SIZE=-1]Humirel HS 1101 Humidity Sensor to the design today (with the 555 in astable mode)
On a sidenote the LM35 / LM34 & TL431 combo work like a charm.
The conversion is ANRESL * 4.096
PS Mike I'd be happy to include a couple of lab-easy boards next time I send you off a sample board.
[/SIZE]
How are you measuring temperature? Are you using the 0.0v to 1.5v (2°..150°) LM35 configuration with the TL431 configured as a 2.5v reference or perhaps as a 1.5v reference?
The 2.5V reference is hooked up to RA3 (VREF+) and the sensor is directly on RA0.
So ADRES = RA0/(2.5V/1024)
23c would be 0.23/0.00244140625 = 94 (the A/D throws away the remainder)
To convert to decimal multiply * 4.096 or in integer math ADRES*125/512
More precision can be gained by using the bits left over. It works like a charm.
Works fine upto 120F too, (16bit integer math)
Now the HS1101 I'm trying something new by using the comparators and internal vref+. Much like the BASIC Stamp reads a cap.
Here's the almost finished schematic. The power supply and power fail caps are missing. Any ideas on the last two I/O pins? (I'm keeping one for power loss detection)
It's very low power design (with the exception of the RS485) could be adapted to battery operation.
I'm thinking of a 1wire / iButton port, Dallas Semi even make an iButton designed to watch concrete dry.
Edit: A 3xAA (4.5V Alkaline) battery power supply as the battery level drops you can measure it by switching RA3 to analog (2.5v ref) as the A/D value will increase as VDD drops. Also 5V switch mode wall warts are cheap nowadays and would work very well as the main power source. A pair of diodes would act as the power switchover, the 3xAA should last for years as it's easy to put the Nanowatt PIC to sleep and wake it up every 4 seconds to update the RTCC. **broken link removed**
As you now have a very nice (and clever) way to measure Vdd could you now reconsider using the comparator to measure the capacitance of the humidity sensor?
With a comparator set up as an inverting amp with a feedback resistor and sensor to ground. You could activate it with the output polarity (or output enable) bit and gate timer1 from the comparator. With the amount of program space you could store lookup tables to eliminate any complex calculations.
Hi Mike, the PIC internal comparator method I tried did work to some degree. But 8Mhz would only give me a clock count of less than 50 cycles between discharge & threshold.
The TLC555 is right out of the HS1101 datasheet, I've added the gating by controlling the reset line on the 555. Idea is I'll clear TMR0 and let it collect for 2 seconds via TMR1 interrupt service routine.
Other small revisions are a 4th pushbutton has been added (mode). I've left RB5 & RA2 available for expansion (thermistor, another LM34 or LM35) etc.
I'm thinking of ditching the LM35 in favor of an LM34 and doing the conversion to C in software as the LM34 will measure below 0C. Of course choice of an LM35 or LM34 is up to the builder.