>-----Original Message----- >From: Andre Miller [mailto:andre.miller@BLUERIVER.CO.ZA] >Sent: 17 March 2004 08:03 >To: PICLIST@MITVMA.MIT.EDU >Subject: [PIC:] Multiplexing seven segment displays, correct >resistor values? > > > >Hi, > >For the display of my project I'm using four seven segment >displays (common anode), using 8 IO pins for the segments, and >another 4 to drive the individual displays. The four displays >are driven through a BC557 transistor (with a 1K resistor on >the gate), and each segment is connected to an IO pin through >a 330 Ohm resistor (all segments are common to all displays, >going through the same resistor. I hope this is all clear :-) > >To drive the displays I repeat the following via a timer >interrupt (Prescaler set to 1:1, 8 bit timer, 4 Mhz clock): > >1) Turn on display X, turn off all other displays >2) Set the correct segments for display X >3) Add one to X >4) If (X > 4), set X = 1 > >So each time the ISR executes it turns on the next display, etc. > >Problem is, the segments on the displays are very dim if I do >this. If I only have one display on, then it is the correct >brightness. This is understandable since each display is only >on for 1/4 of the time now. I was thinking maybe I could just >use a quarter of the value resistor instead (replace 330 Ohm >with 100 Ohm, for example). But then, won't it draw too much >current even if its only for a fraction of second, or will it >all average out? Also, if something happens which cause the >pic to stop multiplexing the displays, there is the >possibility of only one display being on for a long period of >time (clocking stops, transistor failure, etc). > >Any suggestions on how to overcome this? You need to drive the displays with a higher current to compenstate for the duty cycle they are working at. In this case you would need around four times the current. You have to make sure that you do not exceed the specifications of the displays, but generaly LEDs can take much higher than normal currents if the current is only flowing for a brief period. Also, you should may think about modifying the sequence you have listed above: >1) Turn on display X, turn off all other displays At this point, digit X will have the same segments illuminated as the previous digit. >2) Set the correct segments for display X Now it's displaying the correct segments. However, the wrong segments were illuminated for a short time, this will tend to reduce the contrast of the display. A better sequence would be something like: 1) Turn off all digits 2) Set the segments for digit X 3) Turn on digit X Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads