I'm looking for a 4 digit LCD or LED display to use with a PIC processor. Something easy to use that will latch 4 bit data from the processor to each of 4 (7 segment) digits.
Anybody know of a part number and supplier?
-Bill
I'm looking for a 4 digit LCD or LED display to use with a PIC processor. Something easy to use that will latch 4 bit data from the processor to each of 4 (7 segment) digits.
Anybody know of a part number and supplier?
-Bill
Check out these guys. For hobby use they're good.
If you're doing LED displays, you might consider simple 8 bit latches to drive all segments independently and do the conversion to 7 segment in software. Then you can do actual text along with numbers. See
I've done this with Motorola processors and its easy. I expect a PIC to be the same.
GG
Probably more than you need:
I've used an HDSP-253x series eight character LED alpha display. These latch 8-bit ASCII data from a PIC into each 5x7 cell.
You could use a CD4511 BCD to 7 segment latch decoder driver, you would need 4 of them and at least 6 I/O lines (assuming external demux) or the TIL311 display with latch $$
You might want to look at the schematic for Daisy on my website
It uses charlieplexing for the display
Bill
Better yet, for LED use shift registers (74HC164) which uses only 2 pins on your PIC to control any number of 7 segment LEDs. Or if you want to avoid the flicker while you load the registers use shift registers with an output latch (74HC595) which uses 3 pins on your PIC.
Converting numbers to the required "font" to write to the 7 segment display is simple. You can use the retlw instruction and computed goto to construct a look-up table. Since there are only 10 numbers (0-9 or
16 numbers for hex: 0-9,A-F) the look-up table will be only 10 instruction words in size. Because it's so simple and so small I personally believe that a hardware solution is not worth it. Writing it in C is far simpler:// This code supports hexadecimal characters: const unsigned char font[17] = { 0x7e, // 0 0x12, // 1 0xbc, // 2 0xb6, // 3 0xd2, // 4 0xe6, // 5 0xee, // 6 0x32, // 7 0xfe, // 8 0xf2, // 9 0xfa, // a 0xce, // b 0x6c, // c 0x9e, // d 0xec, // e 0xe8, // f 0 // blank };
To write out the number N to the 7 segment display simply:
displayLed(font[N]);
The code for serially writing out to the shift registers are also simple if you use the HC parts. For PICs up to 20MHz you wouldn't need any delay loops in your output routine and can write out at full speed since the shift registers will be able to cope very well (but check the datasheet to be sure). In C this can simply be:
void displayLed(unsigned char n) { int i; for (i=0, i>= 1; LED_CLOCK = 0; } }
Hi I just built a tachometer using 74LS367 latches to save me multiplexing 4 LEDS See the snippet from my code below. It worked fine.
Russell
PIC 16F628 Assembly Programme
;*************** TACHOMETER *************************
;;Code by R Verdon 28/1212/2005-17/1/2006 VERSION 9.2
;Final 17/1/2006
;;HARDWARE
; 4 x 7 segment common Anode displays used. Cathodes to +5V via 150 ohm
; 1 x 74ls373 octal latch used for each 7 seg LED
; Port A drives a latch for each Led's Cathodes
; Port B presents data to the latch for the cathode segments
; To latch data, put 7 seg data on PB1-7 and clock port A bit for the digit,
; latched on falling edge of the pulse at pin 11 of the selected 74LS367.
;;PA0 Anode for MSD ----|
;PA1 | ______
;PA2 | | |
;PA3 Anode for LSD | _a |
;PA4,5 NO CONNECTION | f/g_/b |
; |
74LS367 1(GND) e/__/c |; | d |
; | ______________|__ |
;INT ON PB0 | | _____ OE| | |
;PB1 a LED SEGMENT -| | --PA0 11|---- |E | | | |
;PB2 b | | | | | | |
;PB3 c |__________2|---- |D Q|---------|>-| seg a LSD LED--------|
;PB4 d | |____| |
;PB5 e | |
;PB6 f | 7 more of these | seg b, c,d etc
;PB7 g LED SEGMENT; per 74ls373
Your design seems to save no I/O, 4 digit select lines plus 7 segment lines plus you have to be careful not to draw too much current for the anodes from the PIC
the CD4511 would only require 8 lines (4 data , 4 latch) and be the same chip count plus you get the decoder.
Muxing a display is easy in a pic, 50hz or better will appear flicker free to most and is easy to do in software on a 16F628 (interrupt driven) you can also reduce pin counts see my Daisy schematic to see what Charlieplexing looks like
Bill
Is AVR ok? We are using an Atmega169 (with 25 segments LCD drivers) for an LED panel. The chip is designed for LCD, but we are using N-channel MOSFETs (2N7002) to boost the power. You can load data from serial or spi.
A simple shift register is even better (as I stated elsewhere in the thread). A 74HC595/74LS595 requires only 3 lines and be the same chip count and is a very easy to find common part. A 74HC164/74LS164 saves even more pins, using up only 2 lines. Around 12 PIC instructions are enough to replace a hardware decoder so in my opinion they are not worth it (besides, they are rarely able to display hexadecimal).
What's more, once you get the hang of shift registers you can use use the 74HC165/74LS165 to expand the number of input lines.
Yes, but I have to drive 8 digits and don't want to add 8 chips. I thought there might be a 7 segment LED digit with the latch/decoder built in, or a group of 4 with the same. That would make it easy.
I can't do it with multiplexing since the duty cycle would be 8 to 1 and the display wouldn't be very bright.
-Bill
If you're just worried about chip count why not just use 4 chips instead of 8 and get a duty cycle of 2 to 1? Or 2 chips to get a duty cycle of 4 to 1? I've implemented scrolling LED displays that have duty cycles of 64 to 1 (64 columns x 8 rows) that is bright enough to be seen in daylight with appropriate filtering.
A single chip solution will have more than 64 pins so it is going to be a big chip. Such chips tend to be smt. I don't know of any single chip solution that will drive 8 LEDs so going single chip probably requires an FPGA or PLD.
Or one PIC with 16 I/O pins for the LEDs and some interface for your use. Program it to do the decoding and refresh, and any other smart logic you want (blinking?) The R8C/13 MCU, for example, is $5 and can do all that, with a clocked or async serial interface. Or get a bigger chip and program a parallel interface.
Avago makes such things, but they're not cheap.
Why not? That's what everyone else does. Just boost the current (some) to compensate.
More things to try:
8x1 LCD:
Quite right, forgot the 595 was shift register. I prefer charlieplexing displays in software or if I'm starved for I/O the MAX6951
Also I hate using more ICs than I need, I'd upgrade to a larger PIC with enough I/O to do the job. The 595 would be an advantage if you don't want a display that needs refreshing (filming?), disadvantge is power consumption and only common anode displays.
Bill
---- Yes, that's a possibility. It would require 7 more transistors and resistors to drive the segment lines since the PIC won't drive more than 25mA. Probably need a minimum of 80mA. And with 7 segments on, the transistor controlling the common line would be running at 560mA. So, I need 8 medium power transistors rated around 1 amp.
-Bill
I was looking for that old TI chip, whose number I can't remember, which had a BCD to 7-segment decoder and the LED display on the same chip. Well, in the same package. ;-) I didn't find it yet, but I did stumble on this:
He uses a CPLD, and apparently CPLD outputs can drive LEDs. :-)
Good Luck! Rich
ULN2003. :-)
Good Luck! Rich
The TI chip is not cheap but its part number is TIL311
as for power consumption that why you mux a display or at least use HE RED displays like MAN6940
Bill
The TPIC6B595 is a monolithic, high-voltage, medium-current power 8-bit shift register designed for use in systems that require relatively high load power.
from TI
martin
Have something to add? Share your thoughts — no account required.
Ask the community — no account required