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 support@ccsinfo.com

Easiest way to setup communications? RS232?

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



Joined: 21 Jan 2004
Posts: 4

View user's profile Send private message

Easiest way to setup communications? RS232?
PostPosted: Mon Jan 26, 2004 10:01 pm     Reply with quote

I've not yet done any communication between 2 pics. From what I understand, it isn't extremely difficult, but I am hesitant to proceed on my own. I am guessing that the built in RS232 communication is the best, but I have a few questions before using it.

First - here is my setup -
One PIC is acting as a Timer and score collector from the judges watching the match, taking care of the main controls.

The second PIC is running the score board - telling it what to update the scores and times to be.

I'd like it if I could alway send the information in a constant manner - I.E.

Time - Round - Score A - Score B - Extra Command (Ring Buzzer, etc)

I am hoping to avoid using the TBE interrupt...

So, where do I start?
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Tue Jan 27, 2004 8:19 am     Reply with quote

You need a comunication protocal that comunicates in packets of data. I suggest you design your own because your needs are very simple and consistant. You can download MODBUS protocal specifications and get some ideas from it. It is availabe from www.modbus.org
DarkKobold



Joined: 21 Jan 2004
Posts: 4

View user's profile Send private message

PostPosted: Tue Jan 27, 2004 10:45 pm     Reply with quote

That modbus site confused me greatly...

Is RS232 communication too difficult for a small usage? What circuitry does it require?
Jannie Hamman



Joined: 16 Sep 2003
Posts: 6
Location: South Africa

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

PIC to PIC comms
PostPosted: Wed Jan 28, 2004 12:15 am     Reply with quote

Laughing Look at the help file of CCS PCW! All is explained there...
_________________
Cheers,

Jannie
Ttelmah
Guest







PostPosted: Wed Jan 28, 2004 3:27 am     Reply with quote

DarkKobold wrote:
That modbus site confused me greatly...

Is RS232 communication too difficult for a small usage? What circuitry does it require?

Understand, 'RS232', 'RS485' etc., are descriptions of 'signalling standards'. They describe the voltages to be used to send a signal, together with other features (how many receivers can exist, and the 'range' for given data rates etc.). Then seperately, there is the 'protocol'. This describes the actual 'format' the data is sent, with 'headers', the data itself, and methods to verify that the data is intact (checksums, parity etc.).
Now the PIC chip, generates a standard asynchronous serial stream, using TTL levels, directly from the chip. To turn this into 'RS232', simply requires a 'transceiver' chip (this inverts the signals, and increases the voltages to the levels required by 'RS232'). Depending on the enviroment involved, such a transceiver can be as simple as a DS275, which is a single 8pin chip, giving 'pseudo RS232' levels, with one transmit buffer, and one receive buffer. Now I say 'pseudo RS232', this chip 'steals' voltage from the incoming receive line to power the transmit line. The next step 'up', are chips like the MAX232. This has two receive buffers and two transmit buffers (allowing a 'handshake' line to also be generated), and a small power supply circuit to generate the +/-12v required for RS232 transmission. The original version, needed capacitors externally for this power supply, but latter variants reduced the size of these (MAX232A only needs 0.1uF), and the MAX233, runs without any external capacitors, making the circuit very simple indeed.
So you need two seperate things. The hardware transceiver, that then allows you to 'signal' at RS232 levels, and then the protocol, to determine how the data is sent. The 'simplest', would just involve you sending something like a 'description' character, and a block of text, with the actual 'values' involved, with no checksum etc.. Proper 'protocols' (like Modbus), contain all the extra 'goodies' to go round the outside.
Think of 'RS232', a bit like the 'tones' used for morse. Then the serial data, is the 'code' itself, with the 'protocol', being the language/keywords used to send the message.

Best Wishes
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