GPIO hardware details

Technical discussions around xCORE processors (e.g. General Purpose (L/G), xCORE-USB, xCORE-Analog, xCORE-XA).
cjameshuff
Member++
Posts: 22
Joined: Mon Sep 26, 2016 6:08 pm

GPIO hardware details

Postby cjameshuff » Fri Jan 13, 2017 4:35 pm

I'm trying to find detailed information about the GPIO hardware on XCore parts, and the available documentation seems unclear and incomplete (or I'm just not finding it).

In this specific case, I'm trying to determine how GPIOs declared as inputs are initially configured on an XL208 processor. The datasheet states the following:
PD/PU: The IO pin has a weak pull-down or pull-up resistor. On GPIO pins this
resistor can be enabled. This resistor is designed to ensure defined logic input
state for unconnected pins. It should not be used to pull external circuitry.
The subsequent table shows pulldowns on all the inputs I'm interested in.

However, xs1.h defines set_port_pull_up() and set_port_pull_down() functions, with the following comments:
On XS2 and XS1-G devices calling set_port_pull_up() has the side effect of configuring the port in drive low mode.
On XS2 devices calling set_port_pull_down() has the side effect of configuring the port in drive high mode.
It's not explicitly stated anywhere that I've seen, but I'm inferring that the same configuration setting controls how the pin is driven when in output mode and pullup/pulldown in input mode...is this correct?

Finally, the XMOS XS2 Architecture reference states:
A port is initially OFF with its pins in a high impedance state.
and:
Initially, the port is ready for input.
The table showing the configuration defaults has 3 settings: DRIVE, PULLDOWN, and PULLUP, with the default being DRIVE...which I assume means no pullup or pulldown for inputs.

So I have one reference stating there's a pulldown (initially active? Supported and able to be enabled, with no pullup functionality available?), one stating that there's both pullups and pulldowns available, and one stating both that the port is initially off and that it is initially configured for input. All of which leaves me rather uncertain as to the initial state or the capabilities of my ports.

Nowhere have I seen an actual schematic or diagram of the port. Does such a thing exist anywhere?
Gothmag
XCore Addict
Posts: 129
Joined: Wed May 11, 2016 3:50 pm

Postby Gothmag » Sat Jan 14, 2017 8:46 pm

I'm not entirely sure what you're trying to ask other than the questions at the end. The port initially have the pulldowns enabled before booting, after that it's up to the programming as far as I know. The table you found shows what ports have what available, on xs2 most of them just have pulldowns to ensure you read 0 when it's not being externally driven they're very high value though so very weak almost anything driving that port will overcome it.

I do believe it's correct that they're configured to be inputs by default. The thing is since your program must define a port you can essentially be sure what it's configured as at any given point in the program. If you don't specify it as input or output it can be used either way. But as you found it's configured as an input by default which means its tri stated. I feel like I'm just re-stating what you've already written so if you could focus your questions I might be able to help more. Otherwise maybe someone else will chime in.

Who is online

Users browsing this forum: No registered users and 1 guest