Home/Support/Support Forum/Getting direct access I/O skipping Flex libraries
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Getting direct access I/O skipping Flex libraries

0 votes

I am developing a little control software in a Rabbit Flex board. I require very fast access to many of the digital outputs pins we have.

In case I was working only with The PowerCore and our own developed I/O board, there would be no problem since PowerCore pinout is well documented and we have easy access to I/O ports using DynamicC functions such as:

WrPortI(PEDR, & PEDRShadow, 0x00);

(values may change depending on ports being written and values)

This instruction is quite fast (40-50 clock cycles) and gives us direct access to all the bits in this port, thus, potentially up to 8 digital outputs.

I've been trying with an old Rabbit 2000 micro.

In case of using a FlexBoard a whole set of different user-friendly instruction have been added through libraries to provide easy access to our user-configured pins.

int flexDigOut(Flex_IOPin *pin, int state)
int flexDigInGroup16(Flex_IOPin *digin_pins[], unsigned int *result)

The first of these functions provides pin access using and integer value, while the second of these functions, the group one, uses the first function to have group access through a pin to pin routine.
I have not yet tried (I still don't have my RabbitFlex with me) but it looks clear that flexDigOut and flexDigInGroup16 functions are way slower than WrPortI. I expect flexDigOut to be a little slower than WrPortI function, and flesDigInGroup16 to be over 16 times flexDigOut.
I would like to avoid using them.

I would like to use, thus, WrPortI function, but here comes my problem. I cannot find the correspondence between PowerCore module I/O ports and Flex connectors.

I've been looking for this through two different ways: hard and soft; but I didn't succeed in any of both.
Hard: In RabbitFlex user manual schematics I've tried to follow lines from PowerCore connector to (2 or 3)-transistor cells, but it becomes too complex. I couldn't afford it.
Soft: I've searching in Rabbit Flex libraries, trying to find out which memory addresses are being written when a given Flex digital output is accessed. This should allow me to see how Flex digital outputs are mapped. I expected to find the WrPortI function somewhere, and I thought I would be able to see how values where calculated. I could not find what I thought, and I get lost when I arrive at function "_flex_digWrite(unsigned int addr, unsigned int data)", which is coded in Assembler.

Could you please give me the information I am looking for? (i.e. relationship between Rabbit3000 I/O ports and RabbitFlex pins and connectors)

Could you tell me which document should I check to find this info?

Thank you very much

Mart� Bassas

asked Jun 29, 2007 in Rabbit by User1073 New to the Community (0 points)

Please log in or register to answer this question.

2 Answers

0 votes

The "_flex_digWrite function is the only low-level function for writing to Flex Cells, which writes to an 1 to 8 output latch (so no parallel writes avail for output Cells).

Aside from getting the I/O addresses from the Flex Lib's, you could set a breakpoint on "_flex_digWrite function to see the address for given cell.

Hope this helps...

answered Jul 4, 2007 by ekillian New to the Community (1 point)
0 votes
It is very nice that you are developing a little control software in a Rabbit Flex board. I require very fast access to many of the digital outputs pins we have.
answered Apr 12, 2012 by marina001 New to the Community (10 points)