| 数据搜索系统,热门电子元器件搜索 |
|
ST9 数据表(PDF) 130 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
ST9 数据表(HTML) 130 Page - STMicroelectronics |
|
130 / 146 page ![]() 130/146 ST9 USER GUIDE 5.5.3 Port Initialisation When you have configured all the peripherals as described above, you should initialise the ports to your requirements: input or output, open drain or push-pull, TTL or CMOS levels, etc. for the parallel I/O ports. You must set the port pins that serve as inputs or outputs for peripherals as either: – Alternate Function for peripheral outputs, or – Regular Input for peripheral inputs The exception is the A/D converter, where you must set the input pin as Alternate Function. 5.5.4 Final Initialisation Install the Working Registers in the group defined for the main program. Set the Page Pointer Register to a default value. Set the Global Counter Enable, the global Interrupt ENable and, if required the Watchdog function. The main program is now ready to run. 5.6 INTERRUPT CONSIDERATIONS The ST9 has two main paging registers: – The RPP register pair that selects the working register group – The PPR register that selects one of 256 pages within register group 15 These registers are essential to the correct working of the program. When an interrupt occurs, it is likely you will have to change either or both of these registers. This is why you must push them to the stack on entry, and pop them back on exit. An interrupt is requested by a bit in a register of a peripheral. This bit is not reset automatically by the fact that the interrupt is serviced. You must reset it in the code of your interrupt service routine. If you write an interrupt service routine in C, by default PPR and all registers used by the rou- tine are pushed on the stack. This can be time-consuming. If your program is entirely written in C, and you use none or few registers explicitly, the register file has enough room to allocate a private working register group for each interrupt service routine. You specify this by a #pragma pseudo-instruction. This method provides the fastest response times. |
|
链接网址 |
| 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 |