| 数据搜索系统,热门电子元器件搜索 |
|
ST9 数据表(PDF) 123 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
ST9 数据表(HTML) 123 Page - STMicroelectronics |
|
123 / 146 page ![]() 123/146 ST9 USER GUIDE 5.4.3.2 Initialisation Code The initialisation code mainly has to initialise the core. The core contains certain control regis- ters that must be set to correct values or the program will fail to start. They are listed in the table below. They are in the order they are initialized in a typical start-up file, though this order is somewhat arbitrary. Register Number Register Name Function(*) Comments 235 MODER Selects the space where the stacks re- side (register file or memory), main clock divider on/off, clock prescaler division rate. If power and electromagnetic interference are not a concern, the prescaler can be set to zero so that the processor runs at full speed. Otherwise, the speed/ consumption trade-off can be handled at will accord- ing to the needs of the program. 231 FLAGR Selects the single space of twin-space mode for the memory. In the “ST9” mode the DP bit of this register selects program memory when cleared, or data memory when set. It must be changed using the sdm and spm instructions. Typically, one of these is used at the be- ginning of the program and remains unchanged after- wards. On some occasions, it may be changed, for example to access tables of constants in ROM if two spaces are used. Therefore in “ST9” mode, DP must be set with the sdm instruction (used only once in the start-up pro- gram) to set the use of DPR register to address data memory. The spm instruction must not be used. To access data through the CSR register, use the ldpd, lddp or ldpp instruction. 238-239 SSP Position of the top of the system stack in memory or register file No subroutine or function call may be performed be- fore the initialisation of SSP and MODER. Note that since a call first decrements the stack pointer by two and then writes the return address, if the stack is po- sitioned in the register file, it may be initialised to the register number of the top of stack + 1 to save stack space. 236-237 USP Position of the top of the user stack in memory or register file. Unused if only one stack is used. 232-233 RP0-RP1 Selects the mode for the working registers as well as the abso- lute register numbers for r0 and r8. These registers are set using the srp, srp0 and srp1 instructions. See the description of working registers in Section 3.1.4. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |