SPI Pins Available After Boot - Confirmation?

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
User avatar
JasonWhiteman
Active Member
Posts: 63
Joined: Mon Jul 15, 2013 11:39 pm

SPI Pins Available After Boot - Confirmation?

Post by JasonWhiteman »

I've seen discussions about SPI pin reuse and references to documentation. However, reading the documentation I do not see a clear indication that the SPI pins are released for general I/O after a boot sequence.

If I set MODE[3:2] to "11" binary - boot from SPI - then after the boot process is complete - are SPI released for general I/O?

My current assumption is that firmware need not make any special consideration for reuse of the SPI pins since once firmware is running - the SPI boot is already complete and pins are released (mux is switched) for GPIO use.

My question is only on the XMOS behavior as implications outside of XMOS are already understood.

Regards,
Jason Whiteman


User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

The ports are disabled after loading the boot image.
User avatar
Ross
XCore Expert
Posts: 966
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

You can declare and use them as normal ports in your program (the boot code uses these pins via normal ports).

Clock and data lines can simply be re-used, some sort of mux should be used if you want to re-use the Chip Select line.
User avatar
JasonWhiteman
Active Member
Posts: 63
Joined: Mon Jul 15, 2013 11:39 pm

Post by JasonWhiteman »

Muxing CS# is more of an external consideration as the system needs to protect the SPI part from getting confused if CS# is asserted -- so there's no special XMOS-driven consideration for CS#.

The plan was not to reuse CS# and, in the code, drive CS# high (the GPIO) to double ensure CS# is not asserted.

Conclusion (correct?):

Even though the MODE pins are configured to SPI boot mode (11), all SPI pins (X0D00, X0D01, X0D10, X0D11) are available for use for thread(s) without any special code.

Regards,
Jason Whiteman
User avatar
Ross
XCore Expert
Posts: 966
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

JasonWhiteman wrote:Muxing CS# is more of an external consideration as the system needs to protect the SPI part from getting confused if CS# is asserted -- so there's no special XMOS-driven consideration for CS#.
Correct
JasonWhiteman wrote: The plan was not to reuse CS# and, in the code, drive CS# high (the GPIO) to double ensure CS# is not asserted.
Sounds good to me.
JasonWhiteman wrote: Conclusion (correct?):

Even though the MODE pins are configured to SPI boot mode (11), all SPI pins (X0D00, X0D01, X0D10, X0D11) are available for use for thread(s) without any special code.
Correct