0

Trinket M0 High Speed PWM Documentation
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket M0 High Speed PWM Documentation

by jparisse on Wed Jun 05, 2019 12:16 am

Adafruit,

Are the two high speed PWM ports indicated on the Trinket M0 Pinout document? If so, how are they marked and if not, which two pins support high speed PWM? Thanks.

[img]https://cdn-learn.adafruit.com/assets/assets/000/049/778/medium800/adafruit_products_Adafruit_Trinket_M0.png?1514756138[/

jparisse
 
Posts: 35
Joined: Sun May 10, 2015 5:00 pm

Re: Trinket M0 High Speed PWM Documentation

by adafruit_support_mike on Wed Jun 05, 2019 1:06 am

Sorry, I'm not familiar with the term 'high speed PWM' as it applies to the SAMD21 microcontroller. To the best of my knowledge, all PWM is handled by the TC and TCC peripherals.

Could you post a link to a reference describing that function please?

adafruit_support_mike
 
Posts: 57856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket M0 High Speed PWM Documentation

by jparisse on Wed Jun 05, 2019 2:04 am

It is in the main description page for the product.


Five GPIO pins with digital input/output with internally connected pullups or pulldowns
Three of the I/O pins can be used for 12-bit analog input
True analog output on one I/O pin - can be used to play 10-bit quality audio clips in Arduino (CircuitPython does not have storage for audio clips)
We gave the M0 pads the exact same names as the original Trinket so all your existing Arduino code will work exactly the same as-is without changes
Two high speed PWM outputs - for servos, LEDs, etc

jparisse
 
Posts: 35
Joined: Sun May 10, 2015 5:00 pm

Re: Trinket M0 High Speed PWM Documentation

by adafruit_support_mike on Wed Jun 05, 2019 12:28 pm

Ah, those are pins 3 and 4.

Pins 0 and 2 can also do PWM, but they also serve as SDA and SCL if you need to connect I2C devices. Pin 1 is connected to the DAC, and can produce true analog output voltages.

The SAMD21’s PWM frequency is faster than the Arduino Uno’s, which gives rise to the term ‘high speed’.

adafruit_support_mike
 
Posts: 57856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket M0 High Speed PWM Documentation

by jparisse on Wed Jun 05, 2019 1:21 pm

Thanks!

jparisse
 
Posts: 35
Joined: Sun May 10, 2015 5:00 pm

Re: Trinket M0 High Speed PWM Documentation

by jparisse on Thu Jun 06, 2019 12:24 am

“Three of the I/O pins can be used for 12-bit analog input”

Referring to the same chip and documentation, Which 3 of the 5 analog In pins are 12bit?

Thanks

Jeff

jparisse
 
Posts: 35
Joined: Sun May 10, 2015 5:00 pm

Re: Trinket M0 High Speed PWM Documentation

by adafruit_support_mike on Thu Jun 06, 2019 12:53 am

1, 3, and 4.

It’s the same general reasoning: all of the pins can act as digital inputs, and the SAMD21 only has one 12-bit ADC. The GPIO pins connect to it through a multiplexer. Pins 0 and 2 are usually reserved for I2C.

adafruit_support_mike
 
Posts: 57856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Trinket M0 High Speed PWM Documentation

by jparisse on Thu Jun 06, 2019 11:53 am

Excellent... thanks again!

jparisse
 
Posts: 35
Joined: Sun May 10, 2015 5:00 pm

Please be positive and constructive with your questions and comments.