beautypg.com

Texas Instruments MSC1210 User Manual

Page 131

background image

PWM Generator

11-7

Pulse Width Modulator/Tone Generator

This can be expressed in code as:

PWMCON = 0x10; // Sel PWM Duty Register

PWM = 128−1; // PWM toggle at a count of 128

PWMCON = 0x09; // Sel PWM Period access, SysClk rate, PWM mode

PWM = 512−1; // 11.0592MHz/512=21.6KHz PWM Freq, Period=512 counts

Note:

The port pin used for PWM (P3.3) must be configured as either standard
8051 or CMOS output for the tone generator/PWM to function.