CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Can a seven segment be connected directly to a PIC output

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

Can a seven segment be connected directly to a PIC output
PostPosted: Sat Sep 10, 2005 8:38 am     Reply with quote

Hi,

Is it OK to connect three seven segment displays directly to the PIC output ports. ??? No transistors are used for switching.

I am using a common anode type display, and the PIC is 16F877.

Also what resistance would be suitable ??


thanks
arunb
Ttelmah
Guest







PostPosted: Sat Sep 10, 2005 9:49 am     Reply with quote

It depends on the display. For a typical 'red' LED, probably something like 330R resistors would keep the current within reasonable limits. Displays with a higher forward voltage would need lower resistors, and the results would only be acceptable, if the segments give a reasonable light output for something in the order of 8mA. For larger displays wanting a lot more current, a buffer will be needed. Beware though that though the pins individually can deliver (if required), usually up to 25mA, there is also an overall 'port' limit, and an overall 'chip' limit. So though it might seem OK to reduce the resistor to perhaps 120R, and draw more current, this will take the delivery over the maximum the whole chip can deleiver. I based 330R, on an LED with a Vf of 2v, which then should draw about (5-2-0.6)/330 amps = 0.0072
Round this up to 8mA. Then assume all 21 segments are driven at once, gives a total current of 168mA. The 16F87x family as a typical example, have a maximum current on the 5v supply pin, of 250mA, which has to supply all these outputs, and the processor itself. You need to allow up to perhaps 20mA for the processor, so this has just a little 'comfort' margin.
However do the same calculation with 220R resistors, and you get 11mA per LED, giving 231mA, and the processor is getting uncomfortably 'close' to it's limit....

Best Wishes
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Sun Sep 11, 2005 1:59 pm     Reply with quote

Here is an example of a PIC driving an LED display. I use MMBT4403 PNP transistors for each digit, and 7 lines with 220 ohm resistors used as current limiting resistors. The LED display used is the LTC2623E

-Mike

arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Sun Sep 11, 2005 9:04 pm     Reply with quote

Hi,

Thanks a lot for the help. I had a feeling transistors would eb required..

arunb
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Mon Sep 12, 2005 7:43 am     Reply with quote

Oops, i meant to say that i used 330 ohm resistors, not 220.

Look at application note "AN529" at the Microchip website, from which such ideas were taken from. They describe how you need transistors, but can also eliminate the transistors if you short two PIC outputs together to get the necessary drive current. But the standard is to use transistors.

You may also find that reading App Note "AVR242: 8-bit Microcontroller Multiplexing LED Drive & a 4x4 Keypad" at the Atmel website is more descriptive.

In my LED display, i need to 'strobe' between 5 sets of segments (4 letters/numbers, and 1 for the colon in the middle). Thus, there are 5 common anodes. I find I need to swtich thru each character every 5ms to continue to maintain a continuous illumination for the human eye.
John Leung
Guest







Driving 7-segment LED
PostPosted: Mon Sep 12, 2005 10:20 am     Reply with quote

It really depends on the voltage requirement of the 7-segment display. If it is a +5V display, some current limiting resistors would be enough. If the 7-segment is a 4 inches high, 9V display, you need transitors for switching. Each segment of over 2.5" display may contain more than 3/4 LEDs, you know.

John Leung
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group