欢迎来到天天文库
浏览记录
ID:5317378
大小:3.89 MB
页数:35页
时间:2017-11-23
《kinetis gpio irq step by step 201203a》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、FreescaleKinetisK10GPIOIRQStepbyStep清华Freescale应用开发研究中心薛涛2012年3月Page2KinetisK10TrainingPage3KinetisK10TrainingWhatweused?Reference:DDI0403D_arm_architecture_v7m_reference_manual_errata_markup_1_0.pdfDDI0439B_cortex_m4_r0p0_trm.pdfK10P100M100SF2RM.pdfKQRUG.pdfK10P100M100SF2.pdfAN4445.pd
2、fRevision:Page4KinetisK10TrainingK10boardPage5KinetisK10TrainingK10board电源直流5V100mA调试用串口UART0备用串口UART2Page6KinetisK10TrainingK10boardDebug&ResetbuttonJTAG复位按钮Page7KinetisK10TrainingK10boardLedsLEDsPage8KinetisK10TrainingK10boardPower&ResetPage9KinetisK10TrainingK10boardRS232&JTAGPage10K
3、inetisK10TrainingK10boardCLOCK32768Page11KinetisK10TrainingK10boardCLOCK4MHzPage12KinetisK10TrainingK10boardPowerSupplyPage13KinetisK10TrainingK10LEDsPage14KinetisK10TrainingK10GPIOIRQstepbystepStep1:SIMenablecorrespondGPIOportclockStep2:PCRenablecorrespondGPIOportALT1functionasGPIOIRQf
4、unction,enableIRQStep3:WritetheISRStep4:SendakeytogenerateIRQthroughRS232portPage15KinetisK10TrainingK10ClockpreviousMCG/SIM/OSC20MHzPage16KinetisK10TrainingK10SIMPage17KinetisK10TrainingK10SIMCCode/*Turnonallportclocks*/SIM_SCGC5
5、=SIM_SCGC5_PORTD_MASK;Page18KinetisK10TrainingK10SIMPage
6、19KinetisK10TrainingK10SIMPage20KinetisK10TrainingK10GPIOConfigureControlMode:PORTx_PCRnPinControlRegisterPORTx_GPCLRGlobalPinControlLowRegisterPORTx_GPCHRGlobalPinControlHighRegisterPORTx_ISFRInterruptStatusFlagRegisterPORTx_DFERDigitalFilterEnableRegisterPORTx_DFCRDigitalFilterClockRe
7、gisterPORTx_DFWRDigitalFilterWidthRegisterPage21KinetisK10TrainingK10GPIOPCRInterruptStatusFlagInterruptConfiguration0000Interrupt/DMARequestdisabled.0001DMARequestonrisingedge.0010DMARequestonfallingedge.0011DMARequestoneitheredge.0100Reserved.1000Interruptwhenlogiczero.1001Interrupton
8、risingedge.1010Interruptonfallingedge.1011Interruptoneitheredge.1100Interruptwhenlogicone.DriveStrengthEnableOpenDrainEnablePassiveFilterEnableSlowRateEnablePullEnablePullSelectPullUpPullDownDetailinPage239ofK10P100M100SF2RM.pdf100Page22KinetisK10TrainingK10GPIOPCRPinMuxControl
此文档下载收益归作者所有