HTML5参考手册(英文版)
![HTML5参考手册(英文版)](https://img.360docs.net/img4e/02cvd08gqdb3wmqpsbuq-e1.webp)
![HTML5参考手册(英文版)](https://img.360docs.net/img4e/02cvd08gqdb3wmqpsbuq-92.webp)
TABLE A.1 HTML Global Attributes
The following attributes may be used with most HTML elements
Global Attribute Description
accesskey For adding a keyboard shortcut to an element
aria-* For associating accessibility attribute values specified by WAI-ARIA class For identifying a set of elements in order to apply styles to them contenteditable For making the content of an element editable
contextmenu For identifying a contextual menu for an element (the value must be the same as a menu element’s id attribute)
data-* For storing custom data that is private to the page or application
dir For specifying the element’s text direction
draggable For making an element draggable
dropzone For identifying an element as a place where draggable elements can be dropped
event For associating an element with a script (event is a placeholder for the actual event name) hidden For indicating that an element is not yet relevant or is no longer relevant
id For identifying a particular element so that it can be linked to, styled, or scripted with JavaScript lang For specifying the language an element is written in
role For providing additional information to assistive devices about the role of an element as defined by WAI-ARIA
spellcheck For indicating whether the content of an element should have its spelling and grammar checked style For adding local style sheet information
tabindex For defining the order in which the Tab key takes the visitor through elements
title For labeling elements with tool tips
TABLE A.2 HTML Elements and Attributes
Element/Attribute(s) Description
a For creating links and anchors
href For specifying the URL of a page or the name of an anchor that a link goes to
hreflang For specifying the language of the linked resource
media For describing the media for which the target document was defined
rel For identifying the nature of the link
target For specifying the window or iframe where a link should open
type For noting a resource’s MIME type
abbr For explaining the meaning of abbreviations and acronyms
address For identifying contact information for the nearest article or body element ancestor area For specifying the coordinates of image maps
accesskey For adding a keyboard shortcut to a particular region of the map
alt For giving information about an area
coords For giving the coordinates of an area in an image map
href For specifying the destination URL of a link in an area of an image map
hreflang For specifying the language of the linked resource
media For describing the media for which the target document was defined
rel For identifying the kind of link
shape For specifying the shape of an area in an image map
target For specifying the window or iframe where a link should open
article For identifying a self-contained composition in a page that is in principle independently distributable or reusable
aside For identifying a section of a page that consists of content that is tangentially related to the content around it
audio For embedding sound or audio in a page
autoplay For telling the browser to start playing the audio file as soon as it can
controls For telling the browser to provide controls for the audio element
crossorigin For setting cross-origin request credentials
loop For telling the audio file to start over without interruption upon reaching its end mediagroup For associating multiple media files together
muted For controlling the default state of audio output
preload For specifying whether the browser can begin downloading the audio file before the visitor starts playing it
src For identifying the URL of the audio file to play
b For identifying a span of text to which attention is being drawn for utilitarian purposes, without conveying any extra importance and with no implication of an alternate voice or mood
base For specifying the base URL of the page
href For specifying the URL to be used to generate relative URLs target For specifying the default target for the links on the page
bdi For identifying a span of text that is to be isolated from its surroundings for the purposes of bidirectional text formatting
dir For specifying text direction
bdo For explicitly formatting the text direction of its content dir For specifying text direction
blockquote For identifying a section quoted from another source
cite For giving the URL of the source
body For enclosing the main content area of a page
br For creating a line break
button For creating buttons
autofocus For specifying that the button is to be focused as soon as the page is loaded disabled For indicating that the element is not available in the current state
form For associating the element with a form that it is not a part of
formaction Fo r overriding the form’s action attribute
formenctype For overriding the form’s enctype attribute
formmethod For overriding the form’s method attribute
formnovalidate For overriding the form’s novalidate attribute
formtarget For overriding the form’s target attribute
name For identifying the data sent with a button, or for identifying the button itself (perhaps for a JavaScript function)
type For using the button in a form element
value For specifying the data that should be submitted when the button is clicked
canvas To provide scripts with a resolution-dependent bitmap canvas for rendering graphics on the fly
width, height For specifying the size of the canvas
caption For creating a caption for a table
cite For marking text as a citation
code For marking text as computer code
col For joining columns in a table into a non-structural group
span For specifying the number of columns in a column group
colgroup For joining columns in a table into a structural column group
span For specifying the number of columns in a column group
command For representing a command the user can invoke, such as defining a keyboard command checked For indicating the checked s tate of the command (if the command type is “checkbox” or “radio”) disabled For indicating that the command is not available in the current state
icon For providing an image that represents the command
label For showing the name of the command to the user
radiogroup For identifying the radio buttons that will be toggled when the command is toggled (if the command type is “radio”)
type For indicating the type of command
datalist To contain a group of option elements that represent a predefined set of options for another form control
dd For marking a definition in a list
details For creating a disclosure widget from which the visitor can obtain additional information or controls open For specifying whether the element is open or closed by default
del To mark deleted text
cite For referencing a URL that explains the change
datetime For specifying the time and date of the change
dfn For specifying the defining instance of a term
title For providing the definition of the term
div For dividing a page into block-level sections
dl For creating a definition list
dt For marking a term to be defined in a list
em To mark text that has stress emphasis
embed For adding multimedia
src For specifying the URL of a multimedia file
type For identifying the MIME type of the multimedia file
width, height For specifying the size of the embedded multimedia player
fieldset For grouping a set of form elements together
disabled For disabling all form controls within the fieldset
form For associating the element with a form that it is not a part of
name For providing the fieldset with a name for use later
figcaption For identifying a caption or legend for the contents of its parent figure element
figure For identifying content that is referenced within the main flow of the document but that could be moved elsewhere without affecting the flow of the document
footer For identifying a footer for the nearest ancestor body,section, article, or aside element form For designating a form to collect data for submission
accept-charset For identifying the character encoding to be used with the form submission (defaults to the page’s character set)
action For giving the URL of the script that will process the form data
autocomplete For preventing the browser from providing/remembering autocompletion values when the attribute is set to “off” (the default is “on”; that is, autocompletion is allowed by default)
enctype For making sure files are sent to the server in the proper format method For specifying how data should be sent to the server
name For providing the form with a name for use later
novalidate For allowing the form to be submitted without validation
target For identifying the target window or iframe of the form’s s ubmission h1, h2, h3, h4, h5, h6For creating headings
head For creating the head section, which contains information about the page, including the title, author, keywords, style sheets, and scripts
header For identifying a group of introductory content or navigational aids
hgroup For identifying the heading of a section when a heading has multiple levels
hr For identifying a paragraph-level thematic break
html For identifying a text document as an HTML document
manifest For specifying an application cache manifest that is used when the page is offline
i For marking a span of text that is in an alternate voice or mood or that is otherwise offset from the normal prose in a manner indicating a different quality of text
iframe For creating a nested browsing context
name For specifying the name of the iframe, to be used as a target
sandbox For specifying additional restrictions on the content of the iframe, for security purposes seamless For specifying whether the iframe should appear to be part of the containing page src For specifying the URL of the initial page
srcdoc For specifying the URL of the initial page
width, height For specifying the size of the iframe
img For inserting images on a page
alt For offering alternate text that is displayed if the image is not and that is for users of assistive devices
crossorigin For allowing images from third-party sites (that allow cross-origin access) to be used with the canvas element
ismap For indicating that the element provides access to a server-side image map (the element must be a descendant of an a element)
src For specifying the URL of an image
usemap For specifying the client-side image map that should be used with the referenced image width, height For specifying the size of an image so that the page is loaded more quickly, or for scaling input For creating form elements
accept For informing the browser what file types will be accepted if the input type is “file”
alt For providing a textual alternate if the input type is “image”
autocomplete For preventing the browser from providing/remembering autocompletion values when the attribute is set to “off” (the default is “on”; that is, autocompletion is allowed by default)
autofocus For specifying that the input is to be focused as soon as the page is loaded
checked For marking a radio button or checkbox by default
dirname For identifying the direction of the entered text
disabled For indicating that the input is not available in the current state
form For associating the element with a form that it is not a part of
formaction For overriding the form’s action attribute
formenctype For overriding the form’s enctype attribute
formmethod For overriding the form’s method attribute
formnovalidate For overriding the form’s novalidate attribute
formtarget For overriding the form’s target attribute
list For associating the input with a datalist
max, min For indicating the input element’s allowed range of values
maxlength For specifying the maximum number of characters that can be entered in an input element multiple For specifying whether the user can be allowed to enter more than one value
name For identifying data collected by an element
pattern For providing a reg ular expression against which the input element’s value is checked placeholder For providing a hint to aid in data entry
readonly For keeping visitors from changing certain form elements
required For identifying that the element must not be blank to submit the form (not allowed when the input type is “hidden,” “image,” or some button types)
size For specifying the length of a text or password box
src For specifying the URL of an active image
step For controlling the granularity and specificity of allowed values
type For specifying if a form element is a text box, password box, radio button, checkbox, hidden field, submit button, reset button, active image, date/time box, number box, or color box; for selecting from a range of values; or for entering a telephone number, email address, or set of search terms
value For specifying the default data in a form element
width, height For specifying the dimensions of the input (only allowed when the input type is “image”) ins For marking an addition to the document
cite For referencing a URL that explains the change
datetime For specifying the time and date of the change
kbd For marking user input
keygen For generating a public and private key pair
autofocus For specifying that the keygen element is to be focused as soon as the page is loaded challenge For generating a challenge to go along with the key pair
disabled For indicating that the element is not available in the current state
form For associating the element with a form that it is not a part of
keytype For identifying the kind of key pair to be generated
name For identifying the data that is gathered
label For labeling form elements
for For specifying which form element the label belongs to
form For associating the element with a form that it is not a part of
legend For labeling fieldsets
li For creating a list item
value For determining the initial value of the list item (if it is the child of an ol)
link For linking to an external style sheet or other external resource
href For specifying the URL of the resource
hreflang For specifying the language of the linked resource
media For defining a style sheet’s targeted media types and/or media features
rel For identifying the kind of link
sizes For identifying the size of the referenced icon (for use only when the rel attribute is “icon”) title For labeling an alternate style sheet or other resource
type For noting a resource’s MIME type (only required if the link type is not “text/css”)
map For creating a client-side image map
name For naming a map so it can be referenced later
mark For highlighting text for reference purposes due to its relevance in another context
math For embedding MathML in the page
menu For containing a list of commands
label For labeling the menu
type For identifying the kind of menu being used: “context,” “list” (default), or “toolbar”meta For associating various kinds of metadata with the page
charset For identifying the character encoding of the page itself
content For adding extra information about the page itself
http-equiv For creating automatic jumps to other pages, setting the default scripting language, and declaring the character encoding
name For identifying extra information about the page
meter For representing a measurement within a known range
high, low For sp ecifying a range of values as being “high” or “low”
max, min For identifying the maximum and minimum allowable values
name For identifying the data that is gathered
optimum For identifying the optimum value
value For indicating the current value of the meter (required)
nav For identifying a section of a page that links to other pages or to parts within the page noscript For providing alternatives to scripts
object For embedding objects in Web pages
data For identifying the source of the multimedia file to be embedded
form For associating the element with a form that it is not a part of
name For identifying the object (e.g., so it can be scripted)
type For noting the object’s MIME type
typemustmatch For indicating that the resource specified in the object’s data attribute must have the same MIME type as identified in the object’s type attribute (allowed only if the object’s data and type are both specified)
usemap For indicating whether the object has an associated image map width, height For specifying the dimensions of the object’s box
ol For creating ordered lists
reversed For specifying whether the list is descending (. . . , 3, 2, 1)
start For specifying the initial value of the first list item
type For specifying the kind of numerals that should begin each list item
optgroup For grouping a set of option elements under a common label within a select element disabled For indicating that the element is not available in the current state
label For labeling the group of options
option For creating the individual options in a select or datalist element disabled For indicating that the element is not available in the current state
label For specifying how the option should appear in the menu
selected For making a menu option be selected by default in a blank form
value For specifying the initial value of a menu option
output For representing the result of a calculation
for For creating an explicit association between the result of a calculation and the values that went into the calculation
form For associating the element with a form that it is not a part of name For identifying the data that is gathered
p For creating a paragraph
param For setting properties of an object
name For identifying the kind of property
value For setting the value of the named property
pre For representing a block of preformatted text
progress For identifying the completion progress of a task max Must be a valid floating-point number greater than zero (if present)
value Must be a valid floating-point number equal to or greater than zero (and less than or equal to the value of the max attribute, if it is present)
q For quoting short passages from another source cite For giving the URL of the source of the quote
rp For providing parentheses around a ruby text component of a ruby annotation in browsers that don’t support ruby annotations
rt For marking the ruby text component of a ruby text annotation
ruby For allowing text to be marked up with ruby annotations
s For identifying text that is no longer accurate or no longer relevant samp For representing sample output from a program or computing system script For adding “automatic” scripts to a page
async For influencing script loading and execution
charset For specifying the character set an external script is written in
defer For influencing script loading and execution
src For referencing an external script
type For specifying the scripting language the script is written in (only required if the script type is not “text/javascript”)
section For identifying a section of a document
select For creating form control for selecting from a set of options
autofocus For specifying that the select element is to be focused as soon as the page is loaded disabled For indicating that the element is not available in the current state
form For associating the element with a form that it is not a part of
multiple For allowing users to choose more than one option in the menu
name For identifying the data collected by the menu
required For identifying that the user must select one of the options in order to submit the form (the first child option element must be a placeholder or an empty value)
size For specifying the number of items initially visible in the menu (and for displaying the menu as a list)
small For representing side comments such as small print
source For identifying multiple alternative media resources within an audio or video element crossorigin For setting cross-origin request credentials
media For identifying the intended media type of the resource
src For identifying the URL of the audio or video file to play
type For noting a resource’s MIME type
span For wrapping content in an element that has no intrinsic semantic meaning
strong For indicating strong importance of the element’s content
style For embedding style information in a page
media For indicating a style sheet’s purpose
scoped For applying styles only to the descendants of the element’s parent
type For indicating a style sheet’s MIME type (only required if the style type is not “text/css”) sub For creating subscripts
summary For identifying a summary, caption, or legend for the contents of its parent details element sup For creating superscripts
svg For embedding Scalable Vector Graphics in the page
table For creating tables
tbody For identifying the body of the table; in contrast with the header (thead) or footer (tfoot) td, th For creating regular and header cells, respectively, in a table
colspan For spanning a cell across more than one column
rowspan For spanning a cell across more than one row
scope For identifying to which rows, columns, rowgroups, or columngroups a th applies textarea For creating text block entry areas in a form
autofocus For specifying that the text area is to be focused as soon as the page is loaded
dirname For identifying the direction of the entered text
disabled For indicating that the element is not available in the current state
form For associating the element with a form that it is not a part of
maxlength For specifying the maximum number of characters that can be entered in a textarea name For identifying the data that is gathered with the text block
placeholder For providing a hint to aid in data entry
readonly For protecting a text area’s contents
required For indicating that the element must not be blank in order to submit the form
rows, cols For specifying the number of rows and columns in the text block
wrap For specifying the use of soft or hard wraps when content of field is submitted
tfoot, thead For identifying the footer and header area of a table
time For specifying a date, a time, or both
datetime For providing a machine-readable version of the time or date expressed in the element’s text pubdate For specifying the publication date and time of the element’s ancestor article or body element title For creating the title of the page (required)
tr For creating rows in a table
track For specifying external timed text tracks for the parent audio or video element default For indicating which track is the default
kind For identifying whether the track is “subtitles,” “captions,” “descriptions,” “chapters,” or “metadata”
label For providing a user-readable name for the track src For identifying the URL of the track’s data srclang For identifying the language of the track’s data
u For displaying a span of text with an unarticulated, though explicitly rendered, non-textual annotation
ul For creating unordered lists
var For marking text as a variable name
video For embedding videos, movies, and captioned audio files
autoplay For telling the browser to start playing the video file as soon as it can
controls For telling the browser to provide controls for the video element
crossorigin For setting cross-origin request credentials
loop For telling the video file to start over without interruption upon reaching its end mediagroup For associating multiple media files together
muted For controlling the default state of audio output
poster For specifying the URL of an image to use as a placeholder while media loads, or in case of an error loading
preload For specifying whether the browser can begin downloading the media file before the visitor starts playing it
src For identifying the URL of the video file to play width, height For specifying the dimensions of the video wbr
最新STM8L15X中文参考手册资料
本参考手册的目标应用程序开发人员。它提供了完整的信息如何使用stm8l05xx,stm8l15xx 和stm8l16xx微控制器的存储器和外围设备。 该stm8l05xx / stm8l15xx / stm8l16xx是一个家庭的不同存储密度的微控制器和外围设备。这些产品是专为超低功耗应用。可用的外设的完整列表,请参阅产品数据表。 订购信息,引脚说明,机械和电气设备的特点,请参阅产品数据表。 关于STM8 SWIM通信协议信息和调试模块,请参阅用户手册(um0470)。 在STM8的核心信息,请参阅STM8的CPU编程手册(pm0044)。关于编程,擦除和保护的内部快闪记忆体,请参阅STM8L闪存编程手册(pm0054)。
1 中央处理单元(CPU)。30。 1.1 引言30 1.2 CPU的寄存器。30。 1.2.1 描述CPU寄存器。..。30 1.2.2 STM8 CPU寄存器图。..。34 1.3 全球配置寄存器(cfg_gcr)。34。 1.3.1 激活水平。..。34 1.3.2 游泳禁用。..。35 1.3.3 描述全局配置寄存器(cfg_gcr)。..。35 1.3.4 全局配置寄存器图及复位值。..。35 2 启动ROM . . . 36 3程序存储器和数据存储器。37。 3.1引言37 3.2术语。37。 3.3个主要的快闪存储器的特点。38。 3.4记忆的组织。39。 3.4.1低密度设备的存储器组织。39 3.4.2介质密度的装置记忆的组织。..。40 3.4.3介质+密度装置记忆的组织。..。41 3.4.4高密度存储器组织。..。42 3.4.5专有代码区(译)。43 3.4.6用户区(UBC)。43 3.4.7数据的EEPROM(数据)。..。46 3.4.8主程序区。46 3.4.9选项字节。..。46 3.5内存保护。47。 3.5.1读出保护。47 3.5.2内存访问安全系统(质量)。47 3.5.3使写访问选项字节。49 3.6内存编程49 3.6.1同时读写(读写网)。..。49 2 / 573文档ID 15226转9 rm0031内容 3.6.2字节编程。..。49 3.6.3字编程。50 3.6.4块编程。50 3.6.5选项字节编程。52 Flash 3.7的低功耗模式。52。 3.8例ICP和IAP。52。 3.9闪光寄存器57 3.9.1闪光控制寄存器1(flash_cr1)。57 3.9.2闪光控制寄存器2(flash_cr2)。58
STM8L152中文介绍
STM8L152介绍 8位超低功耗单片机,高达64 + 2字节数据的闪存EE PROM,EEPROM (Electrically Erasable Programmable ), 实时时钟,液晶显示器,定时器,USART,C,SPI,模数转换器,数模转换器,比较器特点:操作条件:工作电源:1.65v~ 3.6v 温度范围:40 to 85, 105 or 125 低功耗的特点:5个低功耗模式:等,低功率运行 (5.9|ì一),低功耗等(3|ì一),active-halt 全实时时钟(1.4|ì一),停止(400) 动态功率消耗:200UA/兆赫+ 330UA,快速唤醒从停止模式(4.7us) 超低漏 I/ O:50nA 先进的stm8核心: 哈佛结构和三级流水线
最大频率:16条16mhz,相关峰 最多40个外部中断源 复位和供应管理: 低功率,超安全欠压复位5可编程阈值 超低功率POR /PDR(通电复位/Protection(保护)、Detection(检测)、Response(响应)) 可编程电压检测器(Programmable voltage detector (PVD)) 时钟管理 32kHz和1-16MHz晶体振荡器 工厂校准的内部16MHz RC和 38kHz的低功耗RC 时钟安全系统
低功耗RTC BCD日历,闹钟中断, 数字校准+ / - 0.5ppm的准确度 先进的防篡改检测 DMA 4个通道。 ADC,DAC的,SPIS,我 2C,USART接口,定时器,1路。存储器到存储器的 LCD:8x40或4x44瓦特/升压转换器 12位ADC1 Msps/28渠道 温度。传感器和内部参考。电压 记忆
STM8L051低功耗模式实现说明文档
STM8L051低功耗模式测试文档 STM8L051的五种低功耗模式wait ,low power run mode,low power wait mode,Ative-Halt mode,Halt mode。 1、WAIT mode 在等待模式,CPU的时钟是停止的,被选择的外设继续运行。W AIT mode 分为两种方式:WFE,WFI。WFE是等待事件发生,才从等待模式中唤醒。WFI是等待中断发生,才从等待模式中唤醒。 2、low power run mode 在低功耗运行模式下,CPU和被选择的外设在工作,程序执行在LSI或者LSE下,从RAM 中执行程序,Flash和EEPROM都要停止运行。电压被配置成Ultra Low Power模式。进入此模式可以通过软件配置,退出此模式可以软件配置或者是复位。 3、low power wait mode 这种模式进入是在low power run mode下,执行wfe。在此模式下CPU时钟会被停止,其他的外设运行情况和low power run mode类似。在此模式下可以被内部或外部事件、中断和复位唤醒。当被事件唤醒后,系统恢复到low power run mode。 4、Active-Halt mode 在此模式下,除了RTC外,CPU和其他外设的时钟被停止。系统唤醒是通过RTC中断、外部中断或是复位。 5、Halt mode 在此模式下,CPU和外设的时钟都被停止。系统唤醒是通过外部中断或复位。关闭内部的参考电压可以进一步降低功耗。通过配置ULP位和FWU位,也可以6us的快速唤醒,不用等待内部的参考电压启动。 一、各个低功耗模式的代码实现 1、WAIT mode 等待模式分为两种:WFI和WFE。 1.1 WFI mode 当执行“wfi”语句时,系统就进入WFI模式,当中断发生时,CPU被从WFI模式唤醒,执行中断服务程序和继续向下执行程序。 通过置位CFG_GCR的AL位,使主程序服务完中断服务程序后,重新返回到WFI 模式。 程序如下: void Mcuwfi() { PWR_UltraLowPowerCmd(ENABLE); //开启电源的低功耗模式 CLK_HSEConfig(CLK_HSE_OFF); //关闭HSE时钟(16MHz) #ifdef USE_LSE CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_LSE);
2021年STM8L中文参考手册-1
简介 欧阳光明(2021.03.07) 本参考手册的目标应用程序开发人员。它提供了完整的信息如何使用stm8l05xx,stm8l15xx和stm8l16xx微控制器的存储器和外围设备。 该stm8l05xx / stm8l15xx / stm8l16xx是一个家庭的不同存储密度的微控制器和外围设备。 这些产品是专为超低功耗应用。可用的外设的完整列表,请参阅产品数据表。 订购信息,引脚说明,机械和电气设备的特点,请参阅产品数据表。 关于STM8 SWIM通信协议信息和调试模块,请参阅用户手册(um0470)。 在STM8的核心信息,请参阅STM8的CPU编程手册(pm0044)。关于编程,擦除和保护的内部快闪记忆体,请参阅STM8L闪存编程手册(pm0054)。 表一、 类型零件号 控制器价值线低密度stm8l05xx设备:stm8l051x3 8KB Flash微控制器 价值线中密度stm8l05xx设备:stm8l052x6微控制器与32闪光 价值线高密度stm8l05xx设备:stm8l052x8 64-KB闪存微控制器 低密度stm8l15x设备:stm8l151c2 / K2 / G2/F2, stm8l151c3 / K3 / G3 / F3微控制器与4KB或8KB Flash 中密度stm8l15xx设备:stm8l151c4 / K4 / G4, 微控制器stm8l151c6 / K6 / G6,stm8l152c4 / K4和stm8l152c6 / K6 微控制器与16-KB或32闪光 培养基+密度stm8l15xx设备:stm8l151r6和 stm8l152r6微控制器与闪存(32比中密度器件广泛的外设范围) 高密度stm8l15xx设备:stm8l151x8和stm8l152x8 随着64-KB闪存微控制器(相同的外周设置为中等+) 高密度stm8l16xx设备:stm8l162x8微控制器与闪存(相同的外周设置为 64-KB高密度stm8l152设备加AES硬件加速器 目录 1中央处理单元(CPU)。30。 1.1引言30 1.2 CPU的寄存器。30。 1.2.1描述CPU寄存器。..。30 1.2.2STM8 CPU寄存器图。..。34 1.3全球配置寄存器(cfg_gcr)。34。 1.3.1激活水平。..。34
STM8L中文参考手册(4)-
STM8L中文参考手册(4)- 20 16位通用定时器(TIM2、TIM3、tim5) 20.1简介 本章介绍TIM2、TIM3和tim5是相同的定时器 每个定时器包括一个由可编程分频器驱动的16位上下自动重载计数器它可以用于多种目的,包括:●定时产生●测量输入信号的脉冲长度(输入捕获) ●产生输出波形(输出比较、脉宽调制和脉冲模式)●各种中断能力事件(捕获、比较、溢出) ●与其他定时器或外部信号(外部时钟、复位、触发使能)同步 定时器时钟可以来自内部时钟,也可以来自配置寄存器或外部源本章仅介绍通用定时器的主要特性。它参考了与19:16高级控制定时器(TIM1)相对应的部分中的每个功能的更详细的信息页28320.2 TIMx 主要功能 通用TIMx TIM2/TIM3功能包括: ●16位向上、向下、向上/向下自动刷新计数器●3位可编程分频器允许将计数器的时钟频率分成1至128的任意2次方两个独立的低电平通道:输入捕获输出比较 脉冲宽度调制产生(边沿对齐)-一个脉冲输出模式 低电平中断输入,用于复位定时器输出信号,或处于已知状态●输入捕捉2可通过来自comp2比较器 :
更新的中断和DMA请求产生以下事件:当计数器溢出时,计数器初始化(软件)输入捕捉输出比较中断输入 触发事件(开始、停止、内部/外部触发初始化或计数) 20.3.1时间单元 定时器时基单元包括:●16位可逆计数器 时钟源是内部时钟(fsysclk)它由预分频器计数器的时钟ck_cnt驱动,预分频器计数器直接连接到ck_psc时钟馈送 分频器 分频器的实现如下:7位计数器(在timx_pscr寄存器中)由基于 低预分频器的3位寄存器控制它可以控制飞行中寄存器缓冲区的变化。它可以将计数器的时钟频率转换为1、2、4、8、16、32、64或128计数器的时钟频率计算如下: fCk _ CNT = fck _ PSC/2(PSCR[2:0)计数器操作 请参考第19.3.4页:上部288,模式部分19.3.5:在第290页向下计数,模式19.3.6:中心对齐(向上/向下计数)29220.3.2时钟/触发控制器 参见第296页第19.4节:TIM1时钟/触发控制器20.3.3采集/比较通道输入级 参见第310页第19.5节:TIM1采集/比较通道 有两个输入通道,如图122:输入级框图通道2内部连接到比较器
stm8l中文参考手册(下)
手动开关 手动开关没有自动切换为直接的但它提供给用户的切换事件时间的精确控制。参照图20中的流程图。 1。写使用系统时钟开关选择目标时钟源的8位值寄存器(clk_swr)。然后swbsy位是由硬件,和目标源振荡器开始。古老的时钟源继续驱动CPU和外设。 2。该软件具有等到目标时钟源准备(稳定的)。这是在clk_swcr寄存器和快捷旗由中断如果swien位设置显示。 3。最终软件的作用是设置,在所选择的时间,在clk_swcr的赛文点寄存器来执行开关。在手动和自动切换模式,旧的系统时钟源不会自动关闭的情况下是由其他模块(LSI混凝土可用于例如独立的看门狗驱动)。时钟源可以关机使用在内部时钟寄存器的位(clk_ickcr)和外部时钟寄存器(clk_eckcr)。如果时钟开关不因任何原因的工作,软件可以通过清除swbsy 标志复位电流开关操作。这将恢复clk_swr注册到其以前的内容(旧的系统时钟)。注意:在清理swbsy标志具有复位时钟主开关的程序,应用程序必须等到后产生新的主时钟切换请求之前有一段至少两个时钟周期。
9.7周门控时钟(PCG) 外周时钟门控(PCG)模式选择性地启用或禁用系统时钟(SYSCLK)连接到外围设备在运行或慢速模式的任何时间来优化功耗。 设备复位后,所有的外设时钟被禁用。唯一的一点是在复位状态是默认启用pcken27因为它用于启动。软件已被正确地写入关掉ROM Bootloader执行后的时钟。 您可以启用时钟的任何外围设置在clk_pckenrx周围门控时钟寄存器的相应pcken点。 ●使周围,首先使在clk_pckenr相应的pcken点 寄存器然后设置使点周围的外围控制寄存器。 ●禁用适当的外围,先禁用在周边的适当位 控制寄存器,然后停止相应的时钟。
stm8L051F3
This is information on a product in full production. March 2014 DocID023465 Rev 21/93 STM8L051F3 Value Line, 8-bit ultralow power MCU, 8-KB Flash, 256-byte data EEPROM, RTC, timers, USART, I2C, SPI, ADC Datasheet production data Features ?Operating conditions –Operating power supply: 1.8 V to 3.6 V Temperature range: ?40 °C to 85 °C ?Low power features – 5 low power modes: Wait, Low power run (5.1 μA), Low power wait (3 μA), Active-halt with RTC (1.3 μA), Halt (350 nA)–Ultra-low leakage per I/0: 50 nA –Fast wakeup from Halt: 5 μs ?Advanced STM8 core –Harvard architecture and 3-stage pipeline –Max freq: 16 MHz, 16 CISC MIPS peak –Up to 40 external interrupt sources ?Reset and supply management –Low power, ultra-safe BOR reset with 5 selectable thresholds –Ultra low power POR/PDR –Programmable voltage detector (PVD)?Clock management –32 kHz and 1 to 16 MHz crystal oscillators –Internal 16 MHz factory-trimmed RC –Internal 38 kHz low consumption RC –Clock security system ?Low power RTC –BCD calendar with alarm interrupt –Digital calibration with +/- 0.5 ppm accuracy –LSE security system –Auto-wakeup from Halt w/ periodic interrupt ?Memories –8 Kbytes of Flash program memory and 256 bytes of data EEPROM with ECC –Flexible write and read protection modes – 1 Kbyte of RAM ?DMA – 4 channels supporting ADC, SPI, I2C, USART, timers – 1 channel for memory-to-memory ?12-bit ADC up to 1 Msps/28 channels –Internal reference voltage ?Timers –Two 16-bit timers with 2 channels (used as IC, OC, PWM), quadrature encoder –One 8-bit timer with 7-bit prescaler – 2 watchdogs: 1 Window, 1 Independent –Beeper timer with 1, 2 or 4 kHz frequencies ?Communication interfaces –Synchronous serial interface (SPI)–Fast I 2C 400 kHz SMBus and PMBus –USART ?Up to 18 I/Os, all mappable on interrupt vectors ?Development support –Fast on-chip programming and non-intrusive debugging with SWIM –Bootloader using USART https://www.360docs.net/doc/4217467547.html,
STM8L入门手册
STM8L单片机入门手册 注:本教程以STM8L052R8和IAR开发环境为例1、IAR环境安装与注意事项: 安装时按照一般软件安装即可,提示需要输入License时请使用IAR kegen PartC软件进行破解,注意Product选择STM8项,如下图示: 另外:机器上本身安装过MSP430平台的IAR环境,安装STM8平台的IAR是可以兼容的
2、IAR环境创建STM8工程: 2.1、创建工程 如下图示,打开IAR环境for STM8 选择project->Create New Project,选择C语言开发,点击“OK” 选择保存路径后输入工程名点击“保存”即可。
按上图示,添加文件分组,并命名“SRC”和“Lib”,类似方法在分组中添加文件。 2.2工程重要设置: 右击工程名,选择“Options…” 在General Options项中,Target选项卡中按照下图设置: 在C/C++ Compiler项中,Preprocessor选项卡中添加头文件路径,如下图示:
红色圈内容直接输入(不能选???) $PROJ_DIR$\..\Lib\inc 解释:$PROJ_DIR$->表示当前工程目录(.eww文件所在目录); ..->表示上层目录; 在Debugger项中,设置仿真调试器与入口函数,如下图示:
main 上图中,Run to:写main 这里是设置入口函数2.3设置生成HEX文件: 右击工程名,选择“Options…”
该设置不会影响调试器在线仿真功能,可以一直勾选上,这点和MSP430不同。 3、IAR环境常见问题及解决方法 3.1、Couldn’t go to ‘M52Li’ 进入调试模式是会有下图警告,并且不能调试 找不到入口函数,入口函数应该是main 3.2、“The debugging session could not be started.” 由于脱机烧录或者其他原因写了保护,造成连接不上目标板。 解决方法: 打开STVP软件,点击读取按钮,会出现以下报错: 此时,进入到OPTION BYTE页面,将ROP写为OFF模式,如下图示
STM8L05X入门学习笔记
1、工程新建 首先新建文件夹,在文件夹下建立四个文件(这个看个人喜好),我喜欢建立一个工程文件夹Project用于存放工程文件,Library文件用于存放库文件,App用于存放用户程序,Doc 用于存放说明文档,如图1所示。 图1 二:将官方的库文件Libraries文件下STM8S_StdPeriph_Driver这个文件下的内容复制到自己新建的Library文件下,把官方Project文件下Template文件夹下main.c stm8s_conf.h stm8s_it.c 和stm8s_it.h复制到App文件夹下。如图2,图3。 图2 图3 三:打开IAR 选择Project-> Create New Project –>ok,将文件保存到Project下,
这时工程已经建好,右击工程选择Add Group,然后依次添加文件App,Libraries,Doc,BSP_CFG 配置好如图所示 四:给工程下APP添加App文件下的文件如图
给Libraries添加Library文件下src文件下的所有文件、 五配置Options,包括如下,1选择型号这里选STM8S903K3 2C++选项卡配置路经,和型号的宏定义。
六编译工程,这事会提醒对工程的保存,进行保存即可,这时会发现很多错误,这是因为这个库包含了所有的型号,有些这个单片机没有,将它移除即可。再次编译就会发现没有错误了。 7HEX文件输出
2、系统时钟 四种不同的时钟源可以用来驱动系统时钟: ●16 MHz 高速内部(HSI)工厂调整RC 时钟 ●1 到16 MHz 高速外(HSE)振荡器时钟 ●32.768 千赫低速外(LSE)振荡器时钟 ●38 千赫低速内部(LSI)低功耗时钟 每个时钟源可以开启或关闭独立不使用时的功耗,优化。 这四个时钟可以用一个可编程分频器(因素1 至128)驱动 系统时钟(系统时钟)。该系统时钟用于时钟的核心,内存和外设。复位后,该设备重新启动与HSI 时钟除以8 的违约。该分频器分频比时钟源可以改变应用程序尽快执行代码起点。
stm8L 数据手册
October 2010Doc ID 15275 Rev 111/81 STM8L101xx 8-bit ultralow power microcontroller with up to 8 Kbytes Flash, multifunction timers, comparators, USART , SPI, I2C Features ■ Main microcontroller features –Supply voltage range 1.65 V to 3.6 V –Low power consumption (Halt: 0.3μA, Active-halt: 0.8μA, Dynamic Run: 150μA/MHz) –STM8 Core with up to 16 CISC MIPS throughput –Temp. range: -40 to 85°C and 125 °C ■ Memories –Up to 8 Kbytes of Flash program including up to 2 Kbytes of data EEPROM –Error correction code (ECC) –Flexible write and read protection modes –In-application and in-circuit programming –Data EEPROM capability – 1.5 Kbytes of static RAM ■ Clock management –Internal 16 MHz RC with fast wakeup time (typ. 4μs) –Internal low consumption 38kHz RC driving both the IWDG and the AWU ■ Reset and supply management –Ultralow power, ultrasafe power-on-reset /power down reset –Three low power modes: Wait, Active-halt, Halt ■ Interrupt management –Nested interrupt controller with software priority control –Up to 29 external interrupt sources ■ I/Os –Up to 30 I/Os, all mappable on external interrupt vectors –I/Os with prog. input pull-ups, high sink/source capability and one LED driver infrared output ■ Peripherals –Two 16-bit general purpose timers (TIM2 and TIM3) with up and down counter and 2 channels (used as IC, OC, PWM) –One 8-bit timer (TIM4) with 7-bit prescaler –Infrared remote control (IR)–Independent watchdog –Auto-wakeup unit –Beeper timer with 1, 2 or 4 kHz frequencies –SPI synchronous serial interface –Fast I2C Multimaster/slave 400 kHz –USART with fractional baud rate generator – 2 comparators with 4 inputs each ■Development support –Hardware single wire interface module (SWIM) for fast on-chip programming and non intrusive debugging –In-circuit emulation (ICE)■ 96-bit unique ID Table 1. Device summary Reference Part number STM8L101xx STM8L101F1, STM8L101F2, STM8L101F3, STM8L101G2, STM8L101G3STM8L101K3 https://www.360docs.net/doc/4217467547.html,