| 数据搜索系统,热门电子元器件搜索 |
|
ST9 数据表(PDF) 65 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
ST9 数据表(HTML) 65 Page - STMicroelectronics |
|
65 / 146 page ![]() 65/146 ST9 USER GUIDE 4 USING THE ON-CHIP PERIPHERALS This chapter introduces the main peripherals of the ST9 family. Each variant includes none, one or several peripherals of each type. This allows you to select the variant that best fits your requirements. For high-volume markets, you can order custom versions with exactly the type and number of peripherals required, including the relatively exotic ones not described here but available on request, such as videotext decoders etc. 4.1 PROGRAMMING THE CORE AND PERIPHERALS In addition to describing how each peripheral works, we give examples of the code needed to use them in several configurations. This code is available on the Companion software. You can experiment with the original code or modify it to do the functions you require. Configuring and using the core and the peripherals involves a considerable amount of bit ma- nipulation in the registers. Many variables that drive microcontroller states are Boolean values. To reduce the use of addressable space in registers, bits have been logically grouped in bytes, so the majority of the control registers have their eight bits fully used. To properly program these registers, you need to track the exact position of each bit in each register. You can do this by referring systematically to the appropriate Data Sheet, and com- menting the source text so that it can be easily read and understood later. See the following example: ld R235,#11100000B ; R235 is register MODER ; |||||||+-- HIMP : no foreign access to bus ; ||||||+--- BRQEN : no foreign access to bus ; |||+++---- PRS2,1,0 : processor at full speed ; ||+------- DIV2 : crystal frequency divided by 2 ; |+-------- USP : user stack pointer in registers ; +--------- SSP : system stack pointer in registers spp #0 ; SPI page ld R254,#10000001B ; |||||||+-- SPR0 : SPR1, SPR0 = 01: clock divided by 16 ; ||||||+--- SPR1 : ; |||||+---- CPHA : Input sampled on rising edge ; ||||+----- CPOL : Rest level of serial clock = 0 ; |||+------ BUSY : Set to ready ; ||+------- ARB : No I²C arbitration ; |+-------- BMS : SPI used as a shift register (not I²C) ; +--------- SPEN : SPI enabled |
|
链接网址 |
| 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 |