PDA

View Full Version : shared data lines for LCD and LED'S?



nomad
- 7th February 2009, 08:27
I'd like to multiplex a 3digit 7seg led display and lcd data lines together.

I need 8 i/o for the led segments and decimal point, I'd like to use the same 8 i/o as the LCD data lines.

figuring the LCD wont act on the data until the EN pin is toggled, and the
LED displays wont show anything until the corresponding digit lines are lowered. (common cathode)

using an 877a, lcd/led data PortD, lcd rs&en on portc (4&5?) and the 7seg leds on portE(0-2). I figure I can use lcdout in pbp to send data to the lcd, and use a timer interupt for an asm led refresh..
neither would be in use at the same time? (I could even disable interrupts during LCD writes if needed, shouldn't blank the digit displays too long, and re-enable them after the lcd write)

anyone see a problem with my logic or doing this?

I was going to try and do assembly for the led's but as I know zilch in assembly, what I thought would be fairly simple, (in asm move digit data variable from pbp to portd and lower corresponding digit portE pin), um, isn't. lol so would probably use DT's instant interupts and do that in PBP as well.

it seems too logical, I must be missing something as I cant find information on it being done anywhere.

Jerson
- 7th February 2009, 12:18
Your thought processes seem to be right. I could suggest that you write to the LCD within the interrupt during the interdigit blanking period. Doing the LCDout outside the interrupt may give you wierd results when there is a clash between the LCDout code and the LED code. Assuming you disable interrupts for an LCDout, there may be a visible flicker in the LED which may be bearable or even irritating depending on the severity.

To write to the LCD inside the interrupt, you could signal the write after preparing a message. The interrupt code would then handle the write and you will not see a perceptible flicker.

This technique is usually used in small microcontrollers to multiplex 7segment LEDs with upto 8 keys.

jderson
- 8th February 2009, 16:54
Have you looked at 16F914?

nomad
- 11th February 2009, 04:49
Thanks, I just wanted to see if there was something obvious I was missing.

The lcd is one of the standard hd4470? parallel 2 line types, so I don't think the 16f914 is going to help me there, funny you mention it though, as I just recieved some 917's and 946's (same family)

Thanks again for the input.

nomad
- 14th February 2009, 04:37
lol, now that I asked I found in microchips App note AN234, (Hardware Techniques for PICmicro Microcontrollers)... there's a section about sharing LCD data lines for other i/o.

day late dollar short? :-) time to at least browse all the app notes.. some darn good stuff in there..