Poll

Would you routinely place a resistor in series with a jelly bean LED on an RPi 3.3V GPIO?

Yes
No
What's a resistor?
What's a datasheet?

Author Topic: Software guys, please, no.  (Read 14309 times)

0 Members and 1 Guest are viewing this topic.

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19497
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Software guys, please, no.
« Reply #125 on: September 22, 2022, 11:40:08 pm »
The guy is probably laughing his ass off now if he sees this thread. He even infected an electronics forum with his joke!  :-DD

If that was his objective, there is an old word to describe it: trolling.

Given the means he devotes to his channel, I'm still convinced it's more for the traffic it's generated rather than just pure trolling for the sake of having a laugh. Come on. Are people this deluded about what runing a successful YT channel means?

I'm not deluded, because I have zero idea. And near zero interest in channels or yootoob vids - too damn slow compared to reading.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline John B

  • Frequent Contributor
  • **
  • Posts: 800
  • Country: au
Re: Software guys, please, no.
« Reply #126 on: September 23, 2022, 12:42:17 am »
It's probably a bit late to say now, but my original contention is that the RPi has a lead time of at least 1 year in most places that I can see, and the few that are in stock elsewhere are going for hundreds over their RRP.

Why would anyone want to risk any damage to one just to skimp on a fraction of a cent resistor?

If the RPi cost $1 and was in stock everywhere, I don't think the argument would be the same
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14471
  • Country: fr
Re: Software guys, please, no.
« Reply #127 on: September 23, 2022, 02:13:52 am »
Anyway. Resistance is futile! :-DD
 

Offline pgo

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Software guys, please, no.
« Reply #128 on: September 23, 2022, 02:25:20 am »
Hi @wrapper,
Just some comments on your calculations:

The output is designed to be able to supply at least the drive current selected while providing valid digital levels.  It is likely to be able to provide considerably more than that current value. This is equivalent to saying that the output will be designed to provide a voltage that is guaranteed to exceed the logic level required at that current. Your calculations assume the worse case for meeting the requirement which is unlikely to be the case.

In your calculations you have taken the minimum to be Vih (assuming driving high with a sinking load).  The actual value used in the chip design would be Voh since this is the specification for outputs.  This may seem strange but it is relevant spec i.e. For an output you have to use a drive spec. 
In any case, I agree that it is unlikely to exceed the Io(max) of 16mA.

Anyway the above it irrelevant for a properly designed circuit.  Unless the pin has been specifically design to be current limited (which the RPi aren't) you should use a series resistor:
  • It moves the power dissipation from the MCU to the resistor
  • When calculating LED currents you can use well defined  Voh(min)/Vol(max) values to calculate a meaningful and more consistent LED current
  • If you use different colour leds or even different batches it reduces the variations.  It also allows you to balance brightness between different colours.
  • The 'complexity' of a series resistor is trivial - I can't see any justification to not include one even in hobby circuits.  I don't believe that there is anyone who can't handle this level of complexity.

Some passing comments (unrelated to your post):
I am currently using a microcontroller that has GPIO pins that provide both multiple levels of drive current and slew rate control.  While the interact they are not the same thing and would not be implemented in the same fashion.
Drive capability relates to maximum safe capabilities while slew rate is rate of change.  You can change the latter by modifying the rate of change of the drive to the output stage (e.g. using feedback or capacitance) without affecting (steady-state) drive strength.

Finally, is the original YT worth all this aggravation? Yes - you shouldn't intentionally mislead people or claim technical knowledge that is absent.  Besides it doesn't take much effect :)
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16863
  • Country: lv
Re: Software guys, please, no.
« Reply #129 on: September 23, 2022, 07:08:08 am »
Hi @wrapper,
Just some comments on your calculations:

The output is designed to be able to supply at least the drive current selected while providing valid digital levels.  It is likely to be able to provide considerably more than that current value. This is equivalent to saying that the output will be designed to provide a voltage that is guaranteed to exceed the logic level required at that current. Your calculations assume the worse case for meeting the requirement which is unlikely to be the case.

In your calculations you have taken the minimum to be Vih (assuming driving high with a sinking load).  The actual value used in the chip design would be Voh since this is the specification for outputs.  This may seem strange but it is relevant spec i.e. For an output you have to use a drive spec. 
In any case, I agree that it is unlikely to exceed the Io(max) of 16mA.

Anyway the above it irrelevant for a properly designed circuit.  Unless the pin has been specifically design to be current limited (which the RPi aren't) you should use a series resistor:
  • It moves the power dissipation from the MCU to the resistor
  • When calculating LED currents you can use well defined  Voh(min)/Vol(max) values to calculate a meaningful and more consistent LED current
  • If you use different colour leds or even different batches it reduces the variations.  It also allows you to balance brightness between different colours.
  • The 'complexity' of a series resistor is trivial - I can't see any justification to not include one even in hobby circuits.  I don't believe that there is anyone who can't handle this level of complexity.
I didn't say it's the proper way to do it. Also I said I doubt those figures are correct without anyone pointing me that. What I meant is that not adding a resistor is not as preposterous as many posters in this thread make it seem. More like saying their arguments are flawed rather than agreeing with with Dave in the video. I personally would not recommend not using a resistor. However Dave very likely has GPIO current well below 16mA maximum rating and nothing bad will happen with his Raspberry Pi.
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 689
  • Country: gb
    • Electronic controls
Re: Software guys, please, no.
« Reply #130 on: September 25, 2022, 12:35:49 am »
Look on the bright side. If it wasn't for idiots, there'd be no merit in competence.

I am an electronics and software engineer.
I was busy so they took on a software guy to work on a project which was a Z80 based system with keyboard and screen.
For the life of him he couldnt get the keyboard to work reliably.
In the end he resorted to reading keyboard 100 times and took most often result.
I was asked to look at it after he had moved on.
Rookie mistake in that he sent out a row address then immediately read back column data.
The keyboard is on a long ribbon cable so there is a transmission delay.
A single "NOP" fixed the problem.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf