ljcox said:Edit 3. The PIC programming may be a bit complicated as you are muxing on the segment side
eblc1388 said:ljcox said:Edit 3. The PIC programming may be a bit complicated as you are muxing on the segment side
I would suggest using table lookup.
ljcox said:In my previous post, I wrote that you don't need Darlingtons. But I forgot that the PNP segment transistors (I'll call them Qa ~ Qg) have to switch up to 420 mA. So they will have to be Darlingtons.
ljcox said:I have also thought about the PIC programme. It is relatively easy.
eblc1388 said:ljcox said:In my previous post, I wrote that you don't need Darlingtons. But I forgot that the PNP segment transistors (I'll call them Qa ~ Qg) have to switch up to 420 mA. So they will have to be Darlingtons.
If 7445 is used, with its open collector and 80mA current sinking capability, a darlington PNP setup would not be needed. This also enable LED supply operation at higher than +5V. Good thought. Operation at > 5V should not be necessary. Open collector drivers will require 2 resistors per transistor to by pass Icbo.
ljcox said:I have also thought about the PIC programme. It is relatively easy.
A far as I understand, there is no easy coding method in PIC(16Fxxx) to test a certain bit position according to value of a variable, instead the data to be tested has to be "rotated" certain times beforehand so that the required bit is in the designated position to be tested or there are separate codings for eight individual testing routines. It can be done, but the coding could be longer and more involved than just using table lookup. There are the btfss & btfsc instructions which allow testing particular bits. That the way I suggested doing it initially, but if the rrf instruction is used to shuffle the bits, the transistors can be switched in parallel. I don't understand your point re a table lookup as both of my suggestions need a table lookup anyway.
ljcox said:Open collector drivers will require 2 resistors per transistor to by pass Icbo.
ljcox said:There are the btfss & btfsc instructions which allow testing particular bits.
0. Turn all of the Q1:10 transistors off.
1. test bit 0 of digit_1 and if set, set the output that turns on the Q1 transistor.
2. Then test bit 0 of digit_2 and if set, turn on Q2.
3. Repeat this for all digits
4. delay for say 3 ms
5. then goto 0. and repeat for bit 1, <<<<<<
ljcox said:That the way I suggested doing it initially, but if the rrf instruction is used to shuffle the bits, the transistors can be switched in parallel.
eblc1388 said:Code:4. delay for say 3 ms
taengi said:I know that the instruction time = crystal freq / 4. but how to link to time delay?
eblc1388 said:ljcox said:There are the btfss & btfsc instructions which allow testing particular bits.Code:0. Turn all of the Q1:10 transistors off. 1. test bit 0 of digit_1 and if set, set the output that turns on the Q1 transistor. 2. Then test bit 0 of digit_2 and if set, turn on Q2. 3. Repeat this for all digits 4. delay for say 3 ms 5. then goto 0. and repeat for bit 1, <<<<<<
Yes, but unless you want to code the same testing routine six more times with diffenent bit position to be tested, or it won't work. My point is: PIC 16Fxxx instruction set does not allow testing of a certain bit position according to the value of a counter. Agreed. Now I undestand what you mean. I had intended to do the same testing routine six more times to test each bit in turn.
ljcox said:That the way I suggested doing it initially, but if the rrf instruction is used to shuffle the bits, the transistors can be switched in parallel.
What do you meant by switching transistors in parallel? I would set/clear bits first on a file register and then output it to the port so it is in effect parallel. That's what I mean. I could not think of a better way to express it. Perhaps I should have written:- turn on Q1:8 simultaneously, then Q9:10 simultaneously.
taengi said:eblc1388 said:Code:4. delay for say 3 ms
How do you actually know the delay is 3ms?
I mean while I was using 3.58Mhz of crystal, in order to ensure no flicker for 10 digits, I put in arbituary value and finally get a loop of AA (hexa value) times...but still i couldn't calculate out the exact time delay.
I know that the instruction time = crystal freq / 4. but how to link to time delay?
ljcox said:My understanding is that the mux rate needs to be at least 40 Hz in order to prevent flicker. So I chose 3 ms as an example since 3 * 7 = 21 ms which is a frequency of 1000/21 = 47.6 Hz
taengi said:Hi ljcox,
I have decided to use 1x10 method you've suggested since I couldn't visualise and understand fully how the other 2 options function in term of s/w and h/w. Do you want to ask questions about these options to help you understand them?
for this 1x10 method, I still have a few curiosity. I've never use a PNP before so I'm thinking is the current flow from Vcc to PIC?? If so, by setting Ic = 50mA, I'm sure PIC will damaged? No, the current into the PIC is determined by the 560 Ohm resistors. It will be about 4/0.56 = 7 mA That's mean I need another IC, like what eblc1388 suggest use a 7445 connected to PIC?
As for the R value, I'm not too sure since it's PNP, is the calculation as follow correct?
Ic = 5mA (1 segment) x 10 = 50mA Correct
Ib = 50mA/100 = 0.5mA To ensure saturation, you should make it about Ic/10 = 5 mA, hence my 7 mA above
base voltage Vb = 5 - [0.5mA x 560] = 4.7V No, Vb = 5 - 0.7. (but the output port from PIC measured is 2.7v not 5v???) I don't know why you measured 2.7V. Without any load, the PIC should switch between 0V and 5V.
Ve = Vb - Vbe = 4.7 - 0.7 = 4v No, Ve = +5V. The emitter is the one with the arrow.
R = [Ve - 1.7 (1 segment)]/50mA = 46ohm No, R = (5 - 0.2 - 1.7 - 1.6)/0.05 = 30 Ohm. Where 0.2 V is the PNP saturation voltage, 1.7 is the LED voltage and 1.6 is the saturation voltage of the Darlington transistors.
On the driver side, how do you come up with 5.6kohm?? The Darlington transistors have a very high gain, so they don't need much base current. See the data sheet. However, see my comments below. I'm clueless. From the connection, does it mean that the total current of a digit is sinked through GND via transistor NPN? Yes
If you use the 2N2222, you will need 10 PNP transistors to drive them since the 2N2222 will need a base current of about 42 mA in order to ensure saturation with a collector current of 420 mA. The PIC cannot source 42 mA.taengi said:if i don't use these darlington transistor but the general purpose transistor, will the configuration still be the same? like if i use BC327 for PNP and 2N2222 for NPN
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?