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

PIC to drive 7segment LED

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







PIC to drive 7segment LED
PostPosted: Wed Jun 02, 2004 8:19 am     Reply with quote

I want to drive a Common Anode 7 segment LED(s) with a PIC. Each segment would likely sink up to 15mA each into the port pin if i connected each segment to a PIC port pin through a current limiting resistor. E.g. 5V/330ohms = 15mA.

Now imagine 7 of these segments being on at the same time, not to mention a decimal point -- thus a total of 8 segments. Thus 8x15mA=120mA being sunk into the PIC, and thus Vss sees 120mA of sink current from the LEDs alone!! A PIC can only take 200mA of sink current total

This is something I overlooked in the past and all was fine (except of course perhaps some occasional unknown erratic behaviour Rolling Eyes

I can think of a few ways to overcome the sink current crisis. What have you guys done in the past? This is what i'm thinking...
1. I can just use a common cathode LED display. Thus all the current will be sourced and each pin can source up to 25mA.

OR

2. Hook the display up to the unregulated input of the 5V regulator. Then use a darlington transistor array (e.g. ULN2004) Question Question

OR

3. Use a darlington transistor array as in (2) but hook up the display to the regulated 5V rail. (I'll definitely have to prepare myself for a HOT heatsink.)

Any suggestions?
Ttelmah
Guest







Re: PIC to drive 7segment LED
PostPosted: Wed Jun 02, 2004 10:42 am     Reply with quote

valemike wrote:
I want to drive a Common Anode 7 segment LED(s) with a PIC. Each segment would likely sink up to 15mA each into the port pin if i connected each segment to a PIC port pin through a current limiting resistor. E.g. 5V/330ohms = 15mA.

Now imagine 7 of these segments being on at the same time, not to mention a decimal point -- thus a total of 8 segments. Thus 8x15mA=120mA being sunk into the PIC, and thus Vss sees 120mA of sink current from the LEDs alone!! A PIC can only take 200mA of sink current total

This is something I overlooked in the past and all was fine (except of course perhaps some occasional unknown erratic behaviour Rolling Eyes

I can think of a few ways to overcome the sink current crisis. What have you guys done in the past? This is what i'm thinking...
1. I can just use a common cathode LED display. Thus all the current will be sourced and each pin can source up to 25mA.

OR

2. Hook the display up to the unregulated input of the 5V regulator. Then use a darlington transistor array (e.g. ULN2004) Question Question

OR

3. Use a darlington transistor array as in (2) but hook up the display to the regulated 5V rail. (I'll definitely have to prepare myself for a HOT heatsink.)

Any suggestions?

Realistically, most users would add a driver IC, for this situation. You talk about the Vss limit, as though it is fixed for all PIC's. It is not. For instance, the 16F877, can draw 300mA on Vss, but a maximum on the combination of various ports, of 200mA. Your total dissipation when using the unregulated input to the voltage regulator, will be equal to that expected on the regulator in the latter case, but will occur in the dropper resistors instead. You don't say what your incoming voltage is, but assuming 12v, and a total demand of 250mA, you only need to dissipate 1.75W in the regulator. Even a 'clip on' 20C/W heatsink will only give a 35C heat rise above ambient. Personally, I'd use a switch mode supply instead.

Best Wishes
Kenny



Joined: 07 Sep 2003
Posts: 173
Location: Australia

View user's profile Send private message

PostPosted: Wed Jun 02, 2004 6:23 pm     Reply with quote

A seven-segment led display driver is the first choice - I usually use the SAA1064 i2c chip. It does display multiplexing and the current in the segments is settable in 3mA increments.

I have done it along the lines you mentioned for eight digits, but doing the multiplexing with the pic. A ULN2803 was connected to all the led segments and decimal points via eight resistors (the corresponding led cathodes of each digit were joined together).

The common anodes were each switched in turn to +5V with a 2N2907A PNP transistor. Because the display was multiplexed, there was time for
data to be taken from a shaft encoder ic on the same port as the ULN2803, scan switch states, scale the data, etc.
yerpa



Joined: 19 Feb 2004
Posts: 58
Location: Wisconsin

View user's profile Send private message Visit poster's website

Driving 7-segment LED from PIC
PostPosted: Fri Jun 04, 2004 1:44 pm     Reply with quote

There are lots of good seven-seg numeric displays that are plenty bright on three or four milliamps per segment. Look for high-efficiency red displays.
Guest
Guest







Try the MAX
PostPosted: Tue Jun 08, 2004 7:26 am     Reply with quote

Little late on this, but I have had good luck with the Maxim MAX7219 and MAX7221 parts for driving up to 8 (eight) 7-segment LEDs. They talk to the PIC using SPI, and about the only external component needed is a current-limiting resistor. Brightness can be controlled by setting a register. To minimize current draw, use some "super bright" red LEDs, as already suggested.

You probably already know this, but if you register with Maxim/Dallas (or is it Dallas/Maxim?) you can get free samples for your prototyping in small quantities. Sent by FedEx, no less. Lets you try before you buy.....

Mike
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