beginer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

beginer

375 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jackzq on Fri May 31 10:49:54 MST 2013
Hi,

I just start to work the project using Micro LPC1114. Everything is new to me.

The first project I start is systick of Micro LPC1114.

During I debugged the code; I have one question I could not figure out as follow:

[B][COLOR=#7f0055][FONT=Courier New]int[/FONT][/COLOR][/B][COLOR=black][FONT=Courier New] [B]main[/B] ([/FONT][/COLOR][B][COLOR=#7f0055][FONT=Courier New]void[/FONT][/COLOR][/B][COLOR=black][FONT=Courier New]) {[/FONT][/COLOR][FONT=Courier New][/FONT]
[FONT=Courier New] [/FONT]
[COLOR=black][FONT=Courier New]  [/FONT][/COLOR][COLOR=#3f7f5f][FONT=Courier New]/* Called for system library in core_cmx.h(x=0 or 3). */[/FONT][/COLOR][FONT=Courier New][/FONT]
[COLOR=black][FONT=Courier New]  SysTick_Config( SysTick->[/FONT][/COLOR][COLOR=#0000c0][FONT=Courier New]CALIB[/FONT][/COLOR][COLOR=black][FONT=Courier New] + 1 );[/FONT][/COLOR]
[COLOR=black][FONT=Courier New] [/FONT][/COLOR]
[COLOR=black][FONT=Courier New]Druring debug, I found that SysTick->[/FONT][/COLOR][COLOR=#0000c0][FONT=Courier New]CALIB[/FONT][/COLOR][COLOR=#0000c0][FONT=Courier New] [/FONT][/COLOR][FONT=Courier New]is 479999[COLOR=#0000c0]. [/COLOR]But I want to know where [COLOR=black]SysTick->[/COLOR][COLOR=#0000c0]CALIB[/COLOR][COLOR=#0000c0] [/COLOR]was assigned to 479999 and how it is assigned ? [/FONT]
[FONT=Courier New] [/FONT]
[FONT=Courier New]Thank you,[/FONT]
[FONT=Courier New] [/FONT]
[FONT=Courier New]Jack [/FONT]
0 项奖励
回复
1 回复

368 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Fri May 31 14:35:32 MST 2013
[FONT=Tahoma][SIZE=2][COLOR=black]SysTick->[/COLOR][/SIZE][/FONT][FONT=Tahoma][SIZE=2][COLOR=#0000c0]CALIB[/COLOR][/SIZE][/FONT][FONT=Tahoma][SIZE=2][COLOR=black] is 'constructed' in a CMSIS header file (for your particular MCU)
to 'point to' an on-chip hardware register. [Part of the hardware systick timer.]

At reset, this register is initialised to a number to get 10 millisecond ticks.

This is where the [/COLOR][/SIZE][/FONT][FONT=Tahoma][SIZE=2]479999 comes[/SIZE][/FONT][FONT=Tahoma][SIZE=2] from.

Perhaps you need to do background reading (of the user manual for the device)
and then look at the CMSIS files until you can understand what is going on.

The user manuals are setup so you can read the first few chapters, and skip most
of the on-chip peripherals until you actually want to use them.

Read Intro, Memory, System Control/Clocks first.
Then Pin configuration, then NVIC (interrupts), then any peripherals you need
e.g. 'SysTick'.

It will take a while (and several readings), but (if you want to progress with Cortex MCU's) it will be well worth it.

Cheers, Mike
[/SIZE][/FONT][FONT=Tahoma][SIZE=2]

[/SIZE][/FONT]
0 项奖励
回复