Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

HELP: RS485 communication not working!

Status
Not open for further replies.

abicash

Member
Hello

I wrote a MODBUS routine which sends some readings over RS485 to a PLC(currently a PC RS232 port).

My SETUP ->
I have a PCMCIA-RS232 on my notebook PC.
MBPOLL utility on PC.
Microcontroller running all code.
MAX232 level shifter.
SN75176 (485 comm) as Half duplex with direction control with MCU Port pin.
RS485-RS232 converter.

What works ->
Direct 232 connection from MAX232 to PC works and MBPOLL is happy with no errors.

What doesn't->

When i use MCU->SN75176->485-232 converter->232-PCMCIA->MBPOLL

MBPOLL is not happy with timeout errors.
Whenever i am transmitting , i push the DIR port-pin high (DE-RE on SN75176 shorted and connected to this pin)
all the other time, this pin is low.
I saw that my MCU receives the requests from the MASTER in the buffer, and updates the response values immediately in the buffer.It just doesn't get through.

I have terminated the A-B lines with a 120Ω resistor.
Earlier I have tried pulling up B line and pulling down A line to no avail.
I can see communication with a DSO , and see that the DIR pin is high for all the transmit waveform and low for the receive.

Please guide me, whether i am missing some point, or anything more needs to be done.

Thanks and regards
 
Further update:
I am not able to see any receive bytes on serial port monitor.
Attaching the picture of the DSO image across A&B.
 

Attachments

  • IMG_20150408_151852.jpg
    IMG_20150408_151852.jpg
    1.7 MB · Views: 486
Have you tried it like this you need the 120 bias on both ends
2010123112142771.jpg
 
I have been informed that when RS232 convertors are being used you have to ditch the terminating resistor as the bus hasn't enough power.. I put 4k7 pulldown to B and 4k7 pullup top A....

How are you driving the Re and De pins... These should be connected to the RTS on the PC side and connected to a pic pin on the pic side... They CANNOT be left floating...
 
Hi Ian
I tried removing that resistor with no change in behavior.
I have 1k as pull up and pull down on A & B respectively.
RE-DE is tied to a Port pin.

I tried sending a character in loop. But it doesn't go through.
Did it mean the converter is bad?
 
Ian, it doesn't get hot.

Tony, I would request you to read my first post. It works when directly connected to RS232.
 
I tried sending a character in loop. But it doesn't go through.
Did it mean the converter is bad?
?? Which RS485 chip are you using.... 2 or 4 wire??

Have you some code to look at?
 
Earlier I have tried pulling up B line and pulling down A line to no avail.
This is also the wrong way round.... B has to have pull down and A Pullup as Burt's diagram..
 
Ian, that was typed incorrectly.. In a later part, I have corrected my statement.
I am using SN75176 ,2 wire half duplex.
Please read my first post.
 
Your not posting enough details to help.
I have a pic hooked to a "MCU->SN75176->485-232 converter->232-PCMCIA->MBPOLL " that doesn't say much or show how its wired up or what 485 to rs232 converter your using. And your scope picture where that scope hooked at on the two line 485 I guess it looks like the line is pulled high.
And 1 Kohm isn't like my wiring that I posted and got just a "YES".

It worked Rs232 to Rs232 because you have it my guess wired wrong from the SN75176 to the converter.
Or your sending the data inverted. on the 485 side, or like Ian said the pic isn't using the DE and RE line to tell Its sending.
 
Hello
And I apologize if I felt a bit short in providing information.
The schematic that you posted matched mine and I was typing on a mobile phone so I posted a 'yes' since I didn't wanted to bloat my post.

On the wiring part you mentioned, I have tried swapping A&B , so that can be ruled out.
I definitely don't invert data.

I checked DE-RE pin on scope. It definitely turns high for transmit part and low for receive.

I have started doubting the converter since yesterday I only sent a character 0x35 continuously, which was never received on the terminal.

Again thanks for being supportive, it means a lot and please forgive me if anything amiss or if you feel I am overbearing.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top