參數(shù)資料
型號(hào): CR16HCT9VJE7
英文描述: Microcontroller
中文描述: 微控制器
文件頁(yè)數(shù): 35/157頁(yè)
文件大?。?/td> 1256K
代理商: CR16HCT9VJE7
第1頁(yè)第2頁(yè)第3頁(yè)第4頁(yè)第5頁(yè)第6頁(yè)第7頁(yè)第8頁(yè)第9頁(yè)第10頁(yè)第11頁(yè)第12頁(yè)第13頁(yè)第14頁(yè)第15頁(yè)第16頁(yè)第17頁(yè)第18頁(yè)第19頁(yè)第20頁(yè)第21頁(yè)第22頁(yè)第23頁(yè)第24頁(yè)第25頁(yè)第26頁(yè)第27頁(yè)第28頁(yè)第29頁(yè)第30頁(yè)第31頁(yè)第32頁(yè)第33頁(yè)第34頁(yè)當(dāng)前第35頁(yè)第36頁(yè)第37頁(yè)第38頁(yè)第39頁(yè)第40頁(yè)第41頁(yè)第42頁(yè)第43頁(yè)第44頁(yè)第45頁(yè)第46頁(yè)第47頁(yè)第48頁(yè)第49頁(yè)第50頁(yè)第51頁(yè)第52頁(yè)第53頁(yè)第54頁(yè)第55頁(yè)第56頁(yè)第57頁(yè)第58頁(yè)第59頁(yè)第60頁(yè)第61頁(yè)第62頁(yè)第63頁(yè)第64頁(yè)第65頁(yè)第66頁(yè)第67頁(yè)第68頁(yè)第69頁(yè)第70頁(yè)第71頁(yè)第72頁(yè)第73頁(yè)第74頁(yè)第75頁(yè)第76頁(yè)第77頁(yè)第78頁(yè)第79頁(yè)第80頁(yè)第81頁(yè)第82頁(yè)第83頁(yè)第84頁(yè)第85頁(yè)第86頁(yè)第87頁(yè)第88頁(yè)第89頁(yè)第90頁(yè)第91頁(yè)第92頁(yè)第93頁(yè)第94頁(yè)第95頁(yè)第96頁(yè)第97頁(yè)第98頁(yè)第99頁(yè)第100頁(yè)第101頁(yè)第102頁(yè)第103頁(yè)第104頁(yè)第105頁(yè)第106頁(yè)第107頁(yè)第108頁(yè)第109頁(yè)第110頁(yè)第111頁(yè)第112頁(yè)第113頁(yè)第114頁(yè)第115頁(yè)第116頁(yè)第117頁(yè)第118頁(yè)第119頁(yè)第120頁(yè)第121頁(yè)第122頁(yè)第123頁(yè)第124頁(yè)第125頁(yè)第126頁(yè)第127頁(yè)第128頁(yè)第129頁(yè)第130頁(yè)第131頁(yè)第132頁(yè)第133頁(yè)第134頁(yè)第135頁(yè)第136頁(yè)第137頁(yè)第138頁(yè)第139頁(yè)第140頁(yè)第141頁(yè)第142頁(yè)第143頁(yè)第144頁(yè)第145頁(yè)第146頁(yè)第147頁(yè)第148頁(yè)第149頁(yè)第150頁(yè)第151頁(yè)第152頁(yè)第153頁(yè)第154頁(yè)第155頁(yè)第156頁(yè)第157頁(yè)
35
www.national.com
10.4.7
The ISTAT1 register is a word-wide, read-only register that
indicates which maskable interrupt inputs to the ICU31L
(IRQ16 through IRQ31) are currently active. The register for-
mat is shown below.
15
IST(31:16)
Interrupt Status Register 1 (ISTAT1)
IST(31:16)
Interrupt Status bits. Each bit indicates the cur-
rent status of an interrupt input to the ICU31L,
corresponding to interrupts IRQ16 through
IRQ31. A bit set to 1 indicates an active inter-
rupt input, even when the interrupt is masked
out by the IENAM0 register. A bit cleared to 0
indicates an inactive interrupt input.
10.4.8
The IDBG register is a word-wide read-only register, which
contains various status information of the ICU31L. The low-
est 6 bits contain the INTVECT value during the last read
from address FE00. The next 6 bits contain the INTVECT val-
ue when a maskable interrupt request is sent to the CR16B
core. Upon reset, this register is set to 0000 hex.
Interrupt Debug Register
10.5
INTERRUPT PROGRAMMING
PROCEDURES
The following subsections provide information on initializing
the device for interrupts, clearing interrupts, and nesting in-
terrupts.
10.5.1
Upon reset, all interrupts are disabled. To program the device
for interrupt operation and to enable interrupts, use the fol-
lowing procedure in the application software:
1. Set the Interrupt Stack Pointer (ISP)
2. Load the INTBASE register so that it points to the base
of the Interrupt Dispatch Table.
3. Perform any required preparation steps for the interrupt
service routines.
4. Initialize the peripheral devices that can generate inter-
rupts and set their respective interrupt enable bits.
5. Set the relevant bits in the interrupt mask registers
(IENAM0 and IENAM1)
Note: The MIWU16 interrupts have no local interrupt en-
able bits, which means you can only disable the
MIWU16 interrupts if you clear the specific bits in the IE-
NAM register.
6. Use the Load Processor Register (LPR) instruction to
set I bit in the PSR register.
7. When the device is ready to execute interrupts, set the
E bit in the PSR register by executing the Enable Inter-
rupts (EI) instruction.
Once maskable interrupts are enabled by setting the E and I
bits, you can disable and re-enable all maskable interrupts lo-
cally by using the Enable Interrupts (EI) and Disable Inter-
rupts (DI) instructions, which set and clear the E bit.
Initialization
10.5.2
Clearing an interrupt request before it is serviced may cause
a spurious interrupt because the CPU may detect an inter-
rupt not reflected in the Interrupt Vector (IVCT) register. To
ensure reliable operation, clear interrupt requests only while
interrupts are disabled.
Changing the polarity of an interrupt input (for example, in the
Multi-Input Wake-Up module) can cause a spurious interrupt,
and therefore should be done only while interrupts are dis-
abled.
For the same reason, clearing an enable bit in a peripheral
module should be carried out only while the interrupt is dis-
abled.
Clearing Interrupts
10.5.3
Interrupts may be nested, or in other words, an interrupt ser-
vice routine can itself be interrupted by a different interrupt
source. There is no hardware limitation on the number of in-
terrupt nesting levels. However, the interrupt stack must not
be allowed to overflow its allocated memory space.
Unless specifically enabled by the software, nested inter-
rupts will not occur. When the CPU acknowledges an inter-
rupt, the I bit in the PSR register is automatically cleared to 0
for the duration of the service routine, disabling any further
maskable interrupts.
To allow nested interrupts, an interrupt service routine should
first set or clear the respective interrupt enable bits to specify
which peripherals will be allowed to interrupt the current ser-
vice routine. The present interrupt routine should be disabled
(or interrupt pending bit cleared). The service routine should
then set the PSR.I bit to 1, thus enabling maskable interrupts.
This bit can be controlled with the Store Processor Register
(SPR) and Load Processor Register (LPR) instructions.
Note:
Clearing the pending bit of the current interrupt should not be
immediately followed by enabling further interrupts by setting
the I bit in the PSR register. Wait states must be inserted into
the software after clearing the interrupt pending bit and be-
fore another interrupt. Placing a NOP instruction will perform
this instruction. This is because the instruction which resets
the pending bit may not yet be finished when the interrupts
are already enabled again by setting the I bit in the PSR reg-
ister. To avoid this situation the user has to make sure that
prior to enabling the interrupt an additional instruction is in-
serted. This could look like the example below:
SBITi $0, T1ICRL # clear pending bit
NOP
MOVW $0x0a00, r0 # enable further interrupts
LPR
r0, psr
A CBITi or SBITi instruction may be used to clear the interrupt
pending bit. In such cases, a spurious interrupt may occur.
Nesting Interrupts
# NOP instruction
0
相關(guān)PDF資料
PDF描述
CR16HCT9VJE7Y Microcontroller
CR16HCT9VJE8 Microcontroller
CR16HCT9VJE8Y Microcontroller
CR16HCT9VJE9 Microcontroller
CR16HCT9VJE9Y Microcontroller
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
CR16HCT9VJE7Y 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Microcontroller
CR16HCT9VJE8 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Microcontroller
CR16HCT9VJE8Y 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Microcontroller
CR16HCT9VJE9 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Microcontroller
CR16HCT9VJE9Y 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Microcontroller