OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 4362|回复: 0

STM8L101F3P6工程模板建立详细过程

[复制链接]

45

主题

198

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1104
金钱
1104
注册时间
2016-3-25
在线时间
358 小时
发表于 2018-4-19 10:14:47 | 显示全部楼层 |阅读模式
本帖最后由 Mr.liu 于 2018-4-19 10:32 编辑

    貌似网上很少STM8L101F3P6工程模板,及如何建立模板的教程,所以自己今天试了一下。,以下内容仅供参考。




The STM8L101x1 STM8L101x2 STM8L101x3 low-power family features the enhanced STM8 CPU core providing increased processing power (up to 16 MIPS at 16 MHz) while maintaining the advantages of a CISC architecture with improved code density, a 24-bit linear addressing space and an optimized architecture for low power operations.

The family includes an integrated debug module with a hardware interface (SWIM) which allows non-intrusive in-application debugging and ultrafast Flash programming.

All STM8L101xx microcontrollers feature low power low-voltage single-supply program Flash memory. The 8-Kbyte devices embed data EEPROM.

The STM8L101xx low power family is based on a generic set of state-of-the-art peripherals. The modular design of the peripheral set allows the same peripherals to be found in different ST microcontroller families including 32-bit families. This makes any transition to a different family very easy, and simplified even more by the use of a common set of development tools.

All STM8L low power products are based on the same architecture with the same memory mapping and a coherent pinout.

Key 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 38 kHz RC driving both the IWDG and the AWU
                   
  • Reset and supply management


               
    • Ultra-low power POR/PDR
    • 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 programmable 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



    1.官网下载固件库(http://www.st.com)  

   登陆ST帐号,没有的就先注册一个,下载的时候会要求登录。

      进入官网后,选择“Products”---->“Microcontrollers”,
      在弹出的新页面中选择8-bit中的“STM8L”。
      在弹出来的新页面的表格中选择“STM8L101F3”  --->   "Resources",
      在新页面中往下拉,找到“Emberdded Software”处,找到“
STSW-STM8012STSTM8L10x standard peripheral library
”这一栏,这里面有些例程,同时包括固件库。

     2.解压后文件目录如图。

     3.用IAR-EWSTM8建一个新工程。

     在桌面新建一个文件夹,名字自取,也不一定在桌面建,凭个人习惯。用于保存我们模板。

         打开“IAR Embedded Workbench IDE ”,在菜单栏中选择“Project”——>"Create New Project..."  选择新建一个C工程。

      默认新建 了一个main.文件。给工程添加组。分别是“user”、"bsp"、“STM8L10x_StdPeriph_Driver”(用于存放库文件)。

     把下载下来的文件解压后里面的“STM8L10x_StdPeriph_Lib”整个文件夹都拷到我们新建的模板目录下,并新建“user”、"bsp"文件夹。

     给各组添加文件。

   把相关路径添加。如图。
   添加配置文件: "stm8l10x_conf.h",我是从工程中拷过来的,这个不知道是不是需要自己写。

   在“main.c”中把"stm8l10x_conf.h"头文件包含进来,然后编译,0错误。这样算完了。


   本人愚钝,有不对之处请指正。谢谢。


       
  
11.png
10.png
09.png
08.png
07.png
06.png
05.png
04.png
03.png
02.png
01.png

stm8l101_ex.rar

1.11 MB, 下载次数: 177

代写STM32各类驱动,DEMO程序
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-9-27 06:51

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表