Log in

View Full Version : serial communication speed



Davidpower
- 16th October 2007, 08:50
Hi you all out there!

I want for structural simplicity reasons and caused by the fact that I´m a bad programmer ease my solution by following structure:

a single high speed PIC , maybe a 18F1320 gives the commands via output to my coils etc...

but to get all the correct inputs I will use small PICs up to four which get the data (engine speed, temperature, manifold pressure, throttle position)put it into a word variable and send it to the main pic which makes the right decision.

the small 12F629 could handle that only serial, so I need to know how long it takes for the main Pic to read three serial words and how they communicate so not to interfere. Do the Pics need the same oscillator frequency? could they be synchronized by using only one crystal?

Jerson
- 16th October 2007, 09:51
You could try using RS485 communications if the boards are far apart. a master slave topology will help with the 18F1320 being the master.

As for speed, you have to spell out your requirement and then check if the processor goes fast enough. Another thing, if you send the data as binary, it will need time for just 3 words + protocol overhead. If the same data is sent as ASCII formatted data, you will spend longer sending it since 1 word will become 4 Hex digits.

You do not need to synchronize to the same crystal, except the baud rate should match

Jerson

Davidpower
- 16th October 2007, 17:28
Thanks, but I don´t know how fast that means.....how many crystal tics or how many micrseconds. The thing is I try look how fast the processor is and determine how much i could pack into the software.....i try to do so...
the pics are all on one small board max 2 inches apart. dream clock speed is 20 Mhz for the master Pic, the small 12F629 just need 4 Mhz.

If the speed is very fast, say 200 microseconds for one complete "Master-slave-Info-cycle" I could use a 36 teeth inductor wheel which gives me fantastic acurracy. Otherwise i have to use the 4-tic per engine cycle wheel and have to interpolate.