Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC Output Sink / Source Ratio - Code Problem

Status
Not open for further replies.

Suraj143

Active Member
I’m multiplexing 5 common cathode small red seven segments. Segment patterns come from PORTB (without resistors) & common cathodes driven by PORTA without using any transistors.

The problem is display brightness is very low & each digit segments are different brightness.

Code:
	movf	Digit1,W	;get the D1 segment pattern
	movwf 	PORTB
	movlw	b'11110'	;make RA0 low
	movwf	PORTA
	call	Del_770uS
	movf	Digit2,W	;get the D2 segment pattern
	movwf 	PORTB
	movlw	b'11101'	;make RA1 low
	movwf	PORTA
	call	Del_770uS
	movf	Digit3,W	;get the D3 segment pattern
	movwf 	PORTB
	movlw	b'11011'	;make RA2 low
	movwf	PORTA
	call	Del_770uS
	movf	Digit4,W	;get the D4 segment pattern
	movwf 	PORTB
	movlw	b'10111'	;make RA3 low
	movwf	PORTA
	call	Del_770uS
	movf	Digit5,W	;get the D5 segment pattern
	movwf 	PORTB
	movlw	b'01111'	;make RA4 low
	movwf	PORTA
	call	Del_770uS
	return
 
I’m multiplexing 5 common cathode small red seven segments. Segment patterns come from PORTB (without resistors) & common cathodes driven by PORTA without using any transistors.

The problem is display brightness is very low & each digit segments are different brightness.
You need to drive the common cathodes with transistors. The PIC's outputs can only sink 25mA each, so as soon as each digit is lighting up more than one segment per multiplex step you start to divide that 25mA between all the on-segments in each digit. It's not enough, and the more segs you turn on the dimmer it gets.

Use one driver transistor per 7-seg digit. Make sure the transistor can handle (typically) 25mA*8 segments (7-seg and DP), or 200mA. Easy.

When multiplexing you need to hit those LEDs with all the power they can handle, since they're only on for the multiplex duty cycle, and have time to cool down a bit between flashes of on time. Depending on your multiplex rate you can probably power them at more than 100% of their rating. The LED datasheet will tell you how much you can give em at different duty cycles.
 
Last edited:
Hi futz thanks for your explanation.Thats what I did earlier using transistors for every segments.

But this time I have do without transistors.

I see many projects done with this technique.Even microchip App notes done using this technique for low power applications.
 
the only way i see you making this work good without any transistors is actually lighting 1 led from the segment at 1 time. Then you can loop through each LED in the segment many times to make 1 digit and then jump to the next.
 
the only way i see you making this work good without any transistors is actually lighting 1 led from the segment at 1 time. Then you can loop through each LED in the segment many times to make 1 digit and then jump to the next.
I've done per-segment multiplexing as described above and, like Bill says below, you don't get a terribly bright display. Too low of a duty cycle. It works ok though.
 
Last edited:
Hi futz thanks for your explanation.Thats what I did earlier using transistors for every segments.

But this time I have do without transistors.

I see many projects done with this technique.Even microchip App notes done using this technique for low power applications.

Just putting transistors on the five common cathodes will improve brightness significantly... for all of the reasons Futz mentioned in the second post...
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top