Page 1 of 1

Reconfigure USB/SERCOM ports on the fly?

Posted: Thu Jan 21, 2016 1:10 pm
by t.bohler@unitechenergy.no
Hi.
We want to use a SAMD21E on our target-PCB, and we want to do USB and SERCOM (SPI/I2C) communications over the same pair of wires (due to HW limitations). Acc to SAMD21 datasheet (Table 6-1) USB and SERCOM3/SERCOM5 are multiplexed.
Can we then:
a) Use the pins as USB during SAM-BA programming (via SAMD21 built-in BOOT loader)?
b) Reconfigure PA24/PA25 "on-the-fly" to function as either SERCOM or USB whenever suitable/needed (program reconfiguration whenever required)?

Best Regards
Terje Bohler

Re: Reconfigure USB/SERCOM ports on the fly?

Posted: Mon Jan 25, 2016 8:21 am
by sarlacii
t.bohler@unitechenergy.no wrote: a) Use the pins as USB during SAM-BA programming (via SAMD21 built-in BOOT loader)?
b) Reconfigure PA24/PA25 "on-the-fly" to function as either SERCOM or USB whenever suitable/needed (program reconfiguration whenever required)?
Greetings

Yes, you can reconfigure pins/modules... but you do have to go through the entire config and init process each time you make a change. So if you're using the ASF, you'll have to populate the config structs, make you app specific mods, and then write the configs before re-enabling the module (SERCOM etc.).

In other words, it takes time to re-configure things... you can't just setup two modules to use the same pins and sort of "swap" pins as you go.

Is that what you were asking, yes?