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

Communication between two PIC with single-wire

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



Joined: 16 Jul 2013
Posts: 37

View user's profile Send private message

Communication between two PIC with single-wire
PostPosted: Wed Apr 23, 2014 1:43 pm     Reply with quote

Greetings.
Can you write me an example of communication between two PIC (any 8 bit) with a single wire. I looked on the internet, I tried to write code, but I did not succeed. I know there is a solution but I'm not so "strong" in programming and I ask for your help.
Thank you in advance.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Wed Apr 23, 2014 1:57 pm     Reply with quote

Hi,

Bi-directional communications?

A 'single wire'? A *true* single wire, or a single wire plus Gnd?

John
strsh



Joined: 16 Jul 2013
Posts: 37

View user's profile Send private message

PostPosted: Wed Apr 23, 2014 2:04 pm     Reply with quote

For starters, one-way communication transmitter-receiver.
I have three wires 1-GND, 2 - VCC, 3 - communication.
I apologize if there are grammatical errors. I write through Google translator, but I hope it is understandable.
Thanks for your prompt response.
temtronic



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

View user's profile Send private message

PostPosted: Wed Apr 23, 2014 2:53 pm     Reply with quote

Have a look in the FAQ section of the CCS C manual. They give a good example on how to do it !!!

There are other methods,but for short distances it's a very good place to begin.I'm assuming you only need a meter or so distance ?

I've done true single wire communications for 25+ years,up to 15 miles on a single wire,not fast but ultra reliable.

hth
jay
John P



Joined: 17 Sep 2003
Posts: 331

View user's profile Send private message

PostPosted: Wed Apr 23, 2014 4:51 pm     Reply with quote

Check out Roman Black's "Blacknet" system:
http://www.romanblack.com/blacknet/blacknet.htm
temtronic



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

View user's profile Send private message

PostPosted: Wed Apr 23, 2014 6:49 pm     Reply with quote

A couple decades ago Motorola had an 'addressable UART' (MC14469 ?),there's an application note about using it in 'single wire' mode.Should be easy to get a PIC to work very similarly though Black's design is very similar !

The more you read, the better choice you can make.

Best teacher though is a breadboard and time to experiment.

hth
jay
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Apr 24, 2014 9:51 am     Reply with quote

Why not use 2 wires?


Power w/data signal riding on top and GND?

Also, you could look up Dallas Semi's 1wire protocol for ideas.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Thu Apr 24, 2014 2:56 pm     Reply with quote

A while back i posted this:

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

Which does a single byte, over a single wire, on any pin.

It relies on Software serial, so it has the same flaws, like not being interrupt friendly.

I was attempting to improve software serial by reducing the waiting time the PICs are stuck on the software serial routines.
I leave it to others to decide if i succeeded or not, or if this is helpful in any way.


EDIT: That "Blacknet" was a nice read!

G.
_________________
CCS PCM 5.078 & CCS PCH 5.093
temtronic



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

View user's profile Send private message

PostPosted: Thu Apr 24, 2014 8:00 pm     Reply with quote

hmmm....from the OP, 2nd entry....

"For starters, one-way communication transmitter-receiver. "

We're over complicating things guys....

simple 'putc()' for the xmt..

simple 'getc() for the rcv..

should do fine.
basic 'rs232' type communications

examples are in the FAQ section of manual( I think.been a loooong day)


hth
jay
strsh



Joined: 16 Jul 2013
Posts: 37

View user's profile Send private message

PostPosted: Sat Apr 26, 2014 6:23 am     Reply with quote

Thanks for your answers.
You helped me with your suggestions to establish one-way communication between the two PIC with RS232 protocol. Thank you.
Greetings.
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