User`s guide

AN0821
Rev. 0.1 5
Some peripherals provide calculators such as baud rate calculators, timer overflow rate calculators, and SPI clock
rate calculators that can be used to automatically calculate the necessary reload register value to generate the
clock rate specified by the user. Configurator also provides real-time validation of properties to ensure that a
configuration is valid before downloading code to the MCU.
The following steps will detail the configuration of the C8051F850 peripherals to generate a PWM output based on
the measured ADC input. In summary:
Timers
Watchdog Timer
WDT Enable—Disable
TIMER 2 (16-bit Timer with Auto Reload, Overflow at 1 kHz)
Run Control—Start
Timer Overflow Frequency—1000
PCA 0 (8-bit PWM, Frequency = 1 kHz)
Channel 0 Capture/Compare Mode—Predefined 8~11-bit pulse modulator
PCA Counter/Timer Run Control—Start
Analog
ADC 0 (8-bit Mode, 1x gain, Sample P1.2 on Timer 2 overflow)
Enable 8-bit Mode—8-bit Mode
Gain Control—1x gain
Resolution—8-bit
Enable ADC—Enabled
Start of Conversion—Timer 2 overflow
Positive Input Selection—ADC0.10 (P1.2)
Voltage Reference
Select Voltage Reference—VDD pin
Core
Interrupts
Enable ADC0 Conversion Complete Interrupt—Enabled
Enable All Interrupts—Enabled
Port I/O
Peripheral Mapping
PCA0_CEX0—Checked
Enable Crossbar—Enabled
P0.0 - P0.7
Skip—Skipped
P1.0
IOMode—Digital Push-Pull Output
P1.2
IOMode—Analog I/O
Skip—Skipped