Microsoft PowerPoint - 03_STM8S Core and Architecture_ppt
- 格式:pdf
- 大小:286.75 KB
- 文档页数:39
stm8笔记2-定时3更新中断+pwm输出(IDE为IAR)⼀:IAR编译器中断函数说明下⾯说⼀下在IAR下,在IAR下必须要添加iostm8s105s6.h⽂件,在⽂件的最后有如下内容:/*-------------------------------------------------------------------------* Interrupt vector numbers*-----------------------------------------------------------------------*/#define AWU_vector 0x03#define SPI_TXE_vector 0x0C#define SPI_RXNE_vector 0x0C#define SPI_WKUP_vector 0x0C#define SPI_CRCERR_vector 0x0C#define SPI_OVR_vector 0x0C#define SPI_MODF_vector 0x0C#define TIM1_OVR_UIF_vector 0x0D#define TIM1_CAPCOM_BIF_vector 0x0D#define TIM1_CAPCOM_TIF_vector 0x0D#define TIM1_CAPCOM_CC1IF_vector 0x0E#define TIM1_CAPCOM_CC2IF_vector 0x0E#define TIM1_CAPCOM_CC3IF_vector 0x0E#define TIM1_CAPCOM_CC4IF_vector 0x0E#define TIM1_CAPCOM_COMIF_vector 0x0E#define TIM2_OVR_UIF_vector 0x0F#define TIM2_CAPCOM_CC1IF_vector 0x10#define TIM2_CAPCOM_TIF_vector 0x10#define TIM2_CAPCOM_CC2IF_vector 0x10#define TIM2_CAPCOM_CC3IF_vector 0x10#define UART1_T_TXE_vector 0x13#define UART1_T_TC_vector 0x13#define UART1_R_OR_vector 0x14#define UART1_R_RXNE_vector 0x14#define UART1_R_IDLE_vector 0x14#define UART1_R_PE_vector 0x14#define UART1_R_LBDF_vector 0x14#define I2C_ADD10_vector 0x15#define I2C_ADDR_vector 0x15#define I2C_OVR_vector 0x15#define I2C_STOPF_vector 0x15#define I2C_BTF_vector 0x15#define I2C_WUFH_vector 0x15#define I2C_RXNE_vector 0x15#define I2C_TXE_vector 0x15#define I2C_BERR_vector 0x15#define I2C_ARLO_vector 0x15#define I2C_AF_vector 0x15#define I2C_SB_vector 0x15#define ADC1_AWS0_vector 0x18#define ADC1_AWS1_vector 0x18#define ADC1_AWS2_vector 0x18#define ADC1_AWS3_vector 0x18#define ADC1_AWS4_vector 0x18#define ADC1_AWS5_vector 0x18#define ADC1_AWS6_vector 0x18#define ADC1_EOC_vector 0x18#define ADC1_AWS8_vector 0x18#define ADC1_AWS9_vector 0x18#define ADC1_AWDG_vector 0x18#define ADC1_AWS7_vector 0x18#define TIM4_OVR_UIF_vector 0x19#define FLASH_EOP_vector 0x1A#define FLASH_WR_PG_DIS_vector 0x1A对照中断向量表,如果⽤到中断,必须⾃⼰写中断,⽐如TIM3定时器中断#pragma vector=TIM3_OVR_UIF_vector__interrupt void TIM3_UPD_OVF_IRQHandler (void){TIM3_SR = 0X00;//清除中断标志}⽤关键字#pragma vector=指出本中断处理函数指向的中断号,⽤关键字__interrupt作为函数的前缀,表⽰这是中断处理函数。
Solaris8(Intel平台版本)2/02发行说明Sun Microsystems,Inc.4150Network CircleSanta Clara,CA95054U.S.A.部件号码816-3444-112002年2月Copyright2002Sun Microsystems,Inc.901San Antonio Road,Palo Alto,California94303-4900U.S.A.版权所有。
本产品或文档受版权保护,其使用、复制、分发和反编译均受许可证限制。
未经Sun及其授权者事先的书面许可,不得以任何形式、任何手段复制本产品及其文档的任何部分。
包括字体技术在内的第三方软件受Sun供应商的版权保护和许可证限制。
本产品的某些部分可能是从Berkeley BSD系统衍生出来的,并获得了加利福尼亚大学的许可。
UNIX是由X/Open Company,Ltd.在美国和其它国家独家许可的注册商标。
Sun、Sun Microsystems、Sun标志、、AnswerBook、AnswerBook2、DiskSuite,HotJava,Java,JavaSpaces,JDK,JumpStart, OpenWindows,Solstice AdminSuite,Solstice AutoClient,Solaris Management Console,SunOS,XView,和Solaris是Sun Microsystems, Inc.在美国和其他国家的商标、注册商标或服务标记。
所有SPARC商标均按许可证授权使用,它们是SPARC International,Inc.在美国和其它国家的商标或注册商标。
带有SPARC商标的产品均以Sun Microsystems,Inc.PostScript是Adobe Systems,Incorporated的商标或注册商标,它们可能在某些司法管辖区注册。
STM8S单片机外部中断唤醒
一、STM8S 外部中断进行唤醒
先了解一下STM8S的中断资源
再看看STM8S的中断管理。
STM8S采用软件优先级和硬件优先级来控制一个中断的响应,先比较软件优先级只有当软件优先级一致时才会比较硬件优先级,由于硬件优先级具有唯一性,这样便保证了某一时刻定会只有一个中断被处理。
要使用外部中断,只需简单的配置一下EXTI_CR1寄存器,并将主程序main的软件优先级置为0即可。
默认情况下自复位开始,主程序的软件优先级被设置为3,处于最高软件优先级,仅有TRAP,TLI,RESET中断能够打断,其余的中断都是不会被响应的。
为了防止中断过程中被别的优先级高的中断所打断,可以将当前优先级置为最高3级。
代码如下:
main.c代码
//EXTI_CR1|=EXTI_CR1_PBIS_R;//PB5TRINT高电平触发
EXTI_CR1|=EXTI_CR1_PCIS_R;//PC3上升沿触发
//#defineEXTI_CR1_PCIS_R(1《《4)
RIM;//开全局中断,必须要有这句,否则只会响应不可屏蔽中断
//#defineHALT_asm(“halt”)
//#defineRIM_asm(“rim”)
//#defineSIM_asm(“sim”)
GPIO_Init(GPIOC,TRINT,GPIO_MODE_IN_PU_IT);//使能对应的IO口中断
stm8s_it.c代码
//收发中断(PC3)BJ8F101。
This is information on a product in full production.August 2018DS7147 Rev 10Value line, 16-MHz STM8S 8-bit MCU, 8-Kbyte Flash memory, 128-byte data EEPROM, 10-bit ADC, 3 timers, UART, SPI, I²CDatasheet - production dataFeaturesCore•16 MHz advanced STM8 core with Harvard architecture and 3-stage pipeline •Extended instruction setMemories•Program memory: 8 Kbyte Flash memory; data retention 20 years at 55 °C after 100 cycles •RAM: 1 Kbyte•Data memory: 128 bytes true data EEPROM;endurance up to 100 k write/erase cyclesClock, reset and supply management• 2.95 V to 5.5 V operating voltage•Flexible clock control, 4 master clock sources –Low-power crystal resonator oscillator –External clock input–Internal, user-trimmable 16 MHz RC –Internal low-power 128 kHz RC •Clock security system with clock monitor •Power management–Low-power modes (wait, active-halt, halt)–Switch-off peripheral clocks individually –Permanently active, low-consumption power-on and power-down resetInterrupt management•Nested interrupt controller with 32 interrupts •Up to 27 external interrupts on 6 vectorsTimers•Advanced control timer: 16-bit, 4 CAPCOM channels, 3 complementary outputs, dead-time insertion and flexible synchronization •16-bit general purpose timer, with 3 CAPCOM channels (IC, OC or PWM)•8-bit basic timer with 8-bit prescaler •Auto wakeup timer•Window and independent watchdog timersCommunications interfaces•UART with clock output for synchronousoperation, SmartCard, IrDA, LIN master mode •SPI interface up to 8 Mbit/s •I 2C interface up to 400 Kbit/sAnalog to digital converter (ADC)•10-bit ADC, ± 1 LSB ADC with up to 5multiplexed channels, scan mode and analog watchdogI/Os•Up to 28 I/Os on a 32-pin package including 21high-sink outputs •Highly robust I/O design, immune against current injectionDevelopment support•Embedded single-wire interface module(SWIM) for fast on-chip programming and non-intrusive debuggingDescription STM8S003F3 STM8S003K3DS7147 Rev 102 DescriptionThe STM8S003F3/K3 value line 8-bit microcontrollers offer 8 Kbytes of Flash programmemory, plus integrated true data EEPROM. They are referred to as low-density devices in the STM8S microcontroller family reference manual (RM0016).The STM8S003F3/K3 value line devices provide the following benefits: performance, robustness and reduced system cost.Device performance and robustness are ensured by true data EEPROM supporting up to 100000 write/erase cycles, advanced core and peripherals made in a state-of-the-arttechnology at 16 MHz clock frequency, robust I/Os, independent watchdogs with separate clock source, and a clock security system.The system cost is reduced thanks to a high system integration level with internal clock oscillators, watchdog, and brown-out reset.Full documentation is offered as well as a wide choice of development tools.Table 1. STM8S003F3/K3 value line featuresFeaturesSTM8S003K3STM8S003F3Pin count3220Max. number of GPIOs (I/O)2816External interrupt pins 2716Timer CAPCOM channels 77Timer complementary outputs 32A/D converter channels 45High-sink I/Os2112Low-density Flash program memory (byte)8 K 8 K RAM (byte)1 K 1 K True data EEPROM (byte)128(1)1.Without read-while-write capability.128(1)Peripheral setMulti purpose timer (TIM1), SPI, I2C, UART, Window WDG, independent WDG, ADC, PWM timer (TIM2), 8-bit timer (TIM4)DS7147 Rev 10STM8S003F3 STM8S003K3Block diagram3 Block diagramFigure 1. STM8S003F3/K3 value line block diagramXTAL 1-16 MHzRC int. 16 MHzRC int. 128 kHzSTM8 coreDebug/SWIMUART1I2CSPIAWU timerReset blockResetPORBORClock controllerDetectorClock to peripherals and core400Kbit/s8Mbit/sup to 5A d d r e s s a n d d a t a b u sWindow WDG8 Kbyte 128 byte 1 Kbyte RAMADC1ResetSingle wiredebug interfaceprogram Flashdata EEPROM16-bit general purpose16-bit advanced controltimer (TIM1)timer (TIM2)8-bit basic timer(TIM4)Beeper1/2/4 kHz beepIndependent WDG4 CAPCOM channels Up to 3 CAPCOM channelsUp to + 3 complementaryoutputsLIN master channelsSPI emul.STM8S003F3 STM8S003K3Product overviewDS7147 Rev 10Product overview STM8S003F3 STM8S003K3DS7147 Rev 104.12 TIM4 - 8-bit basic timer•8-bit autoreload, adjustable prescaler ratio to any power of 2 from 1 to 128•Clock source: CPU clock•Interrupt source: 1 x overflow/update4.13 Analog-to-digital converter (ADC1)STM8S003F3/K3 value line products contain a 10-bit successive approximation A/Dconverter (ADC1) with up to 5 external multiplexed input channels and the following main features: •Input voltage range: 0 to V DDA •Conversion time: 14 clock cycles•Single and continuous, buffered continuous conversion modes •Buffer size (10 x 10 bits)•Scan mode for single and continuous conversion of a sequence of channels •Analog watchdog capability with programmable upper and lower thresholds •Analog watchdog interrupt •External trigger input •Trigger from TIM1 TRGO •End of conversion (EOC) interruptNote:Additional AIN12 analog input is not selectable in ADC scan mode or with analog watchdog. Values converted from AIN12 are stored only into the ADC_DRH/ADC_DRL registers.4.14 Communication interfacesThe following communication interfaces are implemented:•UART1: full feature UART, synchronous mode, SPI master mode, SmartCard mode,IrDA mode, LIN2.1 master capability •SPI: full and half-duplex, 8 Mbit/s •I²C: up to 400 Kbit/sTable 3. TIM timer featuresTimerCounter size (bits)PrescalerCounting mode CAPCOM channels Complem. outputs Ext. trigger Timersynchr-onization/ chainingTIM1 16Any integer from 1 to 65536Up/down 43Yes NoTIM2 16Any power of 2 from 1 to 32768Up 30No TIM48Any power of 2 from 1 to 128UpNo。
深圳市技新电子科技有限公司www.jixin.pro
STM8S105C6T6最小系统板V1.0.0.0
模块尺寸图:
品质说明:
PCB 设计软件:LCEDA()
元器件提供商:立创商城()
电路板制造商:深圳嘉立创()
STM8S105C6T6最小系统板产品手册
方法一:进入技新网(jixin.pro)->产品中心->搜索该模块名称->进入该模块页面下载
方法二:https://www.jixin.pro/product/874.html
资料获取:
模块简介:
模块采用STM8S105C6T6为核心,并将所有的
IO 口引出,电源可选择5V 或3.3V 供电并引出5V 与3.3V 的电源接口。
带有两个LED 指示灯,四个按键,引出SWIM 接口与串口接口、电流测试接口和外扩接口,集成蜂鸣器电路。
产品特点:
引出MCU 所有IO、电源、下载、测试等接口可选择5V 或3.3作为MCU 供电可选择SWIM 或串口下载程序
提示:1、想直接用我们的封装做产品,在LCEDA 直接搜索我们的封装名称即可找到并使用
2、你的产品要用到和我们一样的元器件,在立创商城搜索框输入“器件编号”即可直达
深圳市技新电子科技有限公司www.jixin.pro STM8S105C6T6最小系统板V1.0.0.0。
PowerPoint 2003中文演示文稿-PowerPoint 2003的基本操作(二)-2(总分:100.00,做题时间:90分钟)一、论述题(总题数:12,分数:100.00)1.通过“开始”菜单启动PowerPoint 2003,关闭任务窗格然后将其显示出来。
(分数:8.00)__________________________________________________________________________________________ 正确答案:()解析:选择【开始】→【所有程序】启动。
2.根据内容提示向导创建演示文稿,类别为“企业”下的“公司会议”,演示文稿标题为“质量控制”,页脚为“新艺公司”。
(分数:8.00)__________________________________________________________________________________________ 正确答案:()解析:选择【文件】→【新建】→【根据内容提示向导】菜单命令。
3.在当前演示文稿中,插入素材中“员工培训”大纲文件中的幻灯片。
(分数:8.00)__________________________________________________________________________________________ 正确答案:()解析:选择【插入】→【幻灯片(从大纲)】菜单命令,在打开的“插入大纲”对话框进行操作。
4.使用鼠标拖动法将幻灯片2移动到幻灯片5的前面。
(分数:8.00)__________________________________________________________________________________________ 正确答案:()解析:单击选择并拖动。
5.请在幻灯片浏览视图下,在第3张幻灯片之后插入一个具有标题和两项内容版式的空白幻灯片。
PowerPoint 2003中文演示文稿-8(总分100, 做题时间90分钟)论述题SSS_TEXT_QUSTI1.给幻灯片上的文本添加弹跳动画,幻灯片切换实现慢速的盒状展开效果。
SSS_TEXT_QUSTI2.将演示文稿中的所有幻灯片的动画方案设置为“向内溶解”。
SSS_TEXT_QUSTI3.为第1张幻灯片中的标题设置“添加下划线”动画效果,并进行播放。
SSS_TEXT_QUSTI4.设置在前一事件3秒后启动当前动画效果,并且下一次单击时结束动画效果。
SSS_TEXT_QUSTI5.将当前演示文稿中当前幻灯片中的切换效果设为随机,在设置过程中不进行自动预览。
6.添加文本超链接,是幻灯片链接到“Microsoft Office”文件夹下的“PowerPoint习题”文档。
SSS_TEXT_QUSTI7.将幻灯片第3到4张的放映方式设置为“在展台浏览”。
SSS_TEXT_QUSTI8.放映幻灯片时用“荧光笔”画一条红色的直线。
SSS_TEXT_QUSTI9.设置幻灯片定时放映时间为3秒。
SSS_TEXT_QUSTI10.将第2张幻灯片设置成隐藏幻灯片,第3张的排练计时设为3秒。
SSS_TEXT_QUSTI11.检索单词“总结”的所有资料。
SSS_TEXT_QUSTI12.设置当前演示文稿的宏的安全性为“只允许运行可靠来源签署的宏”。
SSS_TEXT_QUSTI13.更改默认语言为英语(美国)。
SSS_TEXT_QUSTI14.将当前演示文稿作为单个文件网页发布,要求支持尽可能多的浏览器类型,并在浏览器中打开已发布的网页。
SSS_TEXT_QUSTI15.另存演示文稿为单个文件网页格式,文件名为“我的文稿”,其余保持默认。
SSS_TEXT_QUSTI1。
This is information on a product in full production.August 2018DS7147 Rev 10Value line, 16-MHz STM8S 8-bit MCU, 8-Kbyte Flash memory, 128-byte data EEPROM, 10-bit ADC, 3 timers, UART, SPI, I²CDatasheet - production dataFeaturesCore•16 MHz advanced STM8 core with Harvard architecture and 3-stage pipeline •Extended instruction setMemories•Program memory: 8 Kbyte Flash memory; data retention 20 years at 55 °C after 100 cycles •RAM: 1 Kbyte•Data memory: 128 bytes true data EEPROM;endurance up to 100 k write/erase cyclesClock, reset and supply management• 2.95 V to 5.5 V operating voltage•Flexible clock control, 4 master clock sources –Low-power crystal resonator oscillator –External clock input–Internal, user-trimmable 16 MHz RC –Internal low-power 128 kHz RC •Clock security system with clock monitor •Power management–Low-power modes (wait, active-halt, halt)–Switch-off peripheral clocks individually –Permanently active, low-consumption power-on and power-down resetInterrupt management•Nested interrupt controller with 32 interrupts •Up to 27 external interrupts on 6 vectorsTimers•Advanced control timer: 16-bit, 4 CAPCOM channels, 3 complementary outputs, dead-time insertion and flexible synchronization •16-bit general purpose timer, with 3 CAPCOM channels (IC, OC or PWM)•8-bit basic timer with 8-bit prescaler •Auto wakeup timer•Window and independent watchdog timersCommunications interfaces•UART with clock output for synchronousoperation, SmartCard, IrDA, LIN master mode •SPI interface up to 8 Mbit/s •I 2C interface up to 400 Kbit/sAnalog to digital converter (ADC)•10-bit ADC, ± 1 LSB ADC with up to 5multiplexed channels, scan mode and analog watchdogI/Os•Up to 28 I/Os on a 32-pin package including 21high-sink outputs •Highly robust I/O design, immune against current injectionDevelopment support•Embedded single-wire interface module(SWIM) for fast on-chip programming and non-intrusive debuggingDescription STM8S003F3 STM8S003K3DS7147 Rev 102 DescriptionThe STM8S003F3/K3 value line 8-bit microcontrollers offer 8 Kbytes of Flash programmemory, plus integrated true data EEPROM. They are referred to as low-density devices in the STM8S microcontroller family reference manual (RM0016).The STM8S003F3/K3 value line devices provide the following benefits: performance, robustness and reduced system cost.Device performance and robustness are ensured by true data EEPROM supporting up to 100000 write/erase cycles, advanced core and peripherals made in a state-of-the-arttechnology at 16 MHz clock frequency, robust I/Os, independent watchdogs with separate clock source, and a clock security system.The system cost is reduced thanks to a high system integration level with internal clock oscillators, watchdog, and brown-out reset.Full documentation is offered as well as a wide choice of development tools.Table 1. STM8S003F3/K3 value line featuresFeaturesSTM8S003K3STM8S003F3Pin count3220Max. number of GPIOs (I/O)2816External interrupt pins 2716Timer CAPCOM channels 77Timer complementary outputs 32A/D converter channels 45High-sink I/Os2112Low-density Flash program memory (byte)8 K 8 K RAM (byte)1 K 1 K True data EEPROM (byte)128(1)1.Without read-while-write capability.128(1)Peripheral setMulti purpose timer (TIM1), SPI, I2C, UART, Window WDG, independent WDG, ADC, PWM timer (TIM2), 8-bit timer (TIM4)DS7147 Rev 10STM8S003F3 STM8S003K3Block diagram3 Block diagramFigure 1. STM8S003F3/K3 value line block diagramXTAL 1-16 MHzRC int. 16 MHzRC int. 128 kHzSTM8 coreDebug/SWIMUART1I2CSPIAWU timerReset blockResetPORBORClock controllerDetectorClock to peripherals and core400Kbit/s8Mbit/sup to 5A d d r e s s a n d d a t a b u sWindow WDG8 Kbyte 128 byte 1 Kbyte RAMADC1ResetSingle wiredebug interfaceprogram Flashdata EEPROM16-bit general purpose16-bit advanced controltimer (TIM1)timer (TIM2)8-bit basic timer(TIM4)Beeper1/2/4 kHz beepIndependent WDG4 CAPCOM channels Up to 3 CAPCOM channelsUp to + 3 complementaryoutputsLIN master channelsSPI emul.STM8S003F3 STM8S003K3Product overviewDS7147 Rev 10Product overview STM8S003F3 STM8S003K3DS7147 Rev 104.12 TIM4 - 8-bit basic timer•8-bit autoreload, adjustable prescaler ratio to any power of 2 from 1 to 128•Clock source: CPU clock•Interrupt source: 1 x overflow/update4.13 Analog-to-digital converter (ADC1)STM8S003F3/K3 value line products contain a 10-bit successive approximation A/Dconverter (ADC1) with up to 5 external multiplexed input channels and the following main features: •Input voltage range: 0 to V DDA •Conversion time: 14 clock cycles•Single and continuous, buffered continuous conversion modes •Buffer size (10 x 10 bits)•Scan mode for single and continuous conversion of a sequence of channels •Analog watchdog capability with programmable upper and lower thresholds •Analog watchdog interrupt •External trigger input •Trigger from TIM1 TRGO •End of conversion (EOC) interruptNote:Additional AIN12 analog input is not selectable in ADC scan mode or with analog watchdog. Values converted from AIN12 are stored only into the ADC_DRH/ADC_DRL registers.4.14 Communication interfacesThe following communication interfaces are implemented:•UART1: full feature UART, synchronous mode, SPI master mode, SmartCard mode,IrDA mode, LIN2.1 master capability •SPI: full and half-duplex, 8 Mbit/s •I²C: up to 400 Kbit/sTable 3. TIM timer featuresTimerCounter size (bits)PrescalerCounting mode CAPCOM channels Complem. outputs Ext. trigger Timersynchr-onization/ chainingTIM1 16Any integer from 1 to 65536Up/down 43Yes NoTIM2 16Any power of 2 from 1 to 32768Up 30No TIM48Any power of 2 from 1 to 128UpNo。
STM8S单片机开发的过程及方法STM8S单片机开发环境由三大部分组成,包括PC机上的开发软件(集成开发软件、驱动程序等)、调试">1、PC机上开发软件PC机上的软件包括:ST-LINK驱动程序、IAR集成开发环境、STM8S标准函数库、STVP 烧录工具。
ST-LINK调试">这个驱动程序不需要单独安装,安装STVP时会一起安装。
IAR集成开发环境IAR集成开发环境是集程序编辑、编译、程序下载、调试等功能为一体的集成开发工具,它可以通过ST-LINK调试">针对STM8S的集成开发工具有多种,本教程选用IAR集成开发工具,主要是由于其成熟稳定,简单易用。
IAR集成开发工具的全称是“IAR for STM8”,版本号推荐比较成熟的2.10.5版本。
STM8S标准库函数STM8S标准函数库是ST原厂推出的C语言函数库,把STM8S单片机的基本操作都封装成了库,能极大提高开发效率。
STM8S标准函数库的全称是STM8S_StdPeriph_Lib_V2.1.0。
当然不使用标准库函数也能进行单片机程序开发,但是这需要自己操作单片机的每个寄存器,需要对单片机内部构造和寄存器的作用非常熟悉才能做到,开发复杂度会成倍增加。
STVP烧录工具STVP(ST Visual Programmer)烧录工具也是ST原厂推出的。
虽然说一般的程序下载到单片机,使用IAR集成开发环境就可以了,但设置STM8S单片机的选项字节(OPTION BYTE)使用STVP烧录工具还是方便一些。
选项字节有两个最重要、最常用的功能:一是设置读出保护开关(ROP),大家可能遇到买回来的成品STM8S单片机开发板,无法用IAR进行程序下载和调试,这就是ROP设置为开了,这种情况下需要用STVP重新设置为关才能用;二是设置单片机引脚的第二功能,STM8S单片机很多引脚都有多个功能,比如作为SPI接口还是作为定时器通道,也是要通过选项字节来设置的。