View previous topic :: View next topic |
Author |
Message |
erhane
Joined: 01 Jul 2014 Posts: 41
|
RS485 serial data send problem[SOLVED] |
Posted: Fri Oct 17, 2014 5:01 am |
|
|
When i want to transmit data for example send 'u' with putc('u'); command it sends ' ??u'
one blank two question marks than u.
there is codes and outputs.
//////////////////////////////////////
Code 1:
Code: |
while(true)
{
putc('u');
delay_ms(1000);
}
|
Code 1 Output:
??u ??u ??u ??u
////////////////////////////////
Code 2:
Code: |
while(true)
{
putc('u');
putc('u');
delay_ms(1000);
}
|
Code 2 Output:
??uu ??uu ??uu ??uu
//////////////////////////////////////
Code 3:
Code: |
while(true)
{
putc('u');
putc('b');
delay_ms(1000);
}
|
Code 3 Output:
??ub ??ub ??ub ??ub
What can be the reason? i thought about noise but it sends same message at all times thats is why this is not an issue of noise i think.
My RS485 transiever schematic is like this.
Last edited by erhane on Fri Oct 17, 2014 6:28 am; edited 2 times in total |
|
|
oxo
Joined: 13 Nov 2012 Posts: 219 Location: France
|
|
|
erhane
Joined: 01 Jul 2014 Posts: 41
|
|
Posted: Fri Oct 17, 2014 5:10 am |
|
|
this topic is not about proteus or isis |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Fri Oct 17, 2014 5:25 am |
|
|
Why did you start a new thread?
Go back and continue with the one you started on this subject. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
oxo
Joined: 13 Nov 2012 Posts: 219 Location: France
|
|
Posted: Fri Oct 17, 2014 5:31 am |
|
|
erhane wrote: | this topic is not about proteus or isis |
Sure it is. You are using the ISIS sim. You just edited your screenshot to conceal that. |
|
|
erhane
Joined: 01 Jul 2014 Posts: 41
|
|
Posted: Fri Oct 17, 2014 5:38 am |
|
|
dyeatman wrote: | Why did you start a new thread?
Go back and continue with the one you started on this subject. |
this is another problem as you can see. that one solved. |
|
|
erhane
Joined: 01 Jul 2014 Posts: 41
|
|
Posted: Fri Oct 17, 2014 5:43 am |
|
|
oxo wrote: | erhane wrote: | this topic is not about proteus or isis |
Sure it is. You are using the ISIS sim. You just edited your screenshot to conceal that. |
Dear oxo,
I do not need to hide anyhing. I am a CCS C Complier user and trying to find a solution to my problem this is all.
If you want to get some attention to another softwares you can post a new topic about it. Please do not use my topic. I am trying to find some help. |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Fri Oct 17, 2014 5:51 am |
|
|
Rename,
Ugh! Please come back when you have real hardware, as we don't dianose Proteus related problems. See the sticky at the top of the forum!
Also, it's obvious that you have spent NO time researching this issue, as your wiring for the RS-485 IC is contrary to that which is recommended.
There was a recent thread about this.....l.
John |
|
|
erhane
Joined: 01 Jul 2014 Posts: 41
|
|
Posted: Fri Oct 17, 2014 5:56 am |
|
|
ok i will send real hardware photos in 5 mins wait. I cant beleive that you are not beleiving me tis is ridiculous |
|
|
erhane
Joined: 01 Jul 2014 Posts: 41
|
|
Posted: Fri Oct 17, 2014 6:02 am |
|
|
ezflyr wrote: | Rename,
Ugh! Please come back when you have real hardware, as we don't dianose Proteus related problems. See the sticky at the top of the forum!
Also, it's obvious that you have spent NO time researching this issue, as your wiring for the RS-485 IC is contrary to that which is recommended.
There was a recent thread about this.....l.
John |
What about these?
|
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
|
Posted: Fri Oct 17, 2014 6:04 am |
|
|
Probably biassing resistors. RS485 has termination - the 120R resistor that MUST be at both ends of the bus, but NOT in the middle - and often biassing resistors - the pull-up and pull-down resistors that should only be in ONE place on the bus.
RS485 in half-duplex ("two-wire") configurations - the commonest arrangement - needs the biassing resistors. Full-duplex ("four-wire") configuration may not. In general any configuration where the drivers/transmitters are disabled must have biassing resistors to ensure the bus defaults to a proper state when nothing is driving.
The biassing resistors must be connected so that when not being driven the lower going signal is pulled low, and the higher going one is pulled up. This means when the bus is not driven it will be pulled to the inactive state. If the biassing is wrong the receivers will see spurious - "wrong" and unexpected - characters whenever a driver turns off.
RS485 suffers from confusion over which bus signal is which. Manufacturers of driver/receiver/transceiver ICs have never managed to agree on which signal is which and what they should be called. Perhaps the commonest naming is A and B, but some manufacturers, LT for example, call A, B and vice-versa, so requiring designers to connect their A pin to the B line on the bus. Others use other naming schemes such as + and -.
Here, TI have decided to use A and B for receivers and Y and Z for their transmitter. However, if you look carefully at the datasheet you'll see that TI use A as the non-inverting input and B as the inverting, and Y as the non-inverting output and Z as the inverting. However, you have A pulled up, BUT Y pulled down, and B pulled down, while Z is pulled up! I think, but I cannot be sure, that A and Z should be pulled up, and B and Y pulled down. I have spent a lot of time trying to troubleshoot a half-duplex RS485 network where the biassing had been swapped - it was very difficult to work out what the trouble was, I just got spurious characters.
Also there really should only be one pair of biassing resistors on an RS485 line pair. Where depends on the system configuration: on point-to-point and multi-driver, one receiver networks, it would make sense to put them on the receiver, while for single-driver, multi-receiver lines they make most sense on the driver. For half-duplex multi-drop peer to peer networks there's no clear choice, but like "highlanders", there can only be one. Short networks running at moderate speeds with more than one might work but the impedances will be messed up and won't work at high speeds or over long distances. The same goes for terminations - the 120Rs. They should only be at the ends of the lines, not in the middle. The clue's in the name "termination" - they terminate or "end" the transmission line.
So, to sum up: check the 560R biassing resistors. They don't look right. |
|
|
erhane
Joined: 01 Jul 2014 Posts: 41
|
|
Posted: Fri Oct 17, 2014 6:11 am |
|
|
Thank You,
I will work on it and i will share results. |
|
|
erhane
Joined: 01 Jul 2014 Posts: 41
|
|
Posted: Fri Oct 17, 2014 6:28 am |
|
|
Dear RF_Developer,
Thank you very much! i solved my problem with removing R21 and R22. Y should be pulled up and Z should be pulled down. it was vise versa. Now everything perfect =). |
|
|
|