pic and common anode 7 segment led

Thread Starter

abhiananth

Joined Jul 24, 2014
18
Hi

I got common anode 7 segment led display and PIC microcontroller.

The connection should be made like this between led display and PIC, to see the output in display via PORTB of PIC, right?

Image – PIC (PORTB) and 7 segment led connection with transistor
pic _ 7 segment led _ transistor.jpg

I don’t have enough transistors right now to make this connection.

Since charge flows from high potential to low potential, I came up with this connection (connecting the PORTB pins directly to the cathode pins of 7 segment led)

Image – PIC (PORTB) and 7 segment led connection without transistor
pic _ 7 segment led - transistor.jpg

Will the microcontroller be damaged by this connection?

Actually I tried this connection via PORTC pins. 7-segment led glowed but not according to the program. When I removed 7 segment led display and placed 7 individual leds in it, they got worked correctly according to the program.

My questions are:

  1. Is connections I mentioned with transistor right?
  2. Will the microcontroller be damaged by the connection I made without transistor?
  3. If not, will this connection work?
 

GopherT

Joined Nov 23, 2012
8,009
Hi

I got common anode 7 segment led display and PIC microcontroller.

The connection should be made like this between led display and PIC, to see the output in display via PORTB of PIC, right?

Image – PIC (PORTB) and 7 segment led connection with transistor
View attachment 77585

I don’t have enough transistors right now to make this connection.

Since charge flows from high potential to low potential, I came up with this connection (connecting the PORTB pins directly to the cathode pins of 7 segment led)

Image – PIC (PORTB) and 7 segment led connection without transistor
View attachment 77586

Will the microcontroller be damaged by this connection?

Actually I tried this connection via PORTC pins. 7-segment led glowed but not according to the program. When I removed 7 segment led display and placed 7 individual leds in it, they got worked correctly according to the program.

My questions are:

  1. Is connections I mentioned with transistor right?
  2. Will the microcontroller be damaged by the connection I made without transistor?
  3. If not, will this connection work?
Yes, it will work as dDave said above.
You need to add 7 resistors (one for each segment between the LED AND THE portB pins (330 to 1k depending how bright you need and how efficient/inefficient your LEDs are.

To turn a segment on, you will have to set the portB pin as an output low.
In a program, you will have to first, set it to a digital pin (in case it can be an analog comparator or other analog function analog is normally the default.

Then you set the Tris bit to output (0)

Then you set the state of the output to LOW (0) to turn the segment on and hi (1) to turn it off.
 

takao21203

Joined Apr 28, 2012
3,702
Your second drawing needs 330 ohm resistors between the port pins and the cathodes, otherwise you will blow the pic.
The resistors manufacturers mafia tries everything possible to keep this urban legend alive.

In fact, LED calculators in the early 1980s didnt use resistors, that's where PICs are coming from.

They are totally unneccessary. If the display is too bright, well with a controller, you can modulate it.

Only bad thing is the brightness variation. But with suitable scanning, that isnt visible either.
 

tshuck

Joined Oct 18, 2012
3,534
The resistors manufacturers mafia tries everything possible to keep this urban legend alive.

In fact, LED calculators in the early 1980s didnt use resistors, that's where PICs are coming from.

They are totally unneccessary. If the display is too bright, well with a controller, you can modulate it.

Only bad thing is the brightness variation. But with suitable scanning, that isnt visible either.
No, it's people that do not understand how these things work that purport some sort of conspiracy is afoot. There may be times you can get away with it (as in current-limited drivers), but that is not a good practice in wide-sweeping statements.

@OP, please don't do this, use resistors.
 

GopherT

Joined Nov 23, 2012
8,009
The resistors manufacturers mafia tries everything possible to keep this urban legend alive.

In fact, LED calculators in the early 1980s didnt use resistors, that's where PICs are coming from.

They are totally unneccessary. If the display is too bright, well with a controller, you can modulate it.

Only bad thing is the brightness variation. But with suitable scanning, that isnt visible either.
Interesting. If true, I would like to understand why Microchip uses resistors in all of their Application Notes that use LEDs.
 

takao21203

Joined Apr 28, 2012
3,702
Interesting. If true, I would like to understand why Microchip uses resistors in all of their Application Notes that use LEDs.
Eventually the knowledge got lost when the japanese electronics economy lost its monopoly in the early 1980s.

Many kinds of electronic gadgets disappeared around that time. Watches and calculators are all LCD now, made in China.

Why do you want resistors when there's no benefit? Chip traces wearing out? I've read statements as obscure as electromigration. When is this supposed to happen? After a year? Two years? Any references to research about it?

How comes CPU chips deal with a number of Watts? Just wider traces, thicker bonding wires?

Or its just the ambigous usual disclaimer "it hasnt been tested operating outside the specification MAY have some adverse effects on relieability".

I have run a 768 LED matrix, 8 PIC 16F59, for months, didnt see any failures or degrading.
 
Top