Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

10K pull-down on COM1 RX


  • Please log in to reply
2 replies to this topic

#1 Spork

Spork

    Advanced Member

  • Members
  • PipPipPip
  • 105 posts

Posted 26 December 2011 - 11:35 PM

Hi, I've built a shield for my N+ which includes a stereo audio jack. I have another device that also has a stereo audio jack over which it sends/receives 5V TTL data/commands. So, I connect the two using a short stereo audio cable. I want the N+ to be able to tell when the other device is connected and powered. So, I connected N+ D0 to D4. D0 and D1 will be used for serial, but I create an InputPort on D4 to monitor the voltage. When the other device is connected and powered, the InputPort returns true. GOOD. When the other device is connected and not powered, the InputPort returns false. GOOD. When the other device is not connected, I usually get true, which isn't what I want. BAD. In the third case, I think I was getting true because D0 and D4 were floating. So, I thought I'd try the Port.ResistorMode.Disabled option on D4's InputPort to see what would happen. I got an exception and now know that Netduino (or it's ARM) doesn't have the pull-down option. So, instead, I connected a 10K resistor from D4 to GND. The 10K pull-down seems to do what I want it to do. When the other device is not connected, the InputPort on D4 returns false (good). When the other device is connected, it works as before and the value depends on whether it's powered on or off (good). I used my DSO Nano to see if this had somehow messed up the serial signal, but it still looks good. If it's valid to use a pull-down in this situation, I think I'd want the highest resistance possible that gets the job done. The biggest I had on hand was 10K. Is that adequate? What sort of questions should I be asking myself that I'm not? It seems, to me, that the only difference with the 10K in place is that there would be .5 mA flowing to ground when the other device is connected and powered, and I don't imagine that would cause any problems. So, here's the sanity check part: Did I actually get this right? Thanks, in advance, for your input.

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 27 December 2011 - 05:38 AM

Hello Spork.
The pull-down can be a good way, as long there's no (embedded) pull-up fighting on the same line.
To be pretty sure on that, you could use your DSO or a multimeter to check how much is the voltage when the jack is unplugged. I'd suggest to register the levels in all the cases, though.
If the voltage, across the RXD and ground, is less than the high-bound threshold for the "low" level, the resistor is okay. Otherwise, you should try to choose another value, or another solution.

I'd give you an alternative approach, just FYI.
Instead the jacks, you could use the DIN-connectors, which are much more reliable, and versatile than the jacks. Often the jack isn't reliable about the contact, and inherently causes a short across the signal during the insertion/removal.
Instead, using a 5-poles DIN for example, you might use 2-3 poles for your signals, and another for detect when the plug is actually in. Fori nstance, consider to have the pin #2 shorted to the ground at the plug level: when it's inserted the N pin D4 could read the level on the socket, which will remain totally independent from the useful signal.

Hope it helps.
Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Spork

Spork

    Advanced Member

  • Members
  • PipPipPip
  • 105 posts

Posted 28 December 2011 - 02:36 AM

Thanks, Mario. I hadn't ever really thought about DINs vs jacks. I went with the latter since the device I'm connecting to comes from a third party and their product already had a hack. So using a jack on the N+ side seemed convenient and didn't require a special DIN-to-audio cable that I'd probably need to make myself. Once I get my project done, I hope that other people will use it, so I'm trying to minimize the need for things like non-standard cables.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.