Can Unused ports of Multi-UART be map as 1bit ports? Topic is solved

If you have a simple question and just want an answer.
jgpatriot
New User
Posts: 2
Joined: Mon Feb 12, 2024 5:39 pm

Can Unused ports of Multi-UART be map as 1bit ports?

Post by jgpatriot »

On a XU316-1024-FB265 design, I am using Multi-UART TX on P8D. I only need 5 of the 8 pins for the Multi-UART. Can X1D36/7/8 can be set as P1M0/P1N0/P1O0 while X1D39-43 are set as P8D3:P8D7 for Multi-UART?
View Solution
Joe
Verified
Experienced Member
Posts: 76
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

Yes. Ports that share an IO pin can be used at the same time, with the narrowest ports taking precedence as to which port will drive the pin. So 1 bit ports have priority and 1b > 4b > 8b > 16b > 32b. So in this case you can use ports 8D and 1M, N, O all at the same time, but the bits of port 8D that overlap the 1 bit ports will not connect to pins. They can still be driven to any value but will not have any effect. The 1 bit ports will operate as normal.
XMOS hardware grey beard.
jgpatriot
New User
Posts: 2
Joined: Mon Feb 12, 2024 5:39 pm

Post by jgpatriot »

Thank you for the quick reply
Joe
Verified
Experienced Member
Posts: 76
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

Essentially we have many sources which want to have access to the same IO pin. In the case of more than one of those sources wanting to use an IO pin the device internally makes a decision based on the following order going from highest to lowest priority:

xmos links (highest priority) -> 1 bit ports -> 4 bit ports -> 8 bit ports -> 16 bit ports -> 32 bit ports (lowest priority).

In other words:
If an xmos link is used it always has access to the IO pins.
If a 1 bit port is used it has access to the IO pin unless it is overlapping an xmos link which being used.
If a 4 bit port is used it has access to the IO pins within that port which do not overlap an xmos link or 1 bit port which are being used.
If an 8 bit port is used it has access to the IO pins within that port which do not overlap an xmos link, 1 bit port or 4 bit port which are being used.
If a 16 bit port is used it has access to the IO pins within that port which do not overlap an xmos link, 1 bit port, 4 bit port or 8 bit port which are being used.
If a 32 bit port is used it has access to the IO pins within that port which do not overlap an xmos link, 1 bit port, 4 bit port, 8 bit port or 16 bit port which are being used.

So in this case, you are using an 8 bit port for UART TX (Port 8D) so those IO pins will have access to IO pins within that port apart from the ones overlapping the 1 bit ports being used (Port 1M/N/O). So for output bits 3:7 will work as normal. bits 0:2 will have no effect on anything. For input all bits will read as normal.
The three one bit ports will operate as normal as they do not overlap an xmos link which is being used.

It may not be clear how the different elements are set "in use". For ports, a port is automatically set as "in use" by software when actively used in your code for input or output (e.g. in xc p8d <: 0;). Xmos Links are only set "in use" if defined in your XN as part of a multi chip system. Once set up initially, generally the ports stay "in use" forever unless manually disabled using the function set_port_use_off(void port p) which is in xs1.h.

I guess the specific answer to your question is it will just work with no other special action required. Just use port 8D and ports 1M/N/O at the same time and they will all work as normal (apart from the fact the bits 0-2 of the UART_TX will not appear on pins).

For further detail, see section 7.1 "Port Precedence" in the following doc.

https://www.xmos.com/download/Introduct ... s(1.0).pdf

Cheers,
Joe
XMOS hardware grey beard.