AP160 AMICC [AMIC Technology], AP160 Datasheet - Page 7

no-image

AP160

Manufacturer Part Number
AP160
Description
8-BIT MICROCONTROLLER WITH 8KB OTP
Manufacturer
AMICC [AMIC Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AP1601M10LA
Manufacturer:
DIODES/美台
Quantity:
20 000
Part Number:
AP1601M8LA
Manufacturer:
DIODES/美台
Quantity:
20 000
Part Number:
AP1602
Manufacturer:
DIODES/美台
Quantity:
20 000
Part Number:
AP1603WA
Manufacturer:
DIODES
Quantity:
9 000
Part Number:
AP1603WA
Manufacturer:
DIODES/美台
Quantity:
20 000
Part Number:
AP1603WL-7
Manufacturer:
DIDOES
Quantity:
6 000
Part Number:
AP1604AWA
Manufacturer:
DIODES/美台
Quantity:
20 000
Part Number:
AP1604AWG-7
Manufacturer:
DIDOES
Quantity:
6 000
Part Number:
AP1604AWL-7
Manufacturer:
DIDOES
Quantity:
9 000
Part Number:
AP1609SG-13
Manufacturer:
TI
Quantity:
12 500
Company:
Part Number:
AP1609SG-13
Quantity:
5 000
TIMER2
Timer2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by
bit C/T2 in the SFR T2CON (shown in Table 2). Timer 2 has three operating modes: capture, auto-reload (up or down
counting), and baud rate generator. The modes are selected by bits in T2CON, as shown in Table 3.
Table 2. T2CON – Timer/Counter 2 Control Register
T2CON Address = 0C8H
Reset Value = 00000000
Bit Addressable
Table 3. Timer 2 Operating Modes
Timer2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine
cycle. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.In the
Counter function, the register is incremented in response to a 1-to-0 transition at its corresponding external input pin, T2.
In this function, the external input is samples show a high in one cycle and a low in the next cycle, the count is incremented.
The new count value appears in the register during S3P1 of the cycle following the one in which the transition was detected.
Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0 transition, the maximum count rate is
1/24 of the oscillator frequency. To ensure that a given level is sampled at least once before it changes, the level should be
held for at least one full machine cycle.
Version 0.0
Symbol
CP/RL2
EXEN2
Bit
RCLK
TCLK
EXF2
C/T2
TR2
TF2
RCLK+TCLK
Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software. TF2 will not be set when
either RCLK = 1 or TCLK = 1.
Timer 2 external flag set when either a capture or reload is caused by a negative transition on T2EX and
EXEN2 = 1. When Timer 2 interrupt is enabled, EXF2 = 1 will cause the CPU to vector to the Timer 2 interrupt
routine. EXF2 must be cleared by software. EXF2 does not cause an interrupt in up/down counter mode
(DCEN=1).
Receive clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its receive clock in
serial port Modes 1 and 3. RCLK = 0 causes Timer 1 overflows to be used for the receive clock.
Transmit clock enable. When set, causes the serial port to use Timer 2 overflow pulses for its transmit clock in
serial port Modes 1 and 3. TCLK = 0 causes Timer 1 overflows to be used for the transmit clock.
Timer 2 external enable. When set, allows a capture or reload to occur as a result of a negative transition on
T2EX if Timer 2 is not being used to clock the serial port. EXEN2 = 0 causes Timer 2 to ignore events at T2EX.
Start/Stop control for Timer 2. TR2 = 1 starts the timer.
Timer or counter select for Timer 2. C/T2 = 0 for timer function. C/T2 = 1 for external event counter (falling edge
triggered0.
Capture/Reload select. CP/RL2 = 1 causes captures to occur on negative transitions at T2EX if EXEN2 = 1.
CP/Rl2 = 0 causes automatic reloads to occur when Timer 2 overflows or negative transitions occur at T2EX
when EXEN2 = 1. When either RCLK or TCLK = 1, this bit is ignored and the timer is forced to auto-reload on
Timer 2 overflow.
TF2
7
0
0
1
X
EXF2
6
RCLK
CP/RL2
5
X
X
0
1
TCLK
4
7
Function
EXEN2
3
TR2
1
1
1
0
TR2
2
AMIC Technology, Inc.
Baud Rate Generator
16-Bit Auto-Reload
C/T2
16-Bit Capture
1
MODE
(Off)
AP160
CP/RL2
0

Related parts for AP160