Subject:
|
Re: Brainstorms
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sun, 11 Aug 2002 06:47:16 GMT
|
Viewed:
|
895 times
|
| |
| |
Steve:
Everything is a compromise. Here is a discussion of the issues
that caused us to pick 2400 baud for RoboBricks:
1) Most of the various PIC's that we use (PIC12C509A, PIC12C672,
PIC16C505) run at 4MHz. The 4MHz clock rate is divided by 4
to yield an instruction cycle (i.e. a 1 MIPS processor.)
Since there is no on board UART, we have to bit-bang
(that's a technical term ;-) the serial protocol. It turns
out we sample at a third of a bit time. (Yeah, we know about
Nyquist sampling criteria saying we only need to sample
4800 times a second, but it turns out to be a lot more
reliable to over sample by 50%.) Thus, we are sampling
3 x 2400 = 7200 times a second. 1/7200 = 139uS = 139 cycles.
Basically, we have to do all of our repetitive stuff in just
139 instruction cycles. If we go up to 4800 baud, we're down
to 70 instructions for the repetitive stuff. 70 instructions
wasn't enough, but 139 instructions was. Otherwise, we might
be running even slower at 1200 baud.
2) Even if we were to have used chips that had on-board UART's we
run into problems with the host processors ability to send
bytes and receive them. For example, the Basic Stamp 2 (tm)
from Parallax (tm) uses the SERIN and SEROUT commands to send
and receive serial data on a pin via bit banging. It takes a
finite amount of time for the BS2 go from a SEROUT command to
a SERIN command. At 2400 baud, this line turn around time
is workable. At faster baud rates, we get into having to
put delays in the slave RoboBrick modules to allow for line
turn around time.
3) Surprisingly enough, since the RoboBricks are doing all of
the time critical stuff, the time latency introduced by
communicating at a relatively slow 2400 baud is not very critcal.
We tend to send more behavioral commands like `set motor
speed to 3/4 forward' and `what is the last distance read
from the sonar sensor'.
4) We have something called the `Interrupt Protocol' for
improving upon polling at 2400 baud for high priority
inputs like bump sensors and table edge detectors. You
can read up on that portion of the specification at:
<http://web.gramlich.net/projects/robobricks/specifications.html#Interrupts>
With the interrupt protocol, you can configure your
central processor to generate an interrupt when your bump
or edge sensor triggers, with a delay measured in microseconds.
5) I should mention that the neurons that we humans use are not
particularly fast either. We seem to get along just fine
with significant delays from remote sensors in our toes
to our brain and back.
6) Having said all of that, if I could have gotten it to run
at a faster speed, I would have done so. I have toyed with
the idea of a RoboBrick 2 specification that runs at faster
baud rates and requires hardware UARTS for everything.
However, the current modules seem to work well enough, so
I there has not been much more than thought exercises so
far.
Hopefully, that gives some insight into the 2400 baud selection
for RoboBricks.
-Wayne
In lugnet.robotics, sjbaker1@airmail.net writes:
> Wayne Gramlich wrote:
>
> > http://web.gramlich.net/projects/robobricks/index.html
>
> On cursory reading, the first problem I have with this is that
> the interconnect protocol is run so slowly.
>
> Why only 2400 baud?
>
> Anything where you have an actual copper wire connection
> could run orders of magnitude faster. Heck even iRDA goes
> faster over infraRed.
>
> ----------------------------- Steve Baker -------------------------------
> Mail : <sjbaker1@airmail.net> WorkMail: <sjbaker@link.com>
> URLs : http://www.sjbaker.org
> http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
> http://prettypoly.sf.net http://freeglut.sf.net
> http://toobular.sf.net http://lodestone.sf.net
|
|
Message has 1 Reply: | | Re: Brainstorms
|
| (...) <snipped some reasonable arguments> This is why I recommend that 'brainstorms' goes with something like I2C. That protocol is fast and built into the chip. No software serial I/O is ever needed and every chip already speaks the protocol so (...) (22 years ago, 11-Aug-02, to lugnet.robotics)
|
Message is in Reply To:
| | Re: Brainstorms
|
| (...) the interconnect protocol is run so slowly. Why only 2400 baud? Anything where you have an actual copper wire connection could run orders of magnitude faster. Heck even iRDA goes faster over infraRed. ---...--- Steve Baker ---...--- Mail : (...) (22 years ago, 10-Aug-02, to lugnet.robotics)
|
53 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|