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

synchronous communication with 232?

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



Joined: 10 Aug 2012
Posts: 1

View user's profile Send private message

synchronous communication with 232?
PostPosted: Mon Apr 15, 2013 12:08 pm     Reply with quote

I intend read the temperature of two probes (controlled by pics) and HMI (controlled by a pic) through RS232 protocol. Each of the probes is a 6m distance.
Would be possible a synchronous communication with 232? If so, where I can get information? would be possible some sample code? I work under CCS. Thanks a lot.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Apr 15, 2013 1:05 pm     Reply with quote

Possible yes , but pretty or NICE ? NO!!

Unless you are LOCKED IN to send or receive ONLY on the pic.

The EUSART section of the 16F 887 datasheet makes pretty clear what the bi-directional problem is - in the sharing of TX/RX pins with the sync clock.

I have never needed to do sync RS232 with a PIC
and hope i never do either.

Are your hands tied as to the SYNC data issue??
Ttelmah



Joined: 11 Mar 2010
Posts: 19537

View user's profile Send private message

PostPosted: Mon Apr 15, 2013 1:25 pm     Reply with quote

Start at the beginning.
RS232, is a _signalling standard_. Voltage levels, defining how a pattern of 1's and 0's can be signaled.
You can use RS232 signalling to send anything you want.

Now, the UART on the PIC, can in some cases send synchronous comms. How easy this is, depends on the PIC involved. This form of synchronous comms is very rare. Things like some IBM terminals, and not much else. The commonest 'synchronous' communication used by peripherals, is SPI.

Now the only reason to use synchronous would be if the peripheral wants this, perhaps needing a clock. If so, it is the devices data sheet that should be being looked at, to tell you what the timing requirements are. The peripheral is unlikely to use synchronous over RS232 (I doubt if anything has been produced in twenty years using this). Realistically if you are designing the interface yourself, then consider a much easier, and more reliable signalling standard like RS485.

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Apr 15, 2013 3:40 pm     Reply with quote

general comment

1) WHY synchronous? What do you think would be the benefit?

Temperature measurement is really,really,really slow.I can't think of a typical real world application that needs say microsecond reading of sensors,at least that anyone in this forum would need.

Usual applications here would be home heating, solar heating panels, swimming pool heaters,etc. Perhaps if you explained what you're measuring, I can advise you further.

All of the above are easily handled with sampling of 1 set of readings per minute(still overkill).

hth
jay
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