ht82a836r Holtek Semiconductor Inc., ht82a836r Datasheet - Page 18

no-image

ht82a836r

Manufacturer Part Number
ht82a836r
Description
Usb Audio Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HT82A836R
Manufacturer:
HOLTEK/合泰
Quantity:
20 000
Programming Considerations
Within the user program, one of the first things to con-
sider is port initialisation. After a reset, all of the data and
port control register will be set high. This means that all
I/O pins will default to an input state, the level of which
depends on the other connected circuitry and whether
pull-high options have been selected. If the PAC, PBC,
PCC, PDC, PEC and PFC port control registers, are
then programmed to setup some pins as outputs, these
output pins will have an initial high output value unless
the associated PA, PB, PC, PD, PE and PF port data
registers are first programmed. Selecting which pins are
inputs and which are outputs can be achieved byte-wide
by loading the correct value into the port control register
or by programming individual bits in the port control reg-
ister using the SET [m].i and CLR [m].i instructions.
Note that when using these bit control instructions, a
read-modify-write operation takes place. The
microcontroller must first read in the data on the entire
port, modify it to the required new bit values and then re-
write this data back to the output ports.
Rev. 1.00
Read/Write Timing
Input/Output Ports
18
Timer/Event Counters
The provision of timers form an important part of any
microcontroller giving the designer a means of carrying
out time related functions. The device contains two in-
ternal 16-bit count-up timers each of which has three op-
erating modes. The timer can be configured to operate
as a general timer, external event counter or as a pulse
width measurement device.
There are three registers related to each of the
Timer/Event Counters, these are a pair or timer regis-
ters and a control register. The register pairs TMR0L/
TMR0H and TMR1L/TMR1H contain the 16-bit timing
value. Writing to these register pairs places an initial
starting value in the Timer/Event Counter preload regis-
ters while reading them retrieves the contents of the
Timer/Event Counter. The TMR0C and TMR1C regis-
ters are the Timer/Event Counter control registers,
which define the timer options, and determines how the
timers are to be used. The timer clock source can be
configured to come from the internal system clock
source or from an external clock on shared pin
PC1/TMR0 and PC2/TMR1.
HT82A836R
March 20, 2008

Related parts for ht82a836r