ARM Learning Notes---Interrupts

Publisher:创意航海Latest update time:2017-11-17 Source: eefocusKeywords:ARM  Interrupt Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Interrupt priority from high to low

51 single-chip microcomputer: INT0 (P3.2), TIMER0, INT1 (P3.3), TIMER1, serial port interrupt (P3.0, P3.1)

52 single chip microcomputer:TIMER2

External interrupt falling edge trigger

Internal timer: TMOD register (M1M0)

M1 M0 method

0 0 0 13 bits

0 1 1 16 bits

1 0 2 8 auto

1 1 3 Two 8-bit


Serial port {RI->while(RI!)

TI->while(TI!)}


When an interrupt occurs while executing an instruction, execute this instruction first and then handle the interrupt.

The way the microcontroller exchanges information with the outside world: polling, interrupt, DMA


2451 53 interrupt sources

Program initial address: 0x30000000

Interrupt vector address: 0x00000000


Interrupt Mode:

IRQ: Normal trigger interrupt mode

FIQ: Fast interrupt mode (used in emergency situations, high priority)


register:

SRCPND1 first identification register, 32 bits, corresponding to the interrupt request, this position is 1, the default value is 0

INTMSK mask register, 32 bits, the corresponding interrupt is masked and this position is 1, the default is 1

INTPND tail mark register, 32 bits, same as the first mark register

SUBSRCPND sub-identification register, 32 bits,

INTSUBMSK Sub-mask register, 32 bits,

PRIORITY priority register, 28 bits,

INTMOD mode register, 32 bits, all set to 0 by default, 0 represents IRQ mode, 1 represents FIQ




(Not blocked)->INTMODE (IRQ)->PRIORITY (10, 12, 28)->INTPND (10 position 1)->INTOFFSET (set to 10)->TIMR0 interrupt service function (ISR)->INTPND, SRCPND, SUBSRCPN

Clear the 10th interrupt flag



1. Default priority order

2. No blocking

3.IRQ Mode


Timer interrupt:


51 single chip microcomputer:

Clock cycle: 1/110592M = 1.09us, 1/12M

Mechanical cycle: 12*1.09us,

2 mechanical cycles = 1 beat

Instruction cycle = several mechanical cycles (>=1)




T0, 1, 16-bit TH0 (high 8 bits); add count->65535 overflow

2^16 - 1 = 65535

12M Mechanical cycle 1us

65.535ms


Timing 50ms

TH0 = (65535-50000)/256; //high 8 bits

TL0 = (65535-50000)%256; //low 8 bits



2451:

PWM: Duty cycle High level time


register:

TCFG: Prescaler register, 32 bits

TCON: Timer control register, 22 bits

TCNTB: Count Register

TCMPB: Compare Register

TCNTO: Observing TCNTB


Simple timer initialization steps:

1. Configure the pre-scaling factor (199)

2. Configure the frequency division coefficient (8)

3. Configure the initial value of the count (41250)

4. Configure as automatic reload function (TCON)

5. Update initial value (TCON)

6. Start the timer (TCON)

7. Clear bit (Update initial value control bit) (TCON)


Keywords:ARM  Interrupt Reference address:ARM Learning Notes---Interrupts

Previous article:ARM Study Notes---Serial Port
Next article:ARM Notes: ADC Converter

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号