Bookmark this page:
Yahoo!
Windows Live
del.icio.us
digg
Netscape
|
|
Posted by Danny T on January 15, 2005, 6:50 pm
Please log in for more thread options I've (half-)built a "clock" using a cheap LCD display and a couple of PICs. Currently, it's very OTT with pics, since I don't have any shift registers or anything to control the 40 pins on the LCD, so I've got a PIC for each digit, 8 input pins, and 7 output pins (7 segments per digit). When the 8th input pin goes high, the other 7 are copied to the output. This way, 4 digits can be driven from one PIC with 11 output pins (7 for the segment, and one linked to each "active" input for each digit). What's the best (least components etc.) to do this in "the real world"? I was thinking of addressable shift registers or something to replace the PICs, but then it occured to me that it's also possible with a comparator... Wire all the segments together, and use a comparator so only when I "clock" the correct 7 comparators, would the outputs be carried across to the LCD. I'm not sure of the relative costs of shift registers/comparators - how would you do it? -- Danny | ||||
|
Posted by CBarn24050 on January 15, 2005, 7:17 pm
Please log in for more thread options >PIC for each digit, 8 input pins, and 7 output pins (7 segments per
>digit). Sounds like your driving your lcd with dc, it wont last long. >What's the best (least components etc.) to do this in "the real world"?
An lcd controller chip, find 1 to mach your display. | ||||
|
Posted by Danny T on January 15, 2005, 9:46 pm
Please log in for more thread options CBarn24050 wrote:
>>PIC for each digit, 8 input pins, and 7 output pins (7 segments per
>>digit). >
> Sounds like your driving your lcd with dc, it wont last long. Whoops? >>What's the best (least components etc.) to do this in "the real world"?
>
> An lcd controller chip, find 1 to mach your display. heh. I meant without using something like that - let's say I'd invented my own 13 segment display for a petrol gauge on my car or something! :-P -- Danny | ||||
|
Posted by Anthony Fremont on January 15, 2005, 8:44 pm
Please log in for more thread options
> Hi all,
the
> > I've (half-)built a "clock" using a cheap LCD display and a couple of > PICs. Currently, it's very OTT with pics, since I don't have any shift > registers or anything to control the 40 pins on the LCD, so I've got a > PIC for each digit, 8 input pins, and 7 output pins (7 segments per > digit). When the 8th input pin goes high, the other 7 are copied to > output. This way, 4 digits can be driven from one PIC with 11 output
each
> pins (7 for the segment, and one linked to each "active" input for > digit).
What kind of LCD do you have? You may need to be careful with how you drive the digits. > What's the best (least components etc.) to do this in "the real
world"?
> I was thinking of addressable shift registers or something to replace
> the PICs, but then it occured to me that it's also possible with a > comparator... Wire all the segments together, and use a comparator so > only when I "clock" the correct 7 comparators, would the outputs be > carried across to the LCD. I'm not sure of the relative costs of shift > registers/comparators - how would you do it? There's a bunch of ways this can be done, but yours wins the Rube Goldberg award. ;-) You should multiplex the digits from just one pic. You can use PORTB to connect to all the segments in parallel and then turn on the anode (or cathode whichever it is) from PORTA pins. You put the segments for the first digit on PORTB and then drive PORTA, 0 low (or high) to illuminate the first digit. You then turn off the PORTA,0 pin and put the data values for the second digit onto PORTB, then turn on PORTA, 1. Cycle thru PORTA, 2 and PORTA, 3 then back to PORTA, 0. If you setup say a timer interrupt to occur every 10mS or so, you can switch digits in the ISR and leave them till the next interrupt 10mS later. That would update the entire display every 40mS or 25 times per second. Your eyes will never know the difference and it will only need 11 i/o pins. You could also use a shift register(s) in order to use less i/o pins. | ||||
|
Posted by Danny T on January 15, 2005, 9:52 pm
Please log in for more thread options Anthony Fremont wrote:
> What kind of LCD do you have? You may need to be careful with how you
> drive the digits. 57-0160 from rapidelec.co.uk It seems to be available in a 4-pin option, but I ordered the "31/2" assuming it meant 21 pins on each side, but it only has 40 (no idea what the "4" flava is then!) CBarn24050 just suggested I shouldn't be driving it from DC - is this really a big problem? It seems to be working fine, my clock has two digits! Other two can wait till after tea - I've already wired about 60 pins together across 4 PICs... http://dantup.me.uk/tmp/wires.jpg > There's a bunch of ways this can be done, but yours wins the Rube
> Goldberg award. ;-) You should multiplex the digits from just one pic. > You can use PORTB to connect to all the segments in parallel and then > turn on the anode (or cathode whichever it is) from PORTA pins. You put > the segments for the first digit on PORTB and then drive PORTA, 0 low > (or high) to illuminate the first digit. You then turn off the PORTA,0 > pin and put the data values for the second digit onto PORTB, then turn > on PORTA, 1. Cycle thru PORTA, 2 and PORTA, 3 then back to PORTA, 0. > > If you setup say a timer interrupt to occur every 10mS or so, you can > switch digits in the ISR and leave them till the next interrupt 10mS > later. That would update the entire display every 40mS or 25 times per > second. Your eyes will never know the difference and it will only need > 11 i/o pins. This sounds like a fantastic idea *but* of the 40 pins on my display, the only ones marked on the datasheet are one for every segment/dp on the screen, plus two "com" (one on each side). I assumed it meant "common" and grounded it, while connecting the other pins to pic outputs, and they drive fine. I assume your method isn't useful for this particular LCD? Ta -- Danny | ||||
| Similar Threads | Posted |
| LCD controlling with comparators | January 15, 2005, 6:50 pm |
| Magnitude Comparators | December 7, 2007, 5:40 am |
| Connect two comparators' output together.. | January 23, 2006, 10:58 pm |
| What is the benefit with comparators that have a Hysteresis pin? | May 18, 2008, 3:20 pm |
| Controlling 12V from 5V | June 29, 2005, 3:35 pm |
| controlling | April 10, 2007, 6:25 am |
| controlling many switches from the PC | December 2, 2004, 6:46 am |
| op amp controlling a mosfet | July 18, 2006, 1:20 pm |
| Controlling hundreds of LEDs | December 21, 2004, 8:41 pm |
| Controlling a motor with a transistor and a PIC | June 7, 2006, 11:14 pm |
| Re: Controlling a relay via cellular phone..... | July 12, 2006, 6:23 pm |
| Re: Controlling a relay via cellular phone..... | July 12, 2006, 7:03 pm |
| Re: Controlling a relay via cellular phone..... | July 12, 2006, 8:50 pm |
| controlling 2 stepper motors along x and y axis | September 11, 2006, 1:03 pm |
| controlling dc motor direction (help a newbie, please) | October 28, 2006, 2:09 am |

LCD controlling with comparators
Yahoo!
Windows Live
del.icio.us
digg
Netscape 







>From: Danny T danny@nospam.oops