• Forums
• Posts
Latest Posts
Active Posts
Recently Visited
Search Results
• Page Extras
• Forum Themes

### Hot!remove a zero

Page: << < ..67 Showing page 7 of 7
Author
Gort2015
• Total Posts : 2076
• Reward points : 0
• Joined: 2015/04/30 10:49:57
• Location: 0
• Status: online
Re: remove a zero 2018/03/03 16:05:35 (permalink)
0
if(!--cnt)

to

if(!cnt--)

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
+ ST:Continues, "What Ships are Made for", Q's back.
kurt
Starting Member
• Total Posts : 63
• Reward points : 0
• Joined: 2017/05/07 13:18:17
• Location: 0
• Status: offline
Re: remove a zero 2018/03/05 14:19:57 (permalink)
0
that oscillator and calculating average, it works now. but while i was testing and comparing my projects with other projects on the internet i discovered that my leds are not so bright. but first to know, my project looks like this  lm7805 which powers the pic18f2220, a temperature sensore and four 7 segments displays (kingbright sc39-11ewa)
to display the temperature.  In order to find out what this could be i did first some measurements:
output of the lm7805 is 4.95 volt.  output pins on pic that are used for multiplexing 4.01 volt. currentflow from output pin of pic for multiplexing is 13.5 ma. and i verified that the indicated resistance of resistor is indeed  nearby 150 ohm varies from 147 to 154.
a quick calculation on this one is U=I * R  so  4.01 =  0.0135 * 150 but this is not matching because
0.0135 *150 = 2.025 and not 4.01 how is this possible
i did the measurement with multiplexing set to 400 ms instead of 4 ms,  but same result
is there an explanation for this

qɥb
Monolothic Member
• Total Posts : 1699
• Reward points : 0
• Joined: 2017/09/09 05:07:30
• Location: Jupiter
• Status: offline
Re: remove a zero 2018/03/05 14:54:03 (permalink)
+2 (2)
kurt
...
a quick calculation on this one is U=I * R  so  4.01 =  0.0135 * 150 but this is not matching because
0.0135 *150 = 2.025 and not 4.01 how is this possible
...

Where are you allowing for the voltage drop across the LED?

PicForum "it just works"
Gort2015
• Total Posts : 2076
• Reward points : 0
• Joined: 2015/04/30 10:49:57
• Location: 0
• Status: online
Re: remove a zero 2018/03/05 19:16:00 (permalink)
0
And...You allowed then to fade out, they are not refreshed fast enough.
50hz to 100hz (ideal).  Adjust until they are static.

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
+ ST:Continues, "What Ships are Made for", Q's back.
kurt
Starting Member
• Total Posts : 63
• Reward points : 0
• Joined: 2017/05/07 13:18:17
• Location: 0
• Status: offline
Re: remove a zero 2018/03/06 15:13:32 (permalink)
0
voltage drop across the led?  I do something wrong i just don't know what
i need to figure it out and come back to it later

qɥb
Monolothic Member
• Total Posts : 1699
• Reward points : 0
• Joined: 2017/09/09 05:07:30
• Location: Jupiter
• Status: offline
Re: remove a zero 2018/03/06 15:16:42 (permalink)
0
kurt
voltage drop across the led?  I do something wrong i just don't know what
i need to figure it out and come back to it later

Where is the problem?
You calculated the voltage across the series resistor, but ignored the voltage drop across the LED.

PicForum "it just works"
kurt
Starting Member
• Total Posts : 63
• Reward points : 0
• Joined: 2017/05/07 13:18:17
• Location: 0
• Status: offline
Re: remove a zero 2018/03/06 15:31:16 (permalink)
0
i measured voltage at the output pin of my pic and the ground
qɥb
Monolothic Member
• Total Posts : 1699
• Reward points : 0
• Joined: 2017/09/09 05:07:30
• Location: Jupiter
• Status: offline
Re: remove a zero 2018/03/06 15:43:34 (permalink)
0
Isn't the current from the PIC pin passing through both a resistor and an LED to get to ground?

PicForum "it just works"
Gort2015
• Total Posts : 2076
• Reward points : 0
• Joined: 2015/04/30 10:49:57
• Location: 0
• Status: online
Re: remove a zero 2018/03/06 16:17:49 (permalink)
0
Very simple to calculate.
R = (V - VDROP) / CURRENT
150 ohms = (5v - 2v) / .02ma

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
+ ST:Continues, "What Ships are Made for", Q's back.
dan1138
Super Member
• Total Posts : 2690
• Reward points : 0
• Joined: 2007/02/21 23:04:16
• Location: 0
• Status: offline
Re: remove a zero 2018/03/06 16:24:07 (permalink)
+1 (1)
From what I can understand of the design that Kurt has posted the present problem concerns the brightness of the 7-segment LED displays.

The circuit that drives a single segment appears to be from the PIC GPIO output to a 150 ohm resistor to the LED segment to an NPN transistor to ground.

Kurt posted that the PIC output voltage is 4.01 volts and the current is 13.5 mA.

If we consider these measurements as accurate then the voltage across the 150 ohm resistor is (150 * 0.0135) 2.025 volts. The remaining 1.985 volts, (4.01-2.025) must be across the LED segment and NPN transistor.

The a forward voltage drop of 1.985 volts at 13.5 mA is consistent with the SC39-11EWA data sheet.

I would recommend that Kurt test the SC39-11EWA brightness using a 5.0 volt power source, a resistor and a volt meter to measure the voltage across the resistor. Change the value of the resistor until you see the brightness to need. Once you have found a resistor value for the brightness you need you will want to divide the value by the number of displays you will multiplex.

For example, if you find the brightness you want using a 500 ohm resistor then use a 125 ohm resistor with your PIC circuit.

Gort2015
• Total Posts : 2076
• Reward points : 0
• Joined: 2015/04/30 10:49:57
• Location: 0
• Status: online
Re: remove a zero 2018/03/06 17:15:30 (permalink)
0
If you want to solve all the refresh problems, use one of these:
Maxim Integrated MAX7219 or MAX7221.

One device will scan up to 8 7-segment leds and takes all the work away from the mpu.
No interrupts.

It does bar-graphs, 64 individual leds and would also work with an 8x8 matrix.

I've used them and you get perfect static displays.

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.