Reconfigure USB/SERCOM ports on the fly?

Discussions around product based on ARM Cortex M0+ core.

Moderator: nferre

t.bohler@unitechenergy.no
Posts: 24
Joined: Wed Jun 25, 2014 8:47 am

Reconfigure USB/SERCOM ports on the fly?

Thu Jan 21, 2016 1:10 pm

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
sarlacii
Posts: 68
Joined: Mon Jan 26, 2015 2:33 pm

Re: Reconfigure USB/SERCOM ports on the fly?

Mon Jan 25, 2016 8:21 am

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?

Return to “SAM D20 Cortex-M0+ MCU”

Who is online

Users browsing this forum: No registered users and 1 guest