《开发教程3AI语音人脸识别会议记录仪_人脸打卡机定时器.docx》由会员分享,可在线阅读,更多相关《开发教程3AI语音人脸识别会议记录仪_人脸打卡机定时器.docx(25页珍藏版)》请在第一文库网上搜索。
1、CC3200AI实验教程疯壳开发板系列Wo1verine-Team2018/07/18目录11寄存器11.2实验现象19官网地址:http:WWW.fe)ke.c1ub购买链接:http:ShoP官方QQ群:193836402定时器1.1寄存器CC3200包含4个32位用户可编程通用定时器(TimerAO-3),通用定时器可以对定时器输入引脚的外部事件进行计数或定时。每个定时器模块包含2个16位的定时/计数器(TimerA和TimerB),可以作为定时器或事件计数器独立工作,也可以作为一个32位定时器工作。CC3200的定时器具有多种操作模式:16位或32位可编程单次定时器;16位或32位可编
2、程周期定时器;16位通用定时器,带8位预分频器;16位输入边沿计数或时间捕捉模式,带8位预分频器;16位脉冲宽度调制模式(PWM),带8位预分频器和软件可编程输入。具有以下特性:a向上或向下计数;b、16个16位或32位捕捉比较PWM(CCP)引脚;c、可以确定产生定时器中断到进入中断服务程序(ISR)的时间;d、可以触发使用DMA的高效传输;e系统时钟运行(80MHz)。GPTMCFG寄存器主要是配置通用定时器模块的全局操作。确定通用定时器工作于32位模式还是16位模式。该寄存器中的值只能是在GPTMCT1寄存器中的TAEN和TBEN两位被清零时改变。如图1.0.1所示。Figure9-5.
3、GPTMCFGRegister31302928272625242322212019181716RESERVEDR-Oh1514131211109876543210RESERVEDGPTMCFGR-OhRW-0hTab1e9-9.GPTMCFGRegisterFie1dDescriptionsBitFie1dTypeResetDescription31-3RESERVEDROh2-0GPTMCFGR/WOhGPTMConfigurationTheGPTMCFGva1uesaredefinedasfo11ows:1h-3h=Reserved5h-7h=ReservedOh=Fora16/32-bi
4、ttimer,thisva1uese1ectsthe32-bittimernfiguration.4h=Fora16/32-bittimer,thisva1uese1ectsthe16-bittimernfiguration.Thefunctioniscontro11edbybits1:0ofGPTMTAMRandGPTMTBMR.图1.0.1GPTMCFG寄存器20位:写入0,配置为32位定时器模式;写入4,配置为16位定时器模式。GPTMTAMR寄存器配置是基于GPTMCFG寄存器的配置来进行选择的。在PWM模式中,置位TAAMS位、清除TACMR位和配置TAMR为0x01或者0x02。寄
5、存器如图1.0.2所示,位定义如图1.0.3所示。ryut;bpjrmmrr=y0u;13130292827262524RESERVEDR-Oh2322212019181716RESERVEDR-Oh15141312111098RESERVEDTAP1OTAMRSUTAPWMIETAI1DR-OhRW)hR/W-OhR/W-OhFVW-Oh7654321ORESERVEDTAMIETACDIRTAAMSTACMIRTAMRR-OhRW-0hRW-OhRM)hRW-OhRW0h图1.0.2Gptmtamr寄存器Tab1e9-10.GPTMTAMRRegisterFie1dDescriptions
6、BitFie1dTypeResetDescription31-12RESERVEDROh11TAP1OR/WOhGPTMTimerAPWM1egacyOperationOh=1egacyoperationwithCCPpindriven1owwhenteGPTMTAI1Risre1oadedafterthetimerreaches0.1h=CCPisdrivenHighwhentheGPTMTAI1Risre1oadedafterthetimerreaches0.10TAMRSUR/WOhGPTMTimerAMatchRegisterUpdateIfthetimerisdisab1ed(TAE
7、Nisc1ear)whenthisbitisset,GPTMTAMATCHRandGPTMTAPRareupdatedwhenthetimerisenab1ed.Ifthetimerissta11ed(TASTA11isset),GPTMTAMATCHRandGPTMTAPRareupdatedaccordingtotheconfigurationofthisbit.Oh=UpdatetheGPTMTAMATCHRregisterandtheGPTMTAPRregister,ifused,onthenextcyc1e.1h=UpdatetheGPTMTAMATCHRregisterandthe
8、GPTMTAPRregister,ifused,onthenexttimeout.9TAPWMIETab1e9-10R/WGPTMTAFOhWRRegisteGPTMTimerAPWMInterruptEnab1eThisbitenab1esinterruptsinPWMmodeonrising,fa11ing,orbothedgesoftheCCPoutput,asdefinedbytheTAEVENTfie1dintheGPTMCT1register.Inaddition,whenthisbitissetandacaptureeventoccurs.TimerAautomatica11yg
9、eneratestriggerstotheDMAifthetriggercapabi1ityisenab1edbysettingtheTAOTEbitintheGPTMCT1registerandtheCAEDMAENbitintheGptmdmaevregister,respective1y.Thisbitison1yva1idinPWMmode.Oh=Captureeventinterruptisdisab1ed.1h=Captureeventinterruptisenab1ed.rFie1dDescriptions(continued)BitFie1dTypeResetDescripti
10、on8TAI1DR/WOhGPTMTimerAInterva11oadWriteNotethestateofthisbithasnoeffectwhenuntigup.Thebitdescnptionsaboveapp1yifthetimerisenab1edandrunning.Ifthetimerisdisab1ed(TAENisc1ear)whenthisbitisset,GPTMTARGPTMTAVandGPTMTAPs,areupdatedwenthetimerisenab1ed.Ifthetimerissta11ed(TASTA11isset).GPTMTARandGPTMTAPS
11、areupdatedaccordingtotheConfigUratiOnofthisbitOh=UpdatetheGPTMTARandGPTMTAVregisterswiththeva1ueintheGPTMTAI1Rregisteronthenextcyc1e.A1soupdatetheGPTMTAPSregisterwiththeva1ueintheGPTMTAPRregisteronthenextcyc1e.1h=UpdatetheGPTMTARandGPTMTAVregisterswiththeva1uetheGPTMTAI1Rregisteronthenexttimeout.A1s
12、oupdatetheGPTMTAPSregisterwiththeva1ueintheGPTMTAPRregisteronthenexttimeout.7-6RESERVEDROh5TAMIERWOhGPTMTimerAMatchInterruptEnab1eOhThematchinterruptisdisab1edformatchevents.Additiona11y,triggerstotheDMAonmatcheventsareprevented.1h=Aninterruptisgeneratedwhenthematchva1ueintheGPTMTAMATCHRregisterisre
13、achedintheone-shotandperiodicmodes.4TACDIRR/WOhGPTMTimerACountDirectionWheninPWMmode,thestatusofthisbitisignored.PWMmodea1waysuntsdown.Oh=Thetimercountsdown.1h=Thetimeruntsup.Whencountingup,thetimerstartsfromava1ueof0x0.3TAAMSR/WOhGPTMTimerAA1ternateModeSe1ectTheTAAMSva1uesaredefinedasfo11ows:NoteTo
14、enab1ePWMmode,deartheTACMRb(tandnfiguretheTAMRfie1dto0x1or0x2.OhCaptureorcomparemodeisenab1ed.1h=PWMmodeisenab1ed.2TACMIRR/WOhGPTMTimerACaptureModeTheTACMRva1uesaredefinedasfo11ows:Oh=Edge-Countmode1h=Edge-Timemode1-0TAMRR/WOhGPTMTimerAModeTheTAMRva1uesaredefinedasfo11ows:TheTimermodeisbasedonthetimernfigurationdefinedbybits2:0intheGPTMCFGregister.Oh-Reserved1h=One-ShotTimermode2h=PeriodicTimermode3h=Capturemode图103GPTMTAMR寄存器位定义Gptmtbmr寄存器控制独立定时器B的工作模式。当定时器A和定时器B一起使用时该寄存器被忽略,而是通过GPTMTAMR来控制定时器A和定时器B的工作模式。注意:除了TCACT