Arduino Zero Timer / PWM Direct Access Notes

Arduino Zero Timer / PWM Direct Access Notes

posted in: Microbots, Programming | 0

If you want to access the timer or PWM outputs more direct style here are some helpful links:

Link to google docs explaining the PWM pins and their associated timers used on V1.0 of our microbot PCB 

timer-configuration-diagram

 

Arduino forum example library code to set PWM values manually – Includes TC3 code which most examples dont

Arduino forum post showing what the different timers are used for

Timer     Channels     Outputs Note
TCC0
4
8
Fully used for PWM (outputs 0..3 are replicated on 4..7)
TCC1
2
4
Fully used for PWM (outputs 0..1 are replicated on 2..3)
TCC2
2
2
Fully used for PWM
TC3
2
2
Fully used for PWM
TC4
2
2
Used by Servo
TC5
2
2
Used by Tone

Example using timers to change frequency based on analog input

Max Baders Utilities to change the timers on arduino Zero

Adafruit Arduino Zero Timer Wrapper Library on Github

Arduino Forum post on how to manually configure the timer modules for custom PWM frequencies etc. 

Adafruit forum post on setting timers manually

Github Arduino example of IR transmit and Receive on SAMD core.

Github Arduino SAMD Core Tone Library Source – uses TC5

Sparkfun SAMD21 General info on the ARM core and features + SERCOM configuration

Adafruit SAMD21 Additional serial port setup tutorial

 

tcc_block

Leave a Reply