Rabbit2000 CPU的中断问题.pdf

所需积分/C币:5 2019-10-18 07:08:10 272KB PDF
收藏 收藏
举报

Rabbit2000 CPU的中断问题pdf,Rabbit2000 CPU的中断问题
Interrupt Request INT粪 Interupt Request萍1 Edgr e INTDA Erupt Request阳0 drrgle-lrrterrupt Request ORed Interrupt Request INTIA Interupt Request #1 T髻 1 km Edge INTOA 30 Interupt Request #0 OR'ed Inlefnuf reauest M4INT吧B4 OR wd-Interrupr Roquest // Function prototypes Ld号3e工sR(} id tin IER(FE ⊥ HE OREExE0,eau比显 main()[ 四Et0 coIE0;//ini贮L面1主2cctE f/ set up port E properly Mr PortI IPEIDE, &PETDRshadow, OxFF): / port E all output Wr PortIIPEIR, &PETREhadow, Ox0OI: r/ initial valuer all zero wrEt工(PEPE,E上saaM:0x00]g 1/ n9 1/0 Strobe pinE Ampere工PEcR,垂PERh,0x22 // enable port B to update on // timer B natch Wr TortI iPETR, PFTREhadow, 0x00H 7/ initial valuea all zero // seE up extermal interrupt 0 EVecLRtarE40,·t0Tp) /A net up external interrupt o vector 陷 rPortI IICT,血工0 Shadow,0x33];/ enable Fa4 ar orcein1 interrupt f±nput, priority3 // Eet up timer E Bl interrupt GetVeetIntetnlOx0B, tinetB ISRI: // Bet up tfner B interrupt veetor WEPOEEI(TICR, &TOCR Shadow, 0x011: / clock timer B with Iperelk/27 // prority HrPorcI ITBLIR, EIULL, OT00)I ArEte工T卫R,lULL:x0》 // aet up initial match Mr PortI ITICER, &TPCSRShadow, 0x03): // enable timer n and TI natch r interrupt vhil。 count c1000 ·d。 nothing· /y diSable all the interruptE WrPoteIlIOCR, & Shadow, 0x0olp// disable ext int a WrFe工 THCER, HPCE品hade智,0x00:/ disable timer B interrupt PE蹈T1F4必t44dB",t)f printf- Ixt int 0 count n 44d\n", countIxctO): #a ext0 Ise: i interrupt is cleared when this function called push hl ld hl(countExto) inc hl r increment counter ld ( countExto), hl hl p工e restore interrupt昌 t #endasm timmer I吕R;; h af push hl d hl(count y inc hl increment counte工 ld (count, hl ;: toggle port E output here - external interrupt will ;: trigger on both rising and talling edge s ld rla rl 1 nd OKEE clear bit 0 (= buzzer on dev boardy oi ld (PEDR)r a i toggle bit 4(0, 1,0,1r.) ioi ld (TBL1R) a ioi ld(TBMIR), a: set up next Bl match at timer=0000h oi ld a, (TBCSR): clear interrupt flag pop hl pop af pres restore interrupt ret 会nda品Ⅲ // function prototypal 2d磁 eInhard1E(3; 口些r日工SR王ret些xna1 interrupta 由法南声害害由由害害害日害度市由由害害害害由害害 int conteXt, count! int1h112。ut。ra rountExto- contB-a // ast up port E properly WE PortI(PEDDR, &PEDDRShadow, OxFF): / port E m all outpute WrPortI(PEFR, &PEFRghadow, 0x00): no I/o strobe pine wrP。rtI(PEDR,面 PEDESRAd,0x00)J !±nia11uea11zex2 Wr PortI(PECR, &PECRShado, 0x22)J / enable port E to update on / timer p match WE Por tI(PEDR, &PEDRShadow, 0x00); / inicial valuea all sero eat up世xer丑1⊥ neattupt BetveetExtern2000(3. extIntRandler]:/ set up vector table WE PortI(IOCE. &IO-CRShadow, 0x33): // enable FE4 aa external y/ interrupt o input. // priority 2, both adger NrPortI(IICE, &IIcEshadow, 0x33>J i enable PE5 as external /r interrupt 1 input // priority 2, both edgea et up timer B interrupt《 match re⊥r1 e冒eet工n已rn[0xQE, cimp工sR)1// get up timer p interrupt weeter We PortI(TRCR, &TDCRShadew, 0x01)i // clock timer D with perelk/2)e // interrupt lerel Wr PortI(TELIR, HULL, 0x00!I We POTEI(TEMIR NULL. 0x0071 // get up init⊥ aI mEch WE PortI(TDCSR, &TDC3RShadow, 0x03): // enable timer o and DL natch f/ inti whi1。(samt<1000 /a do nothing #/: l disable all the intertupt Wr PortI(TBCGR, &TBCSRShadow, 0x00), // disable timer B interrupt Wr PortI(IDCR, 4IOCRShadew, 0x00)!// disable ext int o Wr PortI(IICR. &IIcRshadew, Oxo):// digable ext int 1 printf(" Tiner E count 44d\m", countBI: printf( Ect in ount s 4d\n tasn extIntHandler puch hl ld hl(countExt0y inc hl r increment counter d (contexta) hl pop h1 1P工e i restore interrupta t #en三a品m Hasm timer ISRe push af push hl ld hl count) inc hl increment counter ld (count), hl : toggle port E output here - external interrupts will i, trigger on both rising and falling edge s ld 0x01 and 1 jr z, toggle if bit o was 0, then bits 45=0 ld 0x30 i if bit 0 was 1, then bits 45 togo ioi ld (PEDR), a i toggle bits 0 and 1 together Xor a ioi ld (TBL1R),a ioi Id (TBMlR),a set up next Bl match at timer=0000h ioi ld a, (TBCSR) i clear interrupt flag pop hl pop af ipea ; restore interrupt冒 ret Hendasm ()

...展开详情
试读 8P Rabbit2000 CPU的中断问题.pdf
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    抢沙发
    一个资源只可评论一次,评论内容不能少于5个字
    weixin_38743481 你的留言是对我莫大的支持
    2019-10-18
    • 至尊王者

      成功上传501个资源即可获取
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    Rabbit2000 CPU的中断问题.pdf 5积分/C币 立即下载
    1/8
    Rabbit2000 CPU的中断问题.pdf第1页
    Rabbit2000 CPU的中断问题.pdf第2页
    Rabbit2000 CPU的中断问题.pdf第3页

    试读已结束,剩余5页未读...

    5积分/C币 立即下载 >