example:
P4DIR |= BIT1+BIT2+BIT3; // P4.1 - P4.3 output P4SEL |= BIT1+BIT2+BIT3; // P4.1 - P4.3 TBx options TBCCR0 = 512-1; // PWM Period TBCCTL1 = OUTMOD_7; // CCR1 reset/set TBCCR1 = LightCDPM; // CCR1 PWM duty cycle TBCCTL2 = OUTMOD_7;
In the up-counting mode, CCR0 is used for period timing, CCR1 is used for PWM duty cycle adjustment, TA1 -> PWM output:
512 (i.e. CCR0 value) X timer count clock = PWM period 128 (if it is CCR1 value) X timer count clock = PWM duty cycle
The actual PWM period is 512 clock cycles. Assuming that your timer B uses 8M clock, the actual PWM period = 512/8M = 64us
Previous article:MCU reads 4*4 matrix keyboard
Next article:【MSP430】Capture mode to measure signal duty cycle
Recommended ReadingLatest update time:2024-11-24 20:46
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- oled multi-chip calling program
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- CATL releases October battle report
- Battery industry in October 2024: growth momentum remains unabated!
- Mercedes-Benz will launch the eCitaro equipped with NMC4 batteries to provide high energy density and long life
- Many companies have announced progress on solid-state batteries. When will solid-state batteries go into mass production?
- Xsens Sirius Series Inertial Sensors Enable 3D Inertial Navigation in Harsh Environments
- Infineon's Automotive Landscape: From Hardware to Systems
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The drilling marks are clear, why is there a hole missing on the PCB?
- Prize-winning quiz | TE "New Energy Application Solutions White Paper"
- Among the five bottlenecks of IPTV, which one do you think is the most critical factor restricting the development of IPTV? (Welcome to discuss)
- Why are XH connector manufacturers so stupid?
- A summary of the most downloaded electronic technical materials this week (2020.6.1~5)
- Synplify Quick Start
- upyLoader failed to initialize the file transfer. How can I solve this problem?
- Introduction to the factors that cause the switching power supply loop instability
- Several RP2040 boards added in recent MicroPython updates
- Detailed explanation of the application circuit of the flyback converter secondary side synchronous rectification controller STSR3