Post B8EtZbeOUYs8wNvsJc by tk@bbs.kawa-kun.com
 (DIR) More posts by tk@bbs.kawa-kun.com
 (DIR) Post #B8BHfeHleTtvtJMNDU by tk@bbs.kawa-kun.com
       0 likes, 0 repeats
       
       Kind of stumped here.  Trying to use the #RaspberryPi UART with a MAX-485 board to talk to a Raspberry Pi Pico 2, also with a MAX-485.When I use a USB RS-485 interface to read from the Pico, the data correctly looks like this: 06 00 01 00 0ABut when using the Raspberry Pi + MAX-485, it looks like this: 00 06 00 01 00 0ANot sure where that extra leading null byte is coming from. :blobfoxsad: :BoostOK:
       
 (DIR) Post #B8CJyAZSkSZyIkYVlI by sibrosan@mastodon.social
       0 likes, 0 repeats
       
       @tk do you have, beside termination resistors, failsafe bias resistors in place? Without the latter, the logic level received on the UART input, when the other side is not yet driving the RS-485 bus, might be low, and this might be interpreted by the UART as a 0 frame.https://www.analog.com/en/resources/technical-articles/rs485-cable-specification-guide--maxim-integrated.html
       
 (DIR) Post #B8CJyAmvwNM2yWrGl6 by tk@bbs.kawa-kun.com
       0 likes, 0 repeats
       
       @sibrosan The MAX-485 modules I'm using already include all that from what I can tell.
       
 (DIR) Post #B8CeWFr7bVxlcZLVlQ by sibrosan@mastodon.social
       1 likes, 0 repeats
       
       @tk 20kR is high, but the datasheet says the receiver has fail-safe feature so they may not even be necessary.Only the device at each end of the bus should have the termination resistor, remove it on any additional ones, see fig. 21 MAX485 should be powered by 5V but RPI is 3.3V logic so you should use a resistor divider on RO to protect it. You could try one with 1.8k and 3.3k. Input level on DE, DI, RE for high is >2.0V so they'd work with 3.3Vhttps://www.analog.com/media/en/technical-documentation/data-sheets/MAX1487-MAX491.pdfhope that helps
       
 (DIR) Post #B8CeXMk5UAKpGjaMsa by tk@bbs.kawa-kun.com
       0 likes, 0 repeats
       
       @sibrosan I don't have any other devices at the moment, so terminating at both ends should be fine.I do have a voltage divider on RO, so the incoming voltage is 2.8V when RO is high.
       
 (DIR) Post #B8CxqHKPjmUJ6nJD9c by sibrosan@mastodon.social
       1 likes, 0 repeats
       
       @tk Now an oscilloscope would be really handy to see what's going on 😉
       
 (DIR) Post #B8EtPrhhx0dXpkpzcm by tk@bbs.kawa-kun.com
       0 likes, 0 repeats
       
       @sibrosan So it looks like both in the case where I have nothing connected to the Pico's MAX-485 module, and when I have the Pi's MAX-485 module connected to it, there's noise of the magnitude from -300 to 300 mV or so on the RO pin, while when I have the USB RS-485 interface connected to it, there's a ~488 mV bias and the voltage ranges from 340 to 540 mV.  Sounds like the pull-up resistor needs to be a bit smaller in the MAX-485 units.
       
 (DIR) Post #B8EtZbeOUYs8wNvsJc by tk@bbs.kawa-kun.com
       0 likes, 0 repeats
       
       @sibrosan The bias on the RS-485 B- is around 200 mV with the USB interface connected.  Otherwise, there's a noise of higher magnitude.
       
 (DIR) Post #B8EuYA4PeKFJ4Ayf3Y by sibrosan@mastodon.social
       1 likes, 0 repeats
       
       @tk Aim for 750 ohms (total parallel) pull-ups and pull-downs to get 200 mV differential voltage (the maximum threshold voltage for the diff inputs) I remember this from a project I worked on ~40 years ago 🙄 Although the data sheet says the bias resistors are not needed, I guess that might be incorrect.
       
 (DIR) Post #B8FQYHTzHr40aa2aBM by tk@bbs.kawa-kun.com
       0 likes, 0 repeats
       
       @sibrosan Unfortunately, 750 ohms total for each caused the IC too overheat and die.  Same with 1500 ohms.  I have it set up with around 10500 ohms total for each now and it's not any better than without the resistors at all.
       
 (DIR) Post #B8FTF8DLp1ZeCiorzs by tk@bbs.kawa-kun.com
       0 likes, 0 repeats
       
       @sibrosan (I have several of these RS-485 modules.)
       
 (DIR) Post #B8GY8RKR3EAaO6inY0 by sibrosan@mastodon.social
       1 likes, 0 repeats
       
       @tk The original MAX485 was made by Maxim Integrated which was later acquired by Analog Devices.According to the AD product page, its MAX485 has "Short Circuit Current Limited DriverIntegrated Thermal ShutdownReceiver Fail-Safe for Input Open CircuitGuarantees Logic High"It sounds like the IC on this board has similar function to the original MAX485, but is in a number of ways not its equivalent...