View previous topic :: View next topic |
Author |
Message |
ZeNeR
Joined: 10 Aug 2012 Posts: 1
|
synchronous communication with 232? |
Posted: Mon Apr 15, 2013 12:08 pm |
|
|
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
|
|
Posted: Mon Apr 15, 2013 1:05 pm |
|
|
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: 19536
|
|
Posted: Mon Apr 15, 2013 1:25 pm |
|
|
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
|
|
Posted: Mon Apr 15, 2013 3:40 pm |
|
|
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 |
|
|
|