sleat

ZPUino default external Arduino-style GPIO pin-mapping

Recommended Posts

Hello!

Reading the documentation, there's a strong implication that there is some sort of default pin-mapping for GPIO pin operations (bare papilio pins) which is not specifically related to installed Wishbone peripherals. Where is it documented for each board?

The ZPUino tech manual talks about redirecting input and output from slot peripherals to GPIO pins. That's fine, but then it talks about this:

[4.1.4 Software GPIO pins should be manipulated using the Arduino-like functions digitalW rite(), digitalRead() and pinMode().

Additionaly GPIO can be bound to devices using PPS (Peripheral Pin Select). You can also use the following "C" macros if needed. Each pin block is 32-bit wide:

GPIODATA(x) GPIODATA for pin block x GPIOTRIS(x) GPIOTRIS for pin block x]

Short of writing a sketch which "pings" all of the Papilio's Arduino-style pins from inside a sketch (1-128?) and possibly crashing something, is there any way to do this on a default "naked" ZPUino?

So, the real questions is, on a pro, one, duo, etc, running a ZPUino, when I set pin X to output and do a digitalWrite() to that pin, where does it come out, and how do I find that out?

I know that I can tie a <wishbone to registers x 10> library symbol to my ZPUino in ISE, connect those registers to the outside, and maybe do my own WB_digitalWrite() function for it but making the very same physical Papilio pin both an input and an output using that part would need a tristate buffer or latch hung onto the side of it, and a way to control that in code the way Arduino GPIO does.

EDIT: I also see a few examples that re-map the pins, i.e. the MegaWing_Logistart example, and the Flex_Pins example, but is there a default mapping if someone simply starts bit-bashing Arduino I/O lines?

EDIT: Answered my own question...They're in the ZPUino header files \\hardware\zpuino\zpu20\cores\zpuino\board_<something>.h one for each product, for anyone looking for the definitions.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now