程序不变, 烧到另一块板子, 晶振12MHz,肯定usb通不过,PLL运行有问题, 卡在
if (mcg_clk_hz < 0x100)
while(1);
mcg_clk_hz 是35, 即0x23
mcg_clk_hz = pll_init(CLK0_FREQ_HZ, /* CLKIN0 frequency */
在pll_init() 中,
if (!(MCG_S & MCG_S_OSCINIT0_MASK)) return 0x23; // check bit is really set and return with error if not set
================
把
#define CLK0_FREQ_HZ 8000000
#define PLL0_PRDIV 4 // divider eference by 4 = 2 MHz
修改为
#define CLK0_FREQ_HZ 12000000
#define PLL0_PRDIV 6 // divider eference by 6 = 2 MHz
居然还是不行
if (mcg_clk_hz < 0x100)
while(1);
mcg_clk_hz 是35, 即0x23
if (!(MCG_S & MCG_S_OSCINIT0_MASK)) return 0x23; // check bit is really set and return with error if not set