LowPowerLab Forum

Hardware support => Moteino => Topic started by: K1JOS on October 27, 2014, 01:27:08 PM

Title: Pulling Pin High then Low [SOLVED]
Post by: K1JOS on October 27, 2014, 01:27:08 PM
I am having intermittent problems interfacing to a MAX3485 (RS485) chip.  My outdoor "remote" MegaMoteino is communicating half-duplex with a proprietary device via RS485.  I send commands from my indoor base MegaMoteino to the remote which passes it on via RS485 and then it returns via RS485 a result which the remote Mega forwards to my base Mega.  My remote Mega must first keep the MAX3485 enable line LOW to receive and then when needed it sets the enable line to HIGH for transmit.  When I had these all on my wokbench everything worked fine but once I set up in the field the RS485 is not receiving.  I dragged out a portable scope to the remote site (the Mega and RS485 device work on a 5vdc 2A highly regulated supply off a 12v AGM battery) and found that the remote Mega can set the RS485 enable pin HIGH just fine (I read 3.3 vdc on my scope) but pulling the enable  LOW by setting the Megmoteino pin LOW is only bringing it down to about 1.6 vdc relative to ground.  The datasheet for the MAX3485 shows the high and low thresholds as 2v and 0.8v respectively so my 1.6v looks like it is a floating value.    Since the Mega can set the pin high I know there is no problem with the Mega.  I cant figure out why it all worked so well on my workbench.  Can I just add a 10-20k pull-down to ground on the pin?? Will that mess up things when I need to set it HIGH for transmit?

thanks in advance for any advice
Jerry

Title: Re: Pulling Pin High then Low
Post by: Felix on October 27, 2014, 02:18:08 PM
Do the two ends have a common ground?
I would think a 10K is a pretty weak pullup but should pull a floating 1.6V down to GND, it would not hurt to try short of any other ideas...
Title: Re: Pulling Pin High then Low
Post by: K1JOS on October 27, 2014, 02:25:58 PM
Hi Felix,

Thanks, yes there is a common ground between my MAX3485 / Mega board and the RS485 devices MAX485 on the device.  The device uses the 5v chip (MAX485) while I am using the 3.3v chip itds a 3 wire connection - the two differential lines plus ground.  Maxim designed the lower voltage MAX3485 to handle the 5v differential lines but that shouldnt affect the pull up or pull down.  I am going to try the 10k tied to ground and see how that works.
Title: Re: Pulling Pin High then Low
Post by: K1JOS on October 27, 2014, 03:04:25 PM
I just checked with the Mega/Max3485 powered off.  The resistance between ground and MAX3485 enable pin was about 600 ohms.  I then pulled the MAX3485 from the circuit and it still was about 600 ohms - this would be the resistance between ground and the Mega pin (I am using 22) I am setting to toggle HIGH and LOW.  Not sure what a 5k or 10K resistor to ground would add unlessd when the Meg is powered up this becomes a higher impedance on the Mega pin to ground??

Any advice ??
Title: Re: Pulling Pin High then Low [SOLVED]
Post by: K1JOS on October 28, 2014, 06:13:14 PM
I added a 4.7K resistor tied to ground to the Mega pin enabling the MAX3485 and now all seems to work fine.  Dont know why the Mega could pull it down to ground alone but the pull-down resistor has been working well all day in testing.

thanks Felix