BS2824 Holtek Semiconductor Inc., BS2824 Datasheet - Page 63
BS2824
Manufacturer Part Number
BS2824
Description
Touch Key Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
1.BS2824.pdf
(92 pages)
- Current page: 63 of 92
- Download datasheet (501Kb)
Interrupts
Rev. 1.00
PWM Output Control
PWM Programming Example
The PWM outputs are pin-shared with I/O pins. To operate as a PWM output and not as an I/O pin,
the correct bits must be set in the CTRL0 register. A zero value must also be written to the
corresponding bit in the I/O port control register to ensure that the corresponding PWM output pin is
setup as an output. After these two initial steps have been carried out, and of course after the required
PWM value has been written into the PWMn register, writing a high value to the corresponding bit in
the output data register will enable the PWM data to appear on the pin. Writing a zero value will
disable the PWM output function and force the output low. In this way, the Port data output registers
can be used as an on/off control for the PWM function. Note that if the CTRL0 register has selected
the PWM function, but a high value has been written to its corresponding bit in the PAC or PCC
control register to configure the pin as an input, then the pin can still function as a normal input line,
with pull-high resistor options.
The following sample program shows how the PWM0 output is setup and controlled.
Interrupts are an important part of any microcontroller system. When an external event or an internal
function such as a Timer/Event Counter or Time Base requires microcontroller attention, their
corresponding interrupt will enforce a temporary suspension of the main program allowing the
microcontroller to direct attention to their respective needs.
The devices contain a single external interrupt and multiple internal interrupts. The external
interrupt is controlled by the action of the external interrupt pin, while the internal interrupt is
controlled by the Timer/Event Counters and Time Base overflows.
mov
mov
set
set
clr
set
: :
clr
a,64h
pwm0,a
ctrl0.5
ctrl0.3
pac.4
pa.4
pa.4
; setup PWM value of decimal 100
; select the 7+1 PWM mode
; select pin PA4 to have a PWM function
; setup pin PA4 as an output
; enable the PWM output
; disable the PWM output_ pin
; PA4 forced low
Interrupt Scheme
63
BS2824/BS2854/BS2868
Touch Key MCU
January 27, 2010
Related parts for BS2824
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Ht46r63/ht46c63 -- A/d With Lcd Type 8-bit Mcu
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ht6221/ht6222 -- Multi-purpose Encoders
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ht6230 -- Infrared Remote Encoder
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ht6571 -- Multiple Rs-232 Drivers And Receivers Restricted Products
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ps/2 Mouse Controller
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
I/o Ttl Integration
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ht82m98a -- 3-key 3d Usb+ps/2 Mouse Controller
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ht82k68e -- Multimedia Keyboard Encoder 8-bit Otp Mcu
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ht82v732 -- 60ma Audio Power Amp
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
16-bit Ccd/cis Analog Signal Processor
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
22-memory Tone/pulse Dialer
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ht93lc66 -- Cmos 4k 3-wire Serial Eeprom
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
1k/2k/4k-bit Hi2c Interface Serial Eeprom
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
Ht6p20x -- 2^24 Otp Encoder
Manufacturer:
Holtek Semiconductor Inc.
Datasheet:
Part Number:
Description:
High Voltage Regulator
Manufacturer:
Holtek Semiconductor Inc.
Datasheet: