Subject:
|
Re: I2C device for the RCX
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 13 Jan 2003 16:40:27 GMT
|
Viewed:
|
931 times
|
| |
| |
Before starting the hacking,I did some tests whit this 'for-lus-delay', and I
found the results better than expected.
I found that this: for(long i=0;i<100000;i++);
takes about 120ms, so one for lus takes 0.0012ms.
I made a test program which first sends the adress of the I2C device,
and then starts a loop which sends data to the device, and also checks
the Acknowledge bit. When there's no acknowledge, it resends the data.
Whit this tests i let this program send 250 data packages, and when
it's done, it displays the amount of lost packages on the display.
At the maximum speed, whit a good (low) package lost, the program takes
375ms, and has a package lost of 7. So the RCX has send 1 adress package,
250 data-packages, and 7 adress and data packages(the lost packages)
that means a total of 265 packages. every package is 8 bits long, plus an
acknowledge bit, so 9 bits per package. that means 2385 bits in 375ms, which is
6360 bits/sec. This should mean there's a quite stable clockpulse at the sensor
port at about 666Hz. (did I calculated thatone right?)
To compare this whit the original NQC code:
NQC max speed 27 bits/sec.
BrickOS max speed 6360 bits/sec.
I found that quite impressive when you look at it in this way.
So that is a quite stable clock signal, but it seems that it only works on a
RCX whit an adapter, or a RCX whit VERY good battery's. I should do some more
tests on this to be sure about it.
At last, the maximum speed of the I2C bus at normal speed is 100Kbits/sec. i
got here 6360bits/sec, So it could go a LOT faster, but therefore the pulses
must be much more stable. I think the hacking is needed to get the speed
higher. at the other hand, imaging what you could do whit an I2C device at this
speed! seems fast enough to me anyway.
-Bas
|
|
Message has 2 Replies: | | Re: I2C device for the RCX
|
| "Bastiaan v.Kesteren" <b.van.kesteren53@zonnet.nl> wrote in message news:H8nvnF.2rz@lugnet.com... (...) takes (...) package, (...) A 3% error rates (7 out of 250 messages) is far too high. I would have expected error rates under 1 in 10 million (...) (22 years ago, 13-Jan-03, to lugnet.robotics)
|
Message is in Reply To:
| | Re: I2C device for the RCX
|
| (...) I think it will - as long as you put the sensor handler on timer B (the motor handler probably can stay there too). Take a close look at _ds_handler inside the file dsensor.c. That's where all the active/passive switching and sensor readout is (...) (22 years ago, 12-Jan-03, to lugnet.robotics)
|
24 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
|
|
|
|