在线时间2 小时
UID3319012
注册时间2016-10-12
NXP金币0
该用户从未签到
新手上路

- 积分
- 26
- 最后登录
- 2016-11-11
|

楼主 |
发表于 2016-10-13 10:50:03
|
显示全部楼层
感谢小恩GG。还真的是SIM->SCGC |= SIM_SCGC_PIT_MASK; /*!< enable clock to PIT */运行之后没有使能时钟,都怪我太相信库函数了,库函数的定义如下:
/** SIM - Register Layout Typedef */
typedef struct {
__I uint32_t SRSID; /**< System Reset Status and ID Register, offset: 0x0 */
__IO uint32_t SOPT; /**< System Options Register, offset: 0x4 */
__IO uint32_t PINSEL; /**< Pin Selection Register, offset: 0x8 */
__IO uint32_t SCGC; /**< System Clock Gating Control Register, offset: 0xC */
__I uint32_t UUIDL; /**< Universally Unique Identifier Low Register, offset: 0x10 */
__I uint32_t UUIDH; /**< Universally Unique Identifier Middle Low Register, offset: 0x14 */
__I uint32_t UUIDMH; /**< Universally Unique Identifier Middle High Register, offset: 0x18 */
__IO uint32_t CLKDIV; /**< Clock Divider Register, offset: 0x1C */
} SIM_Type;
查阅规格书后发现SCGC的地址不对,太郁闷了,我使用的头文件的名字就是MKE04Z4.h。但是给它补上了地址之后又产生了新的问题,烧写一次程序之后再也不能烧写或者仿真了,解决的办法是用别的工程烧一下,我怀疑是SWD时钟被关掉的问题或者相关引脚没使能的问题,现在还在确认中,为什么库函数会有这样的错误? |
|