CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RS485 serial data send problem[SOLVED]

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
erhane



Joined: 01 Jul 2014
Posts: 41

View user's profile Send private message Send e-mail

RS485 serial data send problem[SOLVED]
PostPosted: Fri Oct 17, 2014 5:01 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 17, 2014 5:05 am     Reply with quote

Proteus or ISIS not allowed here

http://www.ccsinfo.com/forum/viewtopic.php?t=47549
erhane



Joined: 01 Jul 2014
Posts: 41

View user's profile Send private message Send e-mail

PostPosted: Fri Oct 17, 2014 5:10 am     Reply with quote

this topic is not about proteus or isis
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Fri Oct 17, 2014 5:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 17, 2014 5:31 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Oct 17, 2014 5:38 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Oct 17, 2014 5:43 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 17, 2014 5:51 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Oct 17, 2014 5:56 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Oct 17, 2014 6:02 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 17, 2014 6:04 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Oct 17, 2014 6:11 am     Reply with quote

Thank You,

I will work on it and i will share results.
erhane



Joined: 01 Jul 2014
Posts: 41

View user's profile Send private message Send e-mail

PostPosted: Fri Oct 17, 2014 6:28 am     Reply with quote

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 =).
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group