kopia lustrzana https://github.com/micropython/micropython
Strona:
PWM Timers
Strony
Board FreeSOC
Board Arduino Due
Board BLACK F407VE
Board BLACK F407ZE
Board BLACK F407ZG
Board Crazyflie2
Board Espruino Pico
Board FEZ Cerb40 II
Board FEZ Cerb40
Board FEZ Lemur
Board G30HDR
Board HydraBus V1.0
Board NUCLEO F401RE
Board NetduinoPlus2
Board Nucleo F767ZI
Board Olimex STM32 405STK
Board Olimex STM32 E407
Board OpenMV
Board STM32F401 Discovery
Board STM32F407 Discovery
Board STM32F429
Board STM32F746 Discovery
Board Teensy 3.1 3.5 3.6
Board Tiva TM4C123G Launchpad
Board VCC GND STM32F407VET6 Mini
Boards Summary
Build Troubleshooting
Building Micropython Binaries
Building st flash
Bundling and deploying application code and files
Collections module
ContributorGuidelines
CrossBranch
Developing on a microcontroller
Differences
ESP32 debugging
Examples
FAQ
Getting Started Compiling Micropython for Ubuntu 16.04
Getting Started STM
Getting Started
HY STM32F4xxCore144
Hardware API
Home
Improving performance with Viper code
Instrumenting code using GPIOs
LCD driver
LTO
Learn MicroPython
Memory Manager
Micro Python on Mac OSX
MicroPythonVsELua
Micropython Git Development Workflow
PPP on ESP32
PWM Timers
Performance
Programming Debugging the pyboard using ST Link v2
ProjectsUsingMicroPython
Pyboard Firmware Update
STM32F405 Timer Triggering
STM32F405 pinouts
Securing a MicroPython System
Servos
Soft reset
Standard Library Coverage
Symbolic Debugging for STM32
Threads
Timebase calculation and Clock sources
Timer Implementation
Timer capture mode
Timer one shot
Tips and Tricks
VS Code
Watchdogs, Crash prevention, Crash recovery
13
PWM Timers
Neon22 edytuje tę stronę 2014-02-05 11:18:55 -08:00
Spis treści
Overview
There are 10 Timers on the STM32F405 chip being used by the mircropython KS project. Not all Timers have pins allocated to them on this 64 pin package. (The 407 based chipsets have the same allocation of timers.) Timers in this chipset come with various capabilities:
- TIM1 and TIM8 are advanced 16 bit timers and can count up and down. They can be used to drive steppers or 3 phase motors. They have special trigger and brake input pins to support this. They are the only timers with pinouts defined for complementary outputs. I.e. they can drive three channels of two pins up and down in perfect synchronisation. They are capable of driving 4 channels for output.
- TIM2 and TIM5 are 32 bit Timers. TIM2 can be triggered by an external signal. Both TIM2 and 5 have 4 channels.
- TIM3 and TIM4 are 16 bit timers. Both have 4 channels but TIM3 has more pins allocated.
- TIM9 and TIM12 are 2 channel timers. Only TIM9 has pins.
- TIM10 and TIM11 have a single output channel each.
- The remaining Timers 6,7,13,14 do not have any pin connections on the 64 pin package. All timers can be used to generate timebases. Most can do PWM generation. A digram below shows how timers can be cascaded to make longer or triggered timings. Most triggers can also generate Interrupts.
The following timers can sample an input signal and determine its period. 1,2,3,4,5,8,9,10,11
These Timers can be used to correctly determine speed and direction from externally supplied quadrature signals. 1,2,3,4,5,8,9
- STM32F405 pinouts
- STM32F405 Timer Triggering
- clock source and Timebase calculations
- Single shot timer setup
- Capture mode
- Implementation
Timer Summary:
Advanced - TIM1,8
- 16bit, 4 channels (2x complementary)
- can generate up to three complementary outputs with insertion of dead time
- ideal for motor control.
- seen as three phase PWM generators multiplexed on 6 channels
- max speed 168 MHz, max interface speed 84 MHz
- independent DMA request generation
- as 16bit PWM generators they have full 100% modulation capability
- TIM1 can be slaved to TIM5,2,3,4
- TIM8 can be slaved to TIM1,2,4,5
GP 16bit - TIM3,4
- 4 channels (not complementary)
- timing, delay, one pulse, input capture, encoder input
- up, down count with DMA control, Master/slave
- can generate PWM output
- 16 bit prescaler
- max speed 84 MHz, max interface speed 42 MHz
- TIM3 can be slaved to TIM1,2,5,4
- TIM4 can be slaved to TIM1,2,3,8
GP 32bit - TIM2,5
- 4 channels (not complementary)
- timing, delay, one pulse, input capture, encoder input
- up, down count with DMA control, Master/slave
- can generate PWM output
- 16 bit prescaler
- max speed 84 MHz, max interface speed 42 MHz
- TIM2 can be slaved to TIM1,8,3,4
- TIM5 can be slaved to TIM2,3,4,8
Basic - TIM6,7
- 0 channels - no direct external pin control.
- must be Masters
- up count only with DMA control
- 16 bit prescaler
- used for timebase timers or triggering the DAC
- max speed 84 MHz, max interface speed 42 MHz
1 channel - TIM10,11,13,14
- general purpose timers
- up count only, no DMA control
- can generate PWM output
- 16 bit prescaler
- must be Masters
- TIM13,14 - max speed 84 MHz, max interface speed 42 MHz
- TIM10,11 - max speed 168 MHz, max interface speed 84 MHz
2 channel - TIM9,12
- 2 independent channels
- general purpose timers, Master/slave
- up count only, no DMA control
- can generate PWM output
- 16 bit prescaler
- TIM12 - max speed 84 MHz, max interface speed 42 MHz
- TIM9 - max speed 168 MHz, max interface speed 84 MHz
- TIM12 can be slaved to TIM4,5,13,14
- TIM9 can be slaved to TIM2,3,10,11 Independent watchdog
- 12 bit downcounter and 8 bit prescaler
- driven from independent 32kHz rc clock
- operates in stop or standby mode and can reset the device
- can be used as free running app timeout counter
Window watchdog
- free running 7bit downcounter
- clocked from main clock
- can reset the device or generate interrupt
SysTick timer
- 24 bit downcounter from main clock
- autoreload capability
- maskable interrupt on = 0