Dual counter

Status
Not open for further replies.
bananasiong said:
Yes I'm using the PNP transistors.

Sorry, the diagram is on another page - I meant NPN, as well as the PNP.

I thought the collector resistor is to limit the Ic max? As long as the Ic is below Ic max, Ic is controlled by the base current isn't it?

Only if you're using the transistor as an amplifier and not a switch - add NPN's and lower the resistors - all removing the resistors would do is strain the PIC.
 
You could also use a ULN2003 (or ULN2803) sinking driver IC instead of seven NPN transistors.
 

Attachments

  • Mux CA.PNG
    22.6 KB · Views: 28,212
Last edited:
Okay, luckily I didn't remove the resistors.

Can I know what is Code protection (CP & CPD) for the fuse setting? And what's about Power up timer reset?

I've read the datasheet of 16F877A, it shows that there are 15 interrupts, what's the purpose for having more than one interrupt? How does it work?
 
Mike said:
You could also use a ULN2003 (or ULN2803) sinking driver IC instead of seven NPN transistors.
Why is it needed? Direct from the output pin to the base via a resistor will do right?
 
I was supplementing Nigel's suggestion of using NPN segment driver transistors to improve overall display brightness.
 
Use PNP as 7-segment display selection and NPN for the patterns right?
I think I will just reduce the resistance of the collector, because the PCB space is limited.
 
bananasiong said:
Use PNP as 7-segment display selection and NPN for the patterns right?
I think I will just reduce the resistance of the collector, because the PCB space is limited.

But the PIC hasn't got enough current capability - which is why the resistors are there! - check the PIC datasheet, maximum current per pin, and maximum total current.
 
bananasiong said:
I've read the datasheet of 16F877A, it shows that there are 15 interrupts, what's the purpose for having more than one interrupt? How does it work?

The purpose is to allow user to process up to 15 different requests, which user has no idea when they will happen in real time but need to service them none the less, and not wishing to test them one by one in an endless loop wasting processor power. In PIC 16F families, all interrupt requests, if enable by the user, would jump to address location 0x0004 regardless.

It is up to user to test for what type of interrupt are requested and then branch to the correct service routine inside the interrupt handler.

In case of AVR, the interrupt is vectored, so different request would jump to different fixed address locations in which user can place the correct jump address for the required handler.
 
My 2 bob on this thread, given its already evolved quite far, use the UL2003 and Common Cathode 7-Segment displays.

This way you can ditch the resistors on the base of each transistor and directly control the switching via the ULN2003, reducing external components from 8 to 1 for your multiplexing.

**broken link removed**

The ULN2003 acts like an "earth" switch, eg, a high on the input from the PIC will switch the output to earth

This is great for devices that use up to 500mA!
 
Heres an example with a piezo siren, but its the same analogy for the segment displays

**broken link removed**

GND would be applied to Pin 8 on the ULN2003
bullet

Pin 9 on the ULN2003 is connected to the positive supply for inductive loads such as motors and relays
 
The datasheet of ULN2003 shows that there is a 2.7 khm: resistor at the input. So I can use it without a resistor right? And the output logic of the patterns have to be inverted.
 
bananasiong said:
The datasheet of ULN2003 shows that there is a 2.7 khm: resistor at the input. So I can use it without a resistor right? And the output logic of the patterns have to be inverted.
You still need segment current limiting resistors.

A '1' on an input turns on its corresponding output which sinks current to the LED segment turning it on.

Stick with common anode displays and use the ULN2003 or ULN2803 to drive the segments.

 
Last edited:
bananasiong said:
The datasheet of ULN2003 shows that there is a 2.7 khm: resistor at the input. So I can use it without a resistor right? And the output logic of the patterns have to be inverted.


That’s correct, a digital "High" (5V) at the input will supply an earth to the output (like a switch to earth), a logic low (0V) will turn off this earth ("open circuit") thus turning the segment/device off

Mike said:
You still need segment current limiting resistors.

A '1' on an input turns on its corresponding output which sinks current the LED segment turning it on.

Stick with common anode displays and use the ULN2003 or ULN2803 to drive the segments.

How can you use the ULN2003/ULN2803 for a common anode segment? They switch earths, not supply voltages - the common +ve supply pin is purely for inductive loads (notice every output has built in diodes to protect from back EMF)
 
Last edited:
How can you use the ULN2003/ULN2803 for a common anode segment? They switch earths, not supply voltages - the common +ve supply pin is purely for inductive loads (notice every output has built in diodes to protect from back EMF)
Not sure what you mean by a common anode segment but common anode displays have the anode of each segment tied together and supplied or switched at a positive voltage. The other end of each segment requires a sinking driver, like the '2003. A simple example is shown in the post just previous to your last post. You connect the ULN2003 diode connection to the same positive supply that you're using for the common anodes.

I assumed you were describing using a ULN2003 as a sinking driver for a multiplexed common cathode display, using it to replace the sinking NPN drivers in the "common cathode" drawing below. Yes, no?
 

Attachments

  • Mux CA & CC.PNG
    43.6 KB · Views: 1,072
Last edited:
Mike said:
You still need segment current limiting resistors.
Oh god, you're correct. I'm muddled, the resistors are needed, they are the load of the collector.

gramo said:
How can you use the ULN2003/ULN2803 for a common anode segment? They switch earths, not supply voltages - the common +ve supply pin is purely for inductive loads (notice every output has built in diodes to protect from back EMF)
He meant using both PNP and the ULN2003. PNP to supply the common anode while ULN2003 used for the patterns of the 7-segment display.
 
bananasiong said:
He meant using both PNP and the ULN2003. PNP to supply the common anode while ULN2003 used for the patterns of the 7-segment display.

That would be complete overkill wouldnt it? Just use the ULN2003 to switch the common cathode for each display - the pic can drive each segment easily, but a resistor for each would still be required to limit the current for each segment.


Mike said:
A "common anode segment"? What the heck are you talkin' about?

common anode segment display
**broken link removed**
**broken link removed**

Common Cathode

**broken link removed**
 
But if you only have common anode displays, and the additional components already, then go with the transistor switching..
 
Because previously I complained that the 7-segment display is not bright enough. If I use common cathode, the current sourced by the PIC is enough?
 
gramo said:
That would be complete overkill wouldnt it? Just use the ULN2003 to switch the common cathode for each display - the pic can drive each segment easily, but a resistor for each would still be required to limit the current for each segment.
Yes, I agree, it is "overkill" but it provides you with a full brightness display. If it takes 10-ma per segment at 100% duty cycle for full brightness you're going to need 40-ma per segment pulses at 25% duty cycle for full brightness (and a source driver capable of 40-ma for 7 or 8 segments = 280..320-ma). Driving the segments directly from the PIC pins as you suggest just isn't going to cut it if you need full brightness. Sorry.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…