Author Topic: The importance of pull-down resistors.  (Read 6532 times)

0 Members and 1 Guest are viewing this topic.

Offline JoshuaTopic starter

  • Regular Contributor
  • *
  • Posts: 194
  • Country: us
The importance of pull-down resistors.
« on: December 05, 2010, 02:35:17 am »
So today I was trying to hook up a rc controller, which has 4 analog outs, and 3 digital ins, to my arduino. I was trying to make it calibrate the analog inputs(pots), whenever I flipped a switch.


It didn't work.

I messed with this thing for a good hour and a half wondering why it kept going into 'calibrate mode' randomly.

And then it hit me, I forgot a pull-down resistor!  >:(


I just whacked in a 10k, and now it works perfectly.


At least I probably won't make this mistake again. (yeah, suuuure  ;))


Joshua
 

Offline Zad

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: gb
    • Digital Wizardry, Analogue Alchemy, Software Sorcery
Re: The importance of pull-down resistors.
« Reply #1 on: December 05, 2010, 04:16:11 am »
What matters is not how you fall down, but how you pick yourself up ;)

Finding the cause of a relatively small problem like that, may well stop you making the same problem in the future, where the consequences may be more expensive. Things that work are boring, but things that don't work teach us stuff!

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19743
  • Country: gb
  • 0999
Re: The importance of pull-down resistors.
« Reply #2 on: December 05, 2010, 09:50:15 am »
Do you actually know why the pull-down resistor solved the problem though?
 

Offline Neilm

  • Super Contributor
  • ***
  • Posts: 1551
  • Country: gb
Re: The importance of pull-down resistors.
« Reply #3 on: December 05, 2010, 11:34:36 am »
I remember I once had a system using a Xilinx FPGA that would "lock up" every so often. There was a source of RF near by that was the cause, but due to how the system worked I couldn't get rid of it, and shielding it didn't work well enough. Eventually I realised that the FPGA was going into a programming mode (which is why it appeared to latch). Changing the pull up resistors on the JTAG programming port to pull down resistors fixed the problem, the RF was upsetting the supply line and causing the FPGA to see pulses on the JTAG input, putting it into a programming mode.

Neil
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein
Tesla referral code https://ts.la/neil53539
 

Offline the_raptor

  • Regular Contributor
  • *
  • Posts: 199
Re: The importance of pull-down resistors.
« Reply #4 on: December 05, 2010, 12:01:29 pm »
Do you actually know why the pull-down resistor solved the problem though?

Because the value of one of the control lines was floating and randomly telling the controller to go into calibrate mode?
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19743
  • Country: gb
  • 0999
Re: The importance of pull-down resistors.
« Reply #5 on: December 05, 2010, 12:06:15 pm »
You're right but I wanted the original poster to answer the question.
 

alm

  • Guest
Re: The importance of pull-down resistors.
« Reply #6 on: December 05, 2010, 02:15:53 pm »
You could also connect the switch between input and ground, then you can use the internal pull-up in the ATmega. Saves one part ;). This is the reason for preferring active low over active high.
 

Offline migsantiago

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: 00
    • MigSantiago's Web Site
Re: The importance of pull-down resistors.
« Reply #7 on: December 05, 2010, 03:03:00 pm »
The Atmel uC should have internal pull-ups, shouldn't it? Aren't they implemented in the Arduino processing code?
 

Offline JoshuaTopic starter

  • Regular Contributor
  • *
  • Posts: 194
  • Country: us
Re: The importance of pull-down resistors.
« Reply #8 on: December 06, 2010, 04:54:54 am »
Do you actually know why the pull-down resistor solved the problem though?


Hero, Yes. It is because other wise the pin is 'floating', so with the pull-down resistor, it is tied to ground, but when you flip the switch and make it high, the 10k prevents a large current flowing through the short.

If there is something other than this that I have missed, please share, as I am very eager to learn, and not just plug in stuff. In other words, I'd rather know why I need a pull down resistor, and why I need it, than just know I have to have one.

[/quote]
The Atmel uC should have internal pull-ups, shouldn't it? Aren't they implemented in the Arduino processing code?


I am not sure. This sounds slightly familiar. Something tells me that you have to enable it in the code, though. (That could be wrong)


Joshua


 

Offline the_raptor

  • Regular Contributor
  • *
  • Posts: 199
Re: The importance of pull-down resistors.
« Reply #9 on: December 06, 2010, 06:13:28 am »
The Atmel uC should have internal pull-ups, shouldn't it? Aren't they implemented in the Arduino processing code?

From what I have seen mucking around with my Arduino the pin values tend to spaz out for a second or two on start-up/programming. So if you have an Arduino giving input to another device I wouldn't rely on the internal pull-ups.
 

Offline Hypernova

  • Supporter
  • ****
  • Posts: 655
  • Country: tw
Re: The importance of pull-down resistors.
« Reply #10 on: December 06, 2010, 07:44:58 am »
Probably the same as xmega's, HI-Z totem pole output low on boot up. Pull ups and pull downs need to be specified.
 

Offline migsantiago

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: 00
    • MigSantiago's Web Site
Re: The importance of pull-down resistors.
« Reply #11 on: December 06, 2010, 02:55:24 pm »
The Atmel uC should have internal pull-ups, shouldn't it? Aren't they implemented in the Arduino processing code?

From what I have seen mucking around with my Arduino the pin values tend to spaz out for a second or two on start-up/programming. So if you have an Arduino giving input to another device I wouldn't rely on the internal pull-ups.

That shouldn't be a problem. Pull-ups are meant for inputs. You shouldn't connect anything that has to be driven in that pin. Pull-ups are weak, not power oriented.

I am not sure. This sounds slightly familiar. Something tells me that you have to enable it in the code, though. (That could be wrong)
Joshua

Pull-ups should be software enabled. Go read the uC datasheet.  ;)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf