RS485 device to Javelin?
Hi,
I have a device (Solar panel controller) which is sending status every seconds on a RS-485 bus that I would like to read from the Javelin.
Is there an easy way to do that? Or will I have to by a 232 <-> 485 converter to connect between the 2?
I already have some components like a MAX232 and MAX485 but I don't really know how to use them [noparse]:([/noparse]
Can anyone help me with that?
Thanks,
Jean-Marc
I have a device (Solar panel controller) which is sending status every seconds on a RS-485 bus that I would like to read from the Javelin.
Is there an easy way to do that? Or will I have to by a 232 <-> 485 converter to connect between the 2?
I already have some components like a MAX232 and MAX485 but I don't really know how to use them [noparse]:([/noparse]
Can anyone help me with that?
Thanks,
Jean-Marc
Comments
pins don't have the drive capacity.
Attached are my Uart485 class that extends the Uart class.
And UartTools class to provide parity if you need it.
Also my adapted Uart class.
If you use the Uart class that came with the IDE, rename it to Uart_org.java
Then download attachements to folder ...\lib\stamp\core
The file Uart485.java has comments how to connect the driver chip.
regards peter
I never tought it's so simple.
I already have a MAX485. So I will try today.
On MAX side, where should DE be connected? Is it with /RE and rwPin?
Also, since I also need to read on the RS485, do you think I can get rid of rwPin, connect /RE to DE to the ground, and simply use DI and RO with dqPin? If so, I will try to to a Uart485RO.java...
Thanks again for you assistance!
JM
You need rwPin to switch between transmit and receive
regards peter
I tried to do a ReadOnly version based on the version you send, but I ended with pretty empty.
I removed everything related to the direction and the RW pin.
Look like if we want to do a RS485 ReadOnly device, we just need to use the correct wire and the Uart class directly, correct? So a Uart485RO class is useless...
JM
connect RO to dqPin, you can leave DI disconnected.
Then you can simply use a receive Uart using dqPin, as you said.
regards peter
Thanks for your prompt reply.
If I don't connect dqPin anymore to DI, should I still use the 1K resistor to RO?
Thanks,
JM
you make that pin an output by mistake.
regards peter
Perfect.
Thanks a lot!
JM