Which samd21 pins have these alt functions

Im having trouble mapping my custom board ATSAMD21E15 pins

I already have a few of what i need mapped

USB

  • DM - PA24
  • DP - PA25

ADC

  • PA03 - vref a
  • PA04 - vref b
  • PA03 to PA011 - analog inputs

JTAG

  • PA30 - SWDCLK
  • PA31 - SWDIO

but I could not find the SPI (MOSI MISO SCLK CS ) and which I/O are capable of high frequency PWM pins though.

Thank you for your help.

SPI is done using a SERCOM peripheral.

PWM is generated by a Timer/Counter peripheral and uses the Waveform Generators, so you should look at the TCx/WOy pins.

do you think you can point out to me which timer i should use for the PWM, it is important for my application that i output a PWM frequency of atleast 100kHz with a resolution of atleast 100 levels (7ish bits)

Im also worried that i might choose a timer that is very difficult to activate the PWM (not a very adept at coding) . All in all i need 4 PWM pins , if possible they would be on a separate timer so the PWM is not synchronized, but its not really a necessity

also about sercom they are very many of them, how do i know which is the mosi, miso , and sclk of each sercom? which sercom is best in performance are they the same?

PA16 to PA19 would give you the four pads for SERCOM1 which can be configured for either SPI, USART, or I2C

PA0 and PA1 gets you two channels on Advance Timer2
PA22 and PA23 gets you two channels on Timer4

PA27 to PA28 gets you two channels on the Advance Timer 3

The timers on the SAMD21 is generally more complex than the ones you can find on the AVRs (Arduino UNO), thus should have no problems generating your required waveform.

Does this help? SAMD21-PMUX - Google Sheets
The "TC" timers are the relatively simple ones.
I don't have SPI specifically noted on there, but you should be safe assuming that you need all 4 pads of a SERCOM...

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.