在定时器ISR中,我只切换一个输出并设置一个标志,所以它绝对不是200个时钟周期。根据该设备的实际频率,我很确定它是在80 MHz的系统时钟,然后是40 MHz的外围时钟。以下是我的配置位://DeFCFG3//USERID=PrimaMatlab配置,FSRSSEL=PrimyTyIs7//SRS选择(SRS优先级7)(SRS=影子寄存器),Op/TraceMac配置,FMIIN=//Ethernet RMII/MII启用(MII启用)Oracle配置文件FANKION/ON-I/O PIN选择(默认的I/O)PLL Input Divider / PrimaMac配置FuBidio= ON//USB USED选择(由USB模块控制){ PrLulMull=Mulr20//PLL乘法器(20X乘法器)〉PrimaMac配置LoopLi=DIVI12//USB PLL输入分频器(12X分频器)α-PrimaMaung=OU//USB PLL使能(禁用和旁路)α-PracMA配置FPLLoDIV= DIVIO1//系统PLL输出时钟分频器(PLL除以1)//DEVFGCPLL/FNOSCC=FRCPLL//振荡器选择位(带PLL的快速RC OSC)、PrimaMac配置、FSOSCEN=OF//次级振荡器使能(禁用)在OSCO PIN(启用)//Py-PracMA配置文件FPBDIV=DIVI8//外围时钟除数(PBY-CK是SysLCK/8)α- PrAPMA DFIDE2/ /外围时钟除数(PBH-CK是SysLCK/8)α-PrAPMA配置FCKSM=CSDCMD//时钟交换NG和监视器选择(时钟开关禁用,FSCM禁用)Timer Postscaler,PHT108566//看门狗(1:1048 57)),PracMA配置FFDTEN=关闭/ /看门狗定时器启用(WDT禁用(SWDTEN位控制))//DVCFG0* PracMA配置调试(OFF)/背景调试器启用(调试)“R是禁用的”(Oracle)TraceMac配置,ICESL=ICSU-PGX2//ICE/ICD COMM信道选择(ICEUC2/EUD2引脚与PGC2/PGD2共享)OTECT(保护禁用)
以上来自于百度翻译
以下为原文
In the timer ISR, I only toggle an output and set a flag, so it's definitely not 200 clock cycles.
As per the actual frequency of the device, I'm pretty sure it's at 80 MHz for the system clock, and then 40 MHz for the peripheral clock. Here are my configuration bits:
// DEVCFG3
// USERID = No Setting
#pragma config FSRSSEL = PRIORITY_7 // SRS Select (SRS Priority 7) (SRS = Shadow Registers)
#pragma config FMIIEN = ON // Ethernet RMII/MII Enable (MII Enabled)
#pragma config FETHIO = ON // Ethernet I/O Pin Select (Default Ethernet I/O)
#pragma config FCANIO = ON // CAN I/O Pin Select (Default CAN I/O)
#pragma config FUSBIDIO = ON // USB USID Selection (Controlled by the USB Module)
#pragma config FVBUSONIO = ON // USB VBUS ON Selection (Controlled by USB Module)
// DEVCFG2
#pragma config FPLLIDIV = DIV_2 // PLL Input Divider (2x Divider)
#pragma config FPLLMUL = MUL_20 // PLL Multiplier (20x Multiplier)
#pragma config UPLLIDIV = DIV_12 // USB PLL Input Divider (12x Divider)
#pragma config UPLLEN = OFF // USB PLL Enable (Disabled and Bypassed)
#pragma config FPLLODIV = DIV_1 // System PLL Output Clock Divider (PLL Divide by 1)
// DEVCFG1
#pragma config FNOSC = FRCPLL // Oscillator Selection Bits (Fast RC Osc with PLL)
#pragma config FSOSCEN = OFF // Secondary Oscillator Enable (Disabled)
#pragma config IESO = ON // Internal/External Switch Over (Enabled)
#pragma config POSCMOD = OFF // Primary Oscillator Configuration (Primary osc disabled)
#pragma config OSCIOFNC = ON // CLKO Output Signal Active on the OSCO Pin (Enabled)
//#pragma config FPBDIV = DIV_8 // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/8)
#pragma config FPBDIV = DIV_2 // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/8)
#pragma config FCKSM = CSDCMD // Clock Switching and Monitor Selection (Clock Switch Disable, FSCM Disabled)
#pragma config WDTPS = PS1048576 // Watchdog Timer Postscaler (1:1048576)
#pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled (SWDTEN Bit Controls))
// DEVCFG0
#pragma config DEBUG = OFF // Background Debugger Enable (Debugger is disabled)
#pragma config ICESEL = ICS_PGx2 // ICE/ICD Comm Channel Select (ICE EMUC2/EMUD2 pins shared with PGC2/PGD2)
#pragma config PWP = OFF // Program Flash Write Protect (Disable)
#pragma config BWP = OFF // Boot Flash Write Protect bit (Protection Disabled)
#pragma config CP = OFF // Code Protect (Protection Disabled)