Home/Support/Support Forum/Some Experience with Rabbit RIO
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Some Experience with Rabbit RIO

0 votes
Hi members,

i use RCM4120 in a embedded control application with many I/O functions, so i decide to use a RIO as IO-Expander, because of functionality.
The use of RIO was as first a little bit tricky because the many registers are accessed via pointer registers and Index registers.
On the Rabbit homepage, a driver-lib for RIO was promised, but i did not found it and a related email to the support was never answered.
So i started to write my own library in C 10.21 for the RIO.
My first impression: the game is quite slow! All functions programmed in
dynamic C 10.21 allows a shortest I/O-pulse of 61us (!) because there is need for some bit dangling, shifts, index pontings a.s.o. just to set an I/O in the RIO.
Inspecting the code produced shows that Dyn.C 10.21 produced horrible unoptimized code! A simple statement with a char variable like "n=+1" results in an addition of a 16-Bit register with 16-Bit constant of "1" (!?)
(i know, n++ would be better in this case, ;-))
So i wrote the whole RIO driver again in assembly and for the used address & data space, because RIO can only communicate via 1 Byte wide vars and access pins only in nibbles, so why should i process 16 Bit words?
After optimizing and testing the fastest I/O-update is about 6 uS, also not
very fast but a speed up factor of 10 compared to the C 10.21 version!

By the way, the documentation of RIO contains a bug. Docs of the quadrature decoders does not point out, that the setting of CLLR/CLMR registers must be programmed too for correct function.
Also, it is not pointed out, that the single pin settings collide with the nibble wide pin port settings, so the user cannot use both ways to set pins or group of pins of a port. (this is the reason why i decide to write a separate Pin set/reset/routine myself in the library)
My RIO lib is currently written for my own use and supports not all functions, but it is very straightforward and good understandable. It supports mainly the basic communication between Rabbit and RIO so expansion is quite forward.
BTW: in some of the Rabbit Libs reg IX is saved in the lib routines because of "costates", comments says. But i didn't found any description in the docs for that - is it necessary or not? My test prog with costates functions normally, even if i use IX in my lib.??

If anybody is interested, send mail ;-))

best regards

Helmut
asked Apr 13, 2008 in Rabbit by StarFire54 New to the Community (1 point)

Please log in or register to answer this question.

2 Answers

0 votes
Hi Helmut,

we are playing with the thought of using the RIO's quadrature decoders to read the position from multiple incremental encoders. In your project did you use the qd inputs and, if yes, what was the highest rate you were able to read the qd counter registers?
We want to simultaneously track eight 2Hz sinusoidal movements at a resolution of at least 20 readings per period leading to a rate of about 3ms.

I'm interested in hearing from your experiences and I'm also interested in getting a copy of your library, thanks.

Cheers,
Martin
answered May 10, 2008 by mfuhrer New to the Community (4 points)
0 votes
Does anyone has Rabbit RIO lib and email to me?
thanks
spingyu@gmail.com
answered Apr 9, 2010 by pingyu New to the Community (1 point)
...