0

PWM on CLUE
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PWM on CLUE

by RobertI on Tue Dec 15, 2020 5:59 am

Which pins on a Clue will work with PWM?

If I want to control something using PWM rather than I2C, can I use the STEMMA connector? It's very convenient.

RobertI
 
Posts: 8
Joined: Fri Jul 03, 2020 10:32 am

Re: PWM on CLUE

by dastels on Tue Dec 15, 2020 11:33 am


dastels
 
Posts: 6519
Joined: Tue Oct 20, 2015 3:22 pm

Re: PWM on CLUE

by RobertI on Tue Dec 15, 2020 11:52 am

Thanks. The pinouts (which I had, Adafruit are full of info...) show pins 19 and 20 coming off the Stemma connector.

So the question is, can I use pins 19 and 20 for PWM? Arduinos only let you use a subset, but nothing is shown here either way as to whether those pins are suitable.
**STOP PRESS** - I just saw the "ANY GPIO PIN CAN BE CONFIGURED AS PWM". That wasn't on my older pinout diagram. Are 19 and 20 GPIO pins? that isn't defined.

Also - while I have you here - those two lines are also labelled "48" and "49" in grey parallelograms, which are also not defined. What do they mean?

Thanks R

RobertI
 
Posts: 8
Joined: Fri Jul 03, 2020 10:32 am

Re: PWM on CLUE

by dastels on Tue Dec 15, 2020 12:10 pm

Yes, they are GPIO which can be used for I2C. But that's only when you create an I2C bus using them. The squiggles on those pins... that generally means they can be used for PWM.

The AVR chips used on the older Arduinos have a limited number of pins that can be used for PWM. In contrast the newer MCUs can use most (if not all) GPIO for PWM.

Alas, the grey parallelograms aren't noted in the key but I believe they refer to physical chip pins.

To use the STEMMA pins for PWM, use D19 and D20 to refer to them.

Dave

dastels
 
Posts: 6519
Joined: Tue Oct 20, 2015 3:22 pm

Re: PWM on CLUE

by RobertI on Tue Dec 15, 2020 12:16 pm

Oh! The squiggles on the wires in the pinout are equivalent to the tildes on the Arduino diagrams? Clear now you say it but I'd never have seen it otherwise.

Thanks very much for helping. Just what I needed to know.

RobertI
 
Posts: 8
Joined: Fri Jul 03, 2020 10:32 am

Re: PWM on CLUE

by dastels on Tue Dec 15, 2020 12:22 pm

Awesome! Have fun!

dastels
 
Posts: 6519
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.