Author Topic: Figuring out the PWM pins on SAM D10 MCU  (Read 1837 times)

0 Members and 1 Guest are viewing this topic.

Offline anvoiceTopic starter

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Figuring out the PWM pins on SAM D10 MCU
« on: February 07, 2018, 07:33:26 am »
Hello, I'm selecting an MCU for a brushless servo controller, which means I need 6 PWM outputs as well as some ADC inputs for current detection (plus some pins pot or quadrature encoder or pot, depending on which route I go). I'm currently looking at the ATSAMD10D14 SOIC20 package (datasheet is too big to attach, but is one of the first hits on google searching for that MCU), which seems to have the desired characteristics, but by looking at its datasheet (yes, I'm not very good at it yet) I can't determine which pins are the PWM pins. The analog pins are marked on the pinout, so those should be the ADC (I see 6 of them), but the rest are just marked as digital pins. It would be my assumption that the PWM pins would not be on the same pins as the ADC, but I'm not certain. If they overlap I wouldn't have the proper number of pins to control my motor. Can someone help me interpret this? Any help is most appreciated.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11256
  • Country: us
    • Personal site
Re: Figuring out the PWM pins on SAM D10 MCU
« Reply #1 on: February 07, 2018, 08:02:16 am »
Look at the table "Table 6-1. PORT Function Multiplexing". TCCx/WO[y] are your outputs. There are only a couple of ADC channels that don't intersect with TCC outputs, but if you don't need all the outputs, then you can save more ADC channels.
« Last Edit: February 07, 2018, 08:03:47 am by ataradov »
Alex
 

Offline anvoiceTopic starter

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Figuring out the PWM pins on SAM D10 MCU
« Reply #2 on: February 07, 2018, 08:37:37 am »
So if I'm reading it correctly, there are 10 ADC channels. Which pins are PWM-capable though? I believe the specifications for the MCU claim something like 8 PWM channels, if they all intersect with the ADC that could be a problem.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11256
  • Country: us
    • Personal site
Re: Figuring out the PWM pins on SAM D10 MCU
« Reply #3 on: February 07, 2018, 08:39:56 am »
All TCCx/WO[y] are PWM waveform outputs from the TCCs.

You need to think though your TCC channel assignments to make sure that all the channels you need synchronized are synchronized. Actually never mind that, there is only one TCC.
« Last Edit: February 07, 2018, 08:45:45 am by ataradov »
Alex
 

Offline anvoiceTopic starter

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Figuring out the PWM pins on SAM D10 MCU
« Reply #4 on: February 07, 2018, 08:48:32 am »
So basically the TCC0/WO[0-7] are the possible independent PWM outputs? That would mean I should be able to scrape enough ADC channels for my needs. In fact if I'm reading it correctly, if I use TCC0/WO[2-7] I can avoid all overlap with the ADC channels, which would mean I'd have 10 ADC channels available. Correct me if I'm wrong of course, and thank you for your help.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11256
  • Country: us
    • Personal site
Re: Figuring out the PWM pins on SAM D10 MCU
« Reply #5 on: February 07, 2018, 08:51:45 am »
There is only 4 independent channels. The corresponding pair channels can be programmed to output a complimentary signal with configurable dead time insertion. Just what you need for motor control.

Figure 29.3 shows a block diagram of the TCC.

You can achieve more independence by using TCs as well, but I would stick with TCC for motor control and let hardware do the work.
« Last Edit: February 07, 2018, 08:53:28 am by ataradov »
Alex
 

Offline anvoiceTopic starter

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Figuring out the PWM pins on SAM D10 MCU
« Reply #6 on: February 07, 2018, 09:49:39 am »
Thank you!
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2603
  • Country: us
Re: Figuring out the PWM pins on SAM D10 MCU
« Reply #7 on: February 14, 2018, 08:45:46 pm »
You may also want to look at the D21 family if you need a few more channels.  There are a few parts that are only a few more pins than the D10 but come with a larger peripheral set.  In particular, the D21L parts have additional ADC channels versus the equivalent standard D21 parts (IIRC, it's just different pins that are dropped from the lower pincount packages, so otherwise the parts and peripherals are identical). 
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Figuring out the PWM pins on SAM D10 MCU
« Reply #8 on: February 15, 2018, 02:10:34 am »
You can also look at https://docs.google.com/spreadsheets/d/12YnZpTPGxS-oINhrRfFgx2rkwPUyUYQbXvVIME8oCHY/
This is just a spreadsheet version of the "Figure 29.3" pinmux table that Ataradov mentioned, but I find it very useful to create these and be able to sort them based on the different headers/etc.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf