Home
AN3029 - STMicroelectronics
Contents
1. the Target selected above Add Remove Show the selected target notification at start of debugging session DoclD16139 Rev 5 33 42 Setting up the STM8 development environment AN3029 10 3 3 34 42 Connecting the hardware The debug tool STLink is included on the STM8L1526 EVAL and STM8L1528 EVAL boards You can connect the PC to the USB connector This connection ensures the debug connection and the power If the jumpers on the boards are no longer in the default position please read the evaluation board user manuals to select power and debug support jumpers For the STM8L101 EVAL the Rlink tool can be connected to the PC by a standard USB connection It is also powered by the USB interface On the controller side the connection to the STM8 evaluation board is made using the SWIM interface cable The STM8L101 EVAL evaluation board is powered by an external 5 V supply see Figure 22 Figure 22 Connecting the debug instrument to the STM8L101 EVAL evaluation board 2 DoclD16139 Rev 5 AN3029 Setting up the STM8 development environment Figure 23 Connecting the debug instrument to the STM8L152x EVAL evaluation board Caution On the Rlink adapter board for STM8 the SWIM jumper must be set If there is no pull up on the application SWIM line the ADAPT jumper is also set The PW 5V and 12MHz jumpers must not be set 2 DoclD16139 Rev 5 35 4
2. Cor AN3029 y eee Application note Getting started with STM8L and STM8AL Introduction This application note complements the information in the STM8L and STM8AL datasheets by describing the minimum hardware and software environment required to build an application around an STM8L or STM8AL 8 bit microcontroller device A brief description of the principal hardware components is given The power supply analog to digital converter ADC clock management and reset control are described in some detail In addition some hardware recommendations are given This application note also contains detailed reference design schematics with descriptions of the main components The STM8 development tools and software toolchain are common to STM8L STM8S STMBAL and STMS8AF and are presented in Section 8 and Section 9 Section 10 describes how to set up the STM8 development environment Finally Section 11 provides a list of relevant documentation and online support resources Table 1 Applicable products Product family Part numbers STM8L051 52 STM8L101 STM8L151C2 K2 G2 F2 and STM8L151C3 K3 G3 F3 Microcontrollers STM8L151x4 STM8L151x6 STM8L152x4 STM8L152x6 STM8L151x8 STM8L152x8 STM8L151R6 STM8L152R6 STM8L162R8 STM8L162M8 STM8AL313x STM8AL314x STM8AL316x STM8AL3L4x STM8AL3L6x July 2013 DoclD16139 Rev 5 1 42 www st com Contents AN3029 Contents 1 Hardware requirements su
3. 100 KHz Osc Peripheral RAM NVM MS32527V1 DoclD16139 Rev 5 21 42 STM8 development tools AN3029 8 1 2 SWIM connector pins The SWIM connector pins consist of four pins as described in Table 3 Table 3 SWIM connector pins Pin number Pin name Pin 1 VDD Pin 2 SWIM pin Pin 3 Vss Pin 4 Reset 8 1 3 Hardware connection Figure 12 Hardware connection AD ICC SWIM adapter Application board SWIM connector SWIM cable MS32528V1 Caution Itis recommended to place the SWIM header as close as possible to the STM8L STM8AL device as this minimizes any possible signal degradation caused by long PCB tracks 2 22 42 DoclD16139 Rev 5 AN3029 STM8 development tools 8 2 8 2 1 2 STice emulator STice overview The STice is a modular high end emulator system which connects to the PC via a USB interface and to the application board in place of the target microcontroller It is supported by the free STM8 toolset IDE ST Visual Develop STVD programmer ST Visual Programmer STVP and STM8 Assembler Please refer to the STice emulator for STMB for more details STice has two distinct modes of operation which are described further in this section e Emulation mode e _In circuit mode It can also be used instead of RLink for SWIM connection Figure 13 Connection description _ Emulation system p Connection flex M M
4. main c C He pdit Yow Brome Duk Debug Cebuolutrumint Ics Wiedow Hels o ebr 3o 09oo9 o WV T t Di b A 2 0 06 loz M q 8 A 0 D P S Uty c 1 K A i h WADOS bege 3EY In EE Y 5 1 85 G mano Jed c T Cho Reser iuste E Ubrary T recat ant 3 stn acc 3 oun janet Cortines 3 5 in beep y E stroke 8 stm exte Y Step Into Pua 5 stna fash Qep Over o 2 atin Me Po PA Step Into AS AlsFi awe Daromas mono Foreros orte int n n tma do P Rep Ow en FP main c 45 al 5 stn nuari 4c punto Curser Qiero 0x8902 lt Delay 10 gt 0x85 popu x 5 stn ssc 0x8503 lt Delay 11 gt oxet RIT E stn ope Y seras MTS main c 47 void main void a ese qeu eI 0x8904 main OxS20a SUDU 37 0x05 EEES peres GPIO InitStrwcture GPIO Pi main c 56 GPIO InitStructure GPIO Mode GPIO MODE OUT PP LOU FA 5 sti ins GPIO Init LEDS PORT GPIO 28238888539 idi Ox6908 lt maln 4 gt Ox6802 up Ox02 SP 4 main c 57 GPIO_ InitScructure GPIO Pin LED1 PIN LED2 PIN L 0x890a lt maint gt OxA60F LD A S0xOf Ox890c msin Ox6001 up 0x03 8P A zl gt Stacks pc TEMES sr oana x 0x100 v 0xB9cc Aoccumulstor Condition Fisgs A 0 00 co j x a rear Win were Ly DoclD16139 Rev 5 37 42 Setting up the STM8 development environment AN3029 10 3 6 38 42 The LCD display on the STM8 evaluation board indicates
5. 5 15 42 Reset control AN3029 5 2 16 42 Hardware reset implementation The STM8L and STMB8AL do not require an external reset circuit to power up correctly Only a pull down capacitor is recommended see Figure 7 However charging discharging the pull down capacitor through an internal resistor has a negative influence on the device power consumption Therefore the recommended capacitor value of 100 nF can be reduced down to 10 nF to limit such power consumption The STM8L101xx reset state is released 1 ms after the POR value 1 35 V to 1 65 V is reached At this time Vpp should be in the 1 65 V to 3 6 V range For medium density devices and medium and high density devices operating from 1 8 V at power on the reset state is released 1 ms after the BOR minimum value 71 75 V is reached DoclD16139 Rev 5 2 AN3029 Recommendations 6 6 1 6 2 6 3 6 4 2 Recommendations Printed circuit board For technical reasons it is best to use a multi layer PCB with a separate layer dedicated to the Vss and another layer to the Vpp supply This results in a good decoupling as well as a good shielding effect For many applications economical requirements prohibit the use of this type of board In this case the most important feature is to ensure a good structure for the Vss and power supply Component position A preliminary layout of the PCB must separate the different circuits according to their e
6. DoclD16139 Rev 5 Ly AN3029 Contents 7 Reference design a2 shceoe5es A nm em Pee bse ERG ERU RUE 19 7 1 Component references 19 7 2 Schematics o 20 8 STM8 development tools 200 0 cee eee eee eee eee 21 8 1 Single wire interface module SWIM 0 00 e eee eee 21 8 1 1 SWIM overview 000 RH n 21 8 1 2 SWIM connector PINOS 22 8 1 3 Hardware connection o oocococcoo ees 22 8 2 STice emulator o o ooooooooo ns 23 8 2 1 STice overview ills rn 23 8 2 2 STice in emulation configuration 0 0 0 eee 24 8 2 3 In circuit programming and debugging lessen 25 8 3 RLink and STLink ooooooooooooooo 25 9 STM8 software toolchain 0c eee 26 9 1 Integrated development environment lille 2 eee ee eee 27 9 2 Comlpller xiii ae ae Re ate a a KOC CRGA a ek LUCR c CR 27 9 3 Firmware library e sicario 27 10 Setting up the STM8 development environment 28 10 1 Installing the tools lt lt lt crec rra PESE REB CREE RE ERROR ROE 28 10 2 Using the tools ect eeg idem iod Rh Td dirmi Rca 29 10 2 1 Projectediting oooooooccoooccocno II 30 10 2 2 Online help osse aan 31 10 3 Running the demonstration software 0200 eee 32 10 3 4 Compiling the project o ooo ooocccococcccnac RII 32 10 3 2 Selecting the correct debug instrument 020 0 eee 33 10 3 3 Connecting the
7. a successful debug session see Figure 26 Figure 26 STM8 evaluation board lii LLELEEPT T os lt LET EP S Follow up Step by step additional peripherals of STM8L STM8AL devices can be run following on from the initial debug session described above Many features of STM8L STM8AL devices are supported by dedicated hardware on the STM8 evaluation board The necessary software drivers including STM8L STM8AL peripheral drivers USART ADC SPI and drivers for the EVAL board modules LCD serial memory are delivered in the STM8L1x firmware library d DoclD16139 Rev 5 AN3029 Documentation and online support 11 2 Documentation and online support Documentation resources related to tool usage includes Application STM8L STM8AL datasheets How to program STM8L Flash program memory and data EEPROM PM0054 STM8 CPU programming manual PM0044 STM8L05xx STM8L15xx STM8L162x STM8AL31xx and STM8AL3Lxx microcontroller family RM0031 STM8L101xx microcontroller family RM0013 Tools STM8L STMBAL firmware library and release note detailed descriptions of the library are included as help files STice advanced emulation system for ST microcontrollers data briefing STice user manual Cosmic Raisonance or IAR C compiler user manual STM8L101 EVAL STM8L1526 EVAL or STM8L1528 EVAL evaluation board user manual STM8L1x EVAL STM8L1526 EVAL or STM8L1528 EVAL firmware ST Visual Dev
8. uu Connection adapter es proe mnm Emulation system STice e Emulator box e Cables for USB power supply trigger and analyzer input Connection flex e 60 pin or 120 pin cable for connection to the application board Connection adapter e Links the connection flex to the footprint of the STM8L STM8AL microcontroller Adapter socket e Package specific socket for connection adapter and STM8L STM8AL microcontroller DoclD16139 Rev 5 23 42 STM8 development tools AN3029 8 2 2 24 42 STice in emulation configuration In emulation configuration the STice is connected to the PC via a USB interface and to the application board in place of the target microcontroller being used e Connection flex Flexible cable 60 pin or 120 pin depending on the target microcontroller that relays signals from the STice to the application board e Connection adapter Links the connection flex to the footprint of the target microcontroller on the users application board e Adapter socket Socket that solders to the application board in place of the microcontroller and receives the connection adapter The above accessories are not included with the STice system To determine exactly what is required for any supported microcontroller refer to the online product selector on www st com Figure 14 STice in emulation configuration Free ST STMB toolset STVD and STVP running on your PC drive STice STice SYSxxx In
9. 2 Setting up the STM8 development environment AN3029 10 3 4 36 42 Starting the debug session Debug mode can be entered by the command Debug Start Debugging see Figure 24 Figure 24 STVD Starting the debug session 1 ST Visual Develop project stw main c lS File Edit View Project Build Debug Debug instrument Tools Window Help omm e ascua IE as joo gt ei Workspace Hrs project stw gt fe j project l P 3 Source Files PERERA RARA RARA B main c a mno kdc FE chin pe Pf This file contains the firr E uc i hor STMicroelectronics H E Library Y Restar dai A mu Bion VO 04 amp main c stm8_it c i8 stp interrupt v 13 Include Files i ind Dependence Ry PRESENT SOFTWARE WHICH IS FOR 13 CODING INFORMATION REGARDING E mods0 h a k R L AS A RESULT STMICROELECTRON a ASM AlE4 CT INDIRECT OR CONSEQUENTIAL KR si ASM A 1 THE CONTENT OF SUCH SOFTWARE NG INFORMATION CONTAINED HEREI Kcenter amp copy COPYRIGHT 2007 mE pe html logo bmp A RARA mono lcd h 2 DoclD16139 Rev 5 AN3029 Setting up the STM8 development environment 10 3 5 Running the software After entering debug mode the software can be started by the run command in the menu Debug Run see Figure 25 Figure 25 STVD Run the software as STMBAFS1xx STM SWIM project stw Debug project elf
10. ES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT ST PRODUCTS ARE NOT AUTHORIZED FOR USE IN WEAPONS NOR ARE ST PRODUCTS DESIGNED OR AUTHORIZED FOR USE IN A SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS B AERONAUTIC APPLICATIONS C AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS AND OR D AEROSPACE APPLICATIONS OR ENVIRONMENTS WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE THE PURCHASER SHALL USE PRODUCTS AT PURCHASER S SOLE RISK EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR AUTOMOTIVE AUTOMOTIVE SAFETY OR MEDICAL INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS PRODUCTS FORMALLY ESCC QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY Resale of ST products with provisions different from the statements and or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever any liability of ST ST and the ST logo are trademarks or registered trademarks of ST in various countries Information in this document supersedes and replaces all informa
11. STAARARTATAATATATRTRTARATARTATTATRTAATTATAATRATTTAT h2 gt lt center gt STMicroelectronic Includes include stm8 lib h include mono lcd h Private define Evalboard I fdefine LEDS PORT f define LED1 PIN define LED2 PIN define LED3 PIN f define LED4 PIN nfiguration GPIOH GPIO PIN 3 GPIO PIN 2 GPIO PIN 1 GPIO PIN O Private function lii prototypes 30 42 DoclD16139 Rev 5 AN3029 Setting up the STM8 development environment 10 2 2 Online help An online help manual is available inside the firmware installation directory see Figure 19 to help the user understand the structure of the STM8 firmware library Figure 19 STM8 firmware library online help manual E HTML Help E e gt o g ide Locate E Fo Stop Refresh Home Print Options Contents Index Search Favorites Main Page Modules Data Structures Files Directories Q amp STM Firmware Library f ES dente e Modules S o STM8 Firmware Library and Examples File List E t gne On line Help Manual STMicroelectronics ky q DoclD16139 Rev 5 31 42 Setting up the STM8 development environment AN3029 10 3 10 3 1 32 42 Running the demonstration software Go to www st com mcu and search for STM8L STM8AL products Choose STM8L1x EVAL STM8L1526 EVAL or STM8L1528 EVAL firmware Open the desired project workspace within
12. an external oscillator When no external clock is used OSCIN and OSCOUT can be used as general purpose I Os Figure 4 describes the external clock connections External clock e Frequency 0 kHz 16 MHz e Input hysteresis 100 mV Without prescaler a duty cycle of 45 55 maximum must be respected at high speed 2 DoclD16139 Rev 5 AN3029 Clock management 2 Crystal ceramic resonator e Frequency range 1 to 16 MHz e Stabilization time Programmable from 1 to 4096 cycles e Oscillation mode Preferred fundamental e Output duty cycle Max 55 4596 e l Os Standard I O pins multiplexed with OSCjy and OSCoyt e Cload 10 to 20 pF e Drive level maximum at least 100 pW Figure 4 HSE clock sources Hardware configuration STM8 OSCN OSCour External clock I O available External source MS32524V1 Z STM8 6 OSC OSCour c o o Rexr E s LLL Ty n Jis E L Cc C2 5 e E o Load capacitors MS32529V1 1 The value of Rex depends on the crystal characteristics A 0 Q resistor works well with most oscillators but it is not optimal A typical value is in the range 5 to 6 Rg resonator series resistance To fine tune the Rexr value refer to AN2867 Oscillator design guide for ST microcontrollers The values of the load capacitors C 4 and C are heavily dependent on the cry
13. cludes all emulation resources MEB TEB and PEB CF FPxxx Connection flex to connect to application board LN ES 6 gt k PU PA AD xxxx Connection d AS xxxx Adapter socket on li E adapter to link AS application board to plug in connection cable to Es emulator in place of microcontroller microcontroller 2 DoclD16139 Rev 5 AN3029 STM8 development tools 8 2 3 8 3 2 In circuit programming and debugging In the in circuit debugging programming configuration STice allows the application to be programmed in the microcontroller and for the application to be debugged while it runs on the microcontroller on the application board STice supports the SWIM protocol making it possible to in circuit program and debug the microcontroller using only one general purpose 1 0 In both the emulation and the in circuit programming debugging configuration STice is driven by the ST Visual Develop STVD or ST Visual Programmer STVP integrated development environment running on the host PC This provides total control of advanced application building debugging and programming features from a single easy to use interface Figure 15 In circuit programming and debugging ICD ICP flat cable connects STice to microcontroller via ICD ICP connector on application board SWIM connector linked to microcontroller NN 3 ST microcontroller on M application board RLink and STLink RLink and STLi
14. connected to Vpp through a ferrite bead STM8L152xx STM8AL3Lxx and STM8L162xx devices manage the supply voltage needed by the LCD in three different ways see Figure 1 1 If the LCD feature is not used connect the VLCD pin to Vpp 2 Apply to VLCD the voltage to be applied to the LCD 3 Leave the STM8L152xx STM8L 162xx STM8AL3L xx to provide the correct voltage via its programmable LCD booster by connecting the VLCD pin to a 1uF capacitor DoclD16139 Rev 5 Ly AN3029 Power supply Figure 1 Power supply STM8L STM8AL VREF VLCD mM 100 nF 1 pF optional note 1 N x 100 nF 1x 10 pF MS30982V1 1 Optional if a separate external reference voltage is connected on Vrgf the two capacitors 100 nF and 1 HF must be connected Vggr is either connected to Vppa or VREF 2 Nis the number of Vpp and Vss inputs Note The capacitors must be connected as close as possible to the device supplies Placing a crystal resonator on OSCIN OSCOUT is optional The resonator must be connected as close as possible to the OSCIN and OSCOUT pins The loading capacitance ground must be connected as close as possible to Vgs 2 2 Main operating voltages 2 STM8L and STMB8AL devices are processed in 0 13 um technology The STM8L and STM8AL core and I O peripherals need different power supplies In fact STM8L and STMBAL devices have an internal regulator with a nominal target output of 1 8 V DoclD16139 Rev 5 7 42 Power su
15. ctstw SS Open Files of type Project Workspace stw y Cancel A FindinFies1 A Find in Files 2 For Help press F1 Ln Col MODIFIED READ CAP NUM SCRL OVA DoclD16139 Rev 5 29 42 Setting up the STM8 development environment AN3029 10 2 1 Project editing All project source files are visible and can be edited see Figure 18 Figure 18 STVD MCU edit mode as ST Visual Develop project stw main c Je Eile Edit View Project Build Debug Debuginstrument Tools Window Help beann ajos a lloo EE dsras a0oteR ak E Workspace En amp OF 8x OF 70 project stw project Y Source Files E mono_led c 3 stm8_adc c stm8 awu c stm8 beep c stmB8 clk c stm8_exti c stm8_flash c stm8_gpio c 2 stm8_i2c c stm8_itc c stm8_iwdg c stm8_linuart c stm8_rst c stm _spi c stm8 tim1 c stm8 tim2 c stm8 tim3 c stm8 tim4 c stm8 usart c stm8 wwdg c main c stm8_it c stp interrupt vector c Include Files E mono Icd h Library stm8 conf h stm8_it h J External Dependencies E mods0 h ONDIMKNHPYNE B TTIATATISSATAEATESTIRTSIATATAISTAATEITATTAAAYAATATAAAA Y GRAVATAR T4446 an 4g e e n n Bfile main the firmware main function tronics R GUIDANCE ONLY AIMS AT VIDING THEIR PRODUCTS IN ORDER FOR THEM TC ALL NOT BE HELD LIABLE FOR amp ODING INFORMATION COPYRIGHT 2007 Bimage html bmp TRTETAETAATTZEATATARTAATAATAATATTATAAT
16. d Alternatively unused I Os can be programmed as push pull low to keep them at a defined level without using external components However in this case the I O is not driven during the power up phase until the I O is configured This can add a little extra power consumption and may be undesirable in very power sensitive applications User options STM8L and STMBAL devices have user option features that can be used for remapping or enabling disabling an automatic reset or low speed watchdog For more details please refer to the product datasheets Bootloader STM8L05xx STM8L15xxx STM8L162xx STM8AL31xx and STM8AL3Lxx devices have a bootloader embedded in a ROM memory Through this firmware the device memory can be re programmed via e USART communication interface for medium density devices e USARTI USART2 USART3 SPI1 and SPI2 communication interfaces for medium and high density devices 2 DoclD16139 Rev 5 AN3029 Reference design 7 Reference design 7 1 Component references Table 2 Component list ID Component name Reference Quantity Comments Refer to the pinouts and pin description I Monor srwa stwea 1 st a characottos sectors choose the right package 2 Battery 1 65 V to 3 6 V 1 Min 1 8 V when BOR is enabled 3 Capacitor 1 uF n Decoupling capacitor 4 Capacitor 100 nF n Ceramic capacitor decoupling capacitor Components below are optional 5 Capaci
17. e beads for example are excellent inductors due to their good dissipation of EMI energy and there is no loss of DC voltage which is not the case when simple resistors are used DoclD16139 Rev 5 17 42 Recommendations AN3029 6 5 6 6 6 7 6 8 18 42 Other signals When designing an application the following areas should be closely studied to improve EMC performances e Noisy signals clock e Sensitive signals high impedance e Signals for which a temporary disturbance permanently affects operation of the application for example interrupts and handshaking strobe signals but not LED commands A surrounding Vas trace for such signals increases EMC performances as does a shorter length or absence of noisy and sensitive traces crosstalk effect For digital signals the best possible electrical margin must be reached for the two logical states Slow Schmitt triggers are recommended for eliminating parasitic states Unused l Os and features Microcontrollers are designed for a variety of applications where often a particular application does not use 100 96 of the microcontroller resources To avoid unnecessary power consumption especially important for battery powered applications and also to improve EMC performance unused clocks counters or I Os should not be left free I Os should be forced externally pull up or pull down to the unused I O pins and unused functions should be frozen or disable
18. ed with the ST toolset The R link drivers must be launched separately as follows Start Programs STtoolset Setup Install Rlink driver 2 DoclD16139 Rev 5 AN3029 Setting up the STM8 development environment 10 2 Note q Using the tools Once the tools installation is complete the ST Visual Develop STVD integrated development environment can be launched The user then has the choice to generate either a new workspace with a new project or to open an existing workspace If using the STVD for the first time it is recommended to open an existing project from the STM8 firmware library Even if you are not intending to use the library an existing library project can be used as a template to configure all the compiler options Enter your own code after main The STM8 firmware library includes several examples for each peripheral plus one workspace containing a blank project which is ready to receive your C code It is located in the firmware subdirectory Project Template see Figure 17 You can choose between STVD Cosmic STVD Raisonance RIDE or EWSTM8 Figure 17 STVD open example workspace 4 ST7 Visual Develop File Edit View Project Build Debug Debuginstrument Tools Window Help as ct ta UE NN a gER DR oe x j i No Workspace Open Workspace Look in e 1STMB8 Firmware Library Project Cosmic 4 E E EJ Debug Es Workspace Release project stw File name Jpwie
19. elop tutorial included as help files in the ST toolchain ST Visual Develop STVD user manual STM8 SWIM communication protocol and debug module user manual UM0470 The microcontroller discussion forum on www st com can be used by developers to exchange ideas It is the best place to find different application ideas In addition the website has a knowledge base of FAQs for microcontrollers which provide answers to many queries and solutions to many problems DoclD16139 Rev 5 39 42 Revision history AN3029 12 Revision history Table 4 Document revision history Date Revision Changes 09 Sep 2009 1 Initial release Updated all sections and references for medium density medium density and high density devices Added STM8L16x devices Replaced Vppio and Vssio by Vppx and Vas respectively Replaced 48 pin package by some packages Added IAR C compiler Section 2 1 Power supply overview updated text Figure 1 added note 2 removed the sign on the VLCD cappa Crystal ceramic resonator added reference to AN2867 Section 3 2 Analog input updated text Section 4 3 2 LSE clock re arranged section Section 5 1 Reset management overview removed bullet electromagnetic susceptibility EMS reset present only on STM8S 16 Sep 2010 2 family Figure 7 removed EMS reset added external reset circuit Section 5 2 Hardware reset implementation added text about the pull down capacitor Table 2 Compone
20. external source 1 8 V to 3 6 V for STM8LO5xxx For medium density STM8L 15xxx medium density STM8AL31xx STM8AL3Lxx and high density STM8L15xxx STM8L162xx with BOR the power supply must be above 1 8 V at power on and can go down to 1 65 V at power down An on chip power management system provides the constant digital supply to the core logic both in normal and low power modes This guarantees that the logic consumes a constant current over the voltage range It is also capable of detecting voltage drops and generate reset to avoid heratic behavior The STM8L and STM8AL devices provide e Depending on packages one pair of pads Vpp Vss or several pairs of pads Vppx Vssx from 1 65 V or 1 8 V to 3 6 V All Vppx and Vas must be at the same potential respectively The Vpp pins must be connected to Vpp with external decoupling capacitors one 100 nF Ceramic capacitor for each Vppx pin and one single 1 uF Tantalum or Ceramic capacitor The STM8L15xxx STM8AL31xx and STM8L162xx devices also provide in some packages e One pair of pads Vona Vssa dedicated to analog functions Vppa and Vssa must be at the same potential respectively as Vpp and Vss Refer to Section 3 Analog to digital converter ADC for more details The Vppa pin must be connected to two external decoupling capacitors one 100 nF Ceramic capacitor and one single 1 uF Tantalum or Ceramic capacitor Additional precautions can be taken to filter analog noise Vopa can be
21. gement AN3029 4 4 1 4 2 4 3 4 3 1 Note Caution 10 42 Clock management The STM8L101xx devices have no external clock so no precautionary measures are needed Clock management overview STM8LO5xxx STM8L15xxx STM8L162xx STM8AL31xx and STM8AL3Lxx devices offer a flexible way of selecting the core and peripheral clocks ADC memory and digital peripherals The devices have internal and external clock source inputs both of which have a high speed and a low speed version Any of those four clocks can be use for the CPU and most of the peripherals through a programmable prescaler An I O can be programmed as output clock CCO to reflect one of the four clocks with or without prescaling The signal which leaves the I O represents an output clock CCO divided by a division factor Internal clocks STM8L and STM8AL devices have two kinds of internal clock A high speed internal clock HSI running at 16 MHz and a low speed internal clock LSI running at 38 kHz After reset the CPU starts with the internal RC HSI clock signal divided by 8 i e 2 MHz External clock STM8L05xx STM8L15xxx STM8L162xx STM8AL31xx and STM8AL3Lxx devices have two kinds of external clock A high speed external clock HSE running at up to 16 MHz and a low speed external clock LSE running at 32 768 kHz HSE clock STM8L05xx STM8L15xxx STM8L162xx STM8AL31xx and STM8AL3Lxx devices can connect to an external crystal or
22. hardware 00 ee 34 10 3 4 Starting the debug session 0 cece ee 36 10 3 5 Running the software 0 0 en 37 10 36 FONOW UP ss veria BAR Genel de RARE RE ERAS 38 11 Documentation and online support 000 eee ee eens 39 12 REVISION history esc gee wee Sed eee ede ew awh e e a ERE GRE Rs 40 Ky DoclD16139 Rev 5 3 42 List of tables AN3029 List of tables Table 1 Applicable products s sses ant iaa a E D eet 1 Table 2 Component list s semasa daina a a e i a rrr 19 Table 3 SWIM connector pins o 22 Table 4 Document revision history ooooocccoccco hn 40 4142 DoclD16139 Rev 5 Ly AN3029 List of figures List of figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 2 Power Supply ix usu ar pads Gob ee ERR ae da 7 Typical layout of Vpp Vss pair 6 ne 8 Analog input interface llis hr 9 ASE clock SOURCES aae hae a RR RUE Re RU RT aS RR eae Pe OG o RR Rd 11 External Clock 3 der DUUpR ERR ER CRAP REA REA specus pde 12 Crystal ceramic resonators iiie 13 Reset management o 14 Output characteristics n 2lllllsislssllll eee 15 Input characteristics x ecece bra vac ew Sae
23. lectromagnetic interference EMI contribution This reduces cross coupling on the PCB for instance noisy high current circuits low voltage circuits and digital components Ground and power supply Vss Vpp The Vss should be distributed individually to every block noisy low level sensitive and digital with a single point for gathering all ground returns Loops must be avoided or have a minimum surface The power supply should be implemented close to the ground line to minimize the surface of the supply loop This is due to the fact that the supply loop acts as an antenna and is therefore the main emitter and receiver of EMI All component free surfaces of the PCB must be filled with additional grounding to create a kind of shield especially when using single layer PCBs Decoupling The standard decoupler for the external power is a 1 uF pool capacitor Supplementary 100 nF capacitors must be placed as close as possible to the Vss Vpp pins of the microcontroller to reduce the area of the current loop As a general rule decoupling all sensitive or noisy signals improves electromagnetic compatibility EMC performances There are two types of decouplers e Capacitors close to components Inductive characteristics which apply to all capacitors beyond a certain frequency must be taken into account If possible parallel capacitors with decreasing values 0 1 0 01 uF should be used e Inductors Although often ignored ferrit
24. mmary oocccocc eens 6 2 Power Supply casses Rs Henn ves 6 2 1 Power supply overview oo 6 2 2 Main operating voltages 0 0 cc eee 7 2 3 Power on power down reset POR PDR occocccccccoo 8 3 Analog to digital converter ADC oooooommmmmmmmm m 9 3 1 a A dote qais doet Biv nn ae wt d wid Ge SUR asp a Rind lee 9 3 2 Analog Ifniput cx coss xe ERR AEREAS AAA 9 4 Clock management lt 66665208 Re RRRR RR RR EE EREREENEARAKRER ES 10 4 1 Clock management overview oooocooooooooon eere 10 4 2 Internal clocks oooooooo rs 10 4 3 External Clock raniad cd a a doo ee eee e be Rode 10 4 3 1 HSE Clock 2 i re E RIED edi ee lad eei 10 4 3 2 LSE clock av ore xd te pe bee epe edes 12 5 Reset control issxzasuasswuxcexdbau R d RR REGE GER REOR IDA RUE RR RR eens 14 5 1 Reset management overview llli eee 14 5 1 1 Output characteristics llle 15 5 1 2 Input characteristics liliis 15 5 2 Hardware reset implementation 0000 cece eee 16 6 RECOMMENdATIONS 22 sg ReRRRR e RE EE SERE REPE RES ERES 17 6 1 Printed circuit board 0 0000 eee 17 6 2 Component position 0 0 000 ce ee 17 6 3 Ground and power supply Vss Vpp eee eee 17 6 4 Decotplintc assis RR RARO kee bake A ERREA RA AUC O AA 17 6 5 Other signale 2225s rosita d e edi 18 6 6 Unused I Os and features auaa aaaea 18 6 7 User options o 18 6 8 Bootloader o 18 2 42
25. nal source ai15765 1 OSC32 IN and OSC32_OUT pins can be used also as GPIO but it is recommended not to use them as both RTC and GPIO pins in the same application External crystal ceramic resonator LSE crystal The LSE crystal is a 32 768 kHz low speed external crystal or ceramic resonator It has the advantage of providing a low power but highly accurate clock source to the real time clock peripheral RTC for clock calendar or other timing functions The resonator and the load capacitors have to be connected as close as possible to the oscillator pins in order to minimize output distortion and start up stabilization time The load capacitance values must be adjusted according to the selected oscillator 2 DoclD16139 Rev 5 AN3029 Clock management Figure 6 Crystal ceramic resonators Microcontroller OSC32 IN OSC32 OUT C Cio ai15764 1 To avoid exceeding the maximum value of C 4 and C 15 pF it is strongly recommended to use a resonator with a load capacitance C 7 pF To fine tune the choice refer to the gmcrit Calculation in AN2867 Oscillator design guide for ST microcontrollers 2 OSC32 IN and OSC32 OUT pins can be used also as GPIO but it is recommended not to use them as both RTC and GPIO pins in the same application 3 The value of Rgx1 depends on the crystal characteristics A 0 Q resistor works with most oscillators A typical value is in the range 5 to 6 Rs To fine
26. nk are debug tools that allow the STM8L evaluation board or any user application board with the SWIM interface to be connected to a host PC via USB for debugging and programming See Section 10 3 3 Connecting the hardware on page 34 DoclD16139 Rev 5 25 42 STM8 software toolchain AN3029 9 STM8 software toolchain To write compile and run the first software on an STM8L STMB8AL device the following components of the software toolchain are required see Figure 16 e Integrated development environment e Compiler e Firmware library optional used to ease the startup Figure 16 STM8 software toolchain Mme Further interrupts ere masked by hardu a b Determine next state f nextState GREEN Trap Interrupt Service Routim break q _X m4 nn e case OFF Bincerrupt nostack void trapl R nextStace OrT t break color nextState me default 7 nextState currentStare 1 Further interrupts ere masa 799 break so Determine next state 81 82 Go to next state and update traced var if staca nexcScace scaceOccurence lt EAX RED E rat are Or re currentState nextstate state currenctScate stareCccurencet hd gt Al f RUC OC ee eT 5 ISR et imer gee 2 7 W 2 26 42 DoclD16139 Rev 5 AN3029 STM8 software toolchain 9 1 Integrated development environment The integrated development environment ST Vi
27. nput for the ADC unit on the Vggr pin This gives better accuracy on low voltage input as follows e The Vggr pin can be connected to the Vppa external power supply If a separate external reference voltage is applied on Vgge a 100 nF and a 1 pF capacitor must be connected on this pin To compensate for peak consumption on Vpep the 1 uF capacitor may be increased to 10 uF when the sampling speed is low In all cases Vrer must be kept between 2 4 V and Vppa If Vppa is below 2 4 Veer must be equal to Vpp This input is internally bonded to Vppa in the devices that have no internal Vggr pin e gt Vrer input analog reference negative The lower negative reference voltage is internally bonded to Vasa Analog input The devices include up to 28 analog input channels including four fast channels each multiplexed with an I O which are converted by the ADC one at a time The external input impedance Raj max value is 50 kQ The four fast channels can convert at maximum speed 1 MHz if RAIN is less than 0 5 KQ Please refer to Figure 3 Figure 3 Analog input interface VDD VT Sample and hold IN ADC converter RAIN 0 6 V ANY RADC 12 bit y converter T A as Cparasitic ney li Canc 777 777 MS32530V1 Please refer to the applicable datasheets and reference manuals for more details DoclD16139 Rev 5 9 42 Clock mana
28. nt STM8 VDD IO RPU External reset circuit QUT TUR NRST E I La gt Filter v System reset S B5 E s ma Illegal op code reset PROMUS IWDG WWDG software reset id s Swim reset min 201S POR BOR reset VILLA Delay ai14866d DoclD16139 Rev 5 2 AN3029 Reset control 5 1 1 Output characteristics A valid pulse on the pin is guaranteed with a gt 20 ns pulse duration on the internal output buffer After a valid pulse is recognized a pulse on the pin of at least 20 us is guaranteed starting from the falling edge of A Figure 8 Output characteristics A 220n lt gt 1 y gt A A P a 20 us pulse stretch min gt Pad Reset requested MS32525V1 5 1 2 Input characteristics All pulses with a duration less than 50 ns are filtered All train burst spikes with a ratio of 1 10 must be filtered This means that a negative spike of up to 50 ns is always filtered when a 5 ns interval between spikes occurs ratio 1 10 All pulses with duration more than 300 ns are recognized as valid pulses Figure 9 Input characteristics A gt 5 ns gt 5 ns 300 ns X a i lt 50 ns lt 50ns X 50ns i diis A A A Negative train of glitch filtered Valid Reset requested gt System reset MS32526V1 2 DoclD16139 Rev
29. nt list updated comment information for ID number 2 battery added ID number 5 ceramic capacitor Figure 10 added external reset circuit and note 1 Section 9 2 Compiler updated 16 Kbytes with 32 Kbytes of generated code Section 9 3 Firmware library updated text explaining the workspace and project definition files Section 10 Setting up the STM8 development environment removed introductory text Section 10 2 Using the tools added EWSTMB8 Figure 1 updated figure content and footnotes Section 2 1 Power supply overview updated bullet points Section 3 1 Analog power updated bullet point concerning Vggr Section 6 4 Decoupling updated value of the pool capacitor to 1 uF instead of 100 uF Figure 10 updated figure content and footnotes Section 8 STM8 development tools updated bullet point 5 regarding STM8L101 EVAL Section 9 1 Integrated development environment added the low cost ST Link tool in the list of hardware tools supported by STVD 07 Mar 2011 3 2 40 42 DoclD16139 Rev 5 AN3029 Revision history Table 4 Document revision history continued Date Revision Changes Document updated to include the STM8AL products Added Table 1 Applicable products 06 Nov 2012 4 iii Added note to Table 2 Component list Updated references in Section 8 STM8 development tools Updated 23 Jul 2013 5 Section 2 1 Power supply overview Sec
30. p eee ead GP AUS E RR 15 Reference design 0 2 0 cee eee ete eee ees 20 Debug system block diagram 2 2 tees 21 Hardware connection ooo 22 Connection descripti0N oooooooooooo le 23 STice in emulation configuration 0 II 24 In circuit programming and debugging 2 0 cee eee 25 STM8 software toolchain 200s 26 STVD open example workspace sss 29 STVD MCU edit mode oooocccccc tenes 30 STM8 firmware library online help manual ssseee RS 31 STVD Building the project 0 0 2 RR IR 32 STVD Selecting the debug instrument 33 Connecting the debug instrument to the STM8L101 EVAL evaluation board 34 Connecting the debug instrument to the STM8L152x EVAL evaluation board 35 STVD Starting the debug session 000 eee ee 36 STVD Run the software 0 000000 eee eee 37 STMB8 evaluation board 00 0 cece eee 38 DoclD16139 Rev 5 5 42 Hardware requirements summary AN3029 2 1 6 42 Hardware requirements summary To build an application around an STM8L or STM8AL device the application board should provide the following features e Power supply mandatory e Clock management optional e Reset management optional e Debugging tool support Single wire interface module SWIM connector optional Power supply Power supply overview The STM8L or STM8AL can be supplied through a 1 65 V to 3 6 V
31. pply AN3029 2 3 8 42 Power on power down reset POR PDR The input supply to the main and low power regulators is monitored by a power on power down reset circuit The monitoring voltage begins at 0 7 V During power on the POR PDR keeps the device under reset until the supply voltages Vpp and Vppa reach their specified working area Maximum power on time typpimax must be respected as the internal reset provided for supply stabilization is maintained for 1 ms At power on a defined reset should be maintained below 0 7 V The upper threshold for a reset release is defined in the electrical characteristics section of the product datasheets A hysteresis is implemented POR PDR to ensure clean detection of voltage rise and fall The POR PDR also generates a reset when the supply voltage drops below the Vppr threshold isolated and repetitive events Correct device reset during power on sequence is guaranteed when typpimax is respected It is recommended to use an internal BOR or an external reset circuit especially for STM8L101xx devices to ensure correct device reset during power down when Vppg lt Vpp lt Vpp min For better power monitoring the STM8L15xxx STM8L162xx STM8AL31xx and STM8AL3Lxx provide a brown out reset BOR and programmable power voltage detection PVD for an earlier detection of voltage drop Recommendations All pins need to be properly connected to the power supplies These connection
32. rom Cosmic Raisonance or IAR e ST toolset and STM8 firmware library from STMicroelectronics STM8L101xx standard peripheral library STM8L05x STM8L15x STM8L16x STM8AL31x STM8AL3Lx standard peripheral library STM8 evaluation board from STMicroelectronics STM8L101 EVAL for STM8L101xx STM8L1526 EVAL for medium density STM8L15xxx and STM8AL31xx STM8AL3Lxx and STM8L1528 EVAL for high density STM8L15xxx STM8L162xx e fyouuse STM8L101 EVAL you also need the HW SWIM debug interface Rlink from Raisonance and ST Link or STice SWIM The debug interface ST LINK is included in STM8L1526 EVAL and STM8L1528 EVAL e STM8L DISCOVERY Single wire interface module SWIM SWIM overview In circuit debugging mode or in circuit programming mode are managed through a single wire hardware interface based on an open drain line featuring ultra fast memory programming Coupled with an in circuit debugging module the SWIM also offers a non intrusive read write to RAM and peripherals This makes the in circuit debugger extremely powerful and close in performance to a full featured emulator The SWIM pin can be used as a standard I O with 8 mA capability which has some restrictions if the user wants to use it for debugging The most secure way to use it is to provide a strap option on the PCB Please refer to the STM8 SWIM communication protocol and debug module user manual UM0470 for more SWIM protocol details Figure 11 Debug system block diagram
33. s including pads tracks and vias should have the lowest possible impedance This is typically achieved with thick track widths and preferably dedicated power supply planes in multi layer printed circuit boards PCBs In addition each power supply pair should be decoupled with filtering ceramic capacitors C at 100 nF with one chemical C 1 2 UF in parallel on the STM8L STM8AL devices The ceramic capacitors should be placed as close as possible to the appropriate pins or below the appropriate pins on the opposite side of the PCB Typical values are 10 nF to 100 nF but exact values depend on the application needs Figure 2 shows the typical layout of such a Vpp Vss pair Figure 2 Typical layout of Vpp Vss pair Via to Vpp Via to Vss STM8 MS32523V1 DoclD16139 Rev 5 Ly AN3029 Analog to digital converter ADC 3 3 1 3 2 2 Analog to digital converter ADC This section does not apply to STM8L101xx devices Analog power For some packages the ADC unit has an independent analog supply voltage isolated on input pin VppA which allows the ADC to accept a very clean voltage source This analog voltage Vopa should be identical to the digital voltage supply on pin Vpp To filter some noise a ferrite bead can be added between Vpp and Vppa This ferrite bead should be chosen according to the frequencies to be filtered Some packages also provide a separate external analog reference voltage i
34. sion of the C compiler with up to 32 Kbytes of generated code is available at www cosmic software com and www raisonance com 9 3 Firmware library 2 The STM8 firmware library is a complete set of source code examples for each STM8 peripheral It is written in strict ANSI C and it is fully MISRA C 2004 compliant All examples can be used with four workspace and project definition files one for STVD and Cosmic C compiler one for STVD and raisonance Compiler one for Raisonance integrated debugging environment and compiler RIDE7 IDE and one for IAR embedded workbench for STM8 EWSTM8 This enables the user to load and compile them easily into their preferred development environment The examples run on the STMicroelectronics STM8L evaluation board and can be tailored easily to other types of hardware For additional information and download of the STM8L STMB8AL firmware library connect to www st com mcu DoclD16139 Rev 5 27 42 Setting up the STM8 development environment AN3029 10 10 1 28 42 Setting up the STM8 development environment Installing the tools All software tools are delivered with a setup wizard which guides the user through the installation process It is recommended to install the tools in the following order 1 C compiler 2 ST toolset 3 STMS firmware library ST LINK does not need any dedicated software installation in the STM8 development environment because the necessary drivers are deliver
35. stal type and frequency Refer to the datasheet of the crystal manufacturer to select the capacitances For best oscillation stability Cj 4 and C 2 normally have the same value Typical values are in the range from below 20 pF up to 40 pF cload 10 to 20 pF The parasitic capacitance of the board layout also needs to be considered and typically adds a few pF to the component values refer to AN2867 A clock security system prevents any CPU fatal error from a HSE failure as it safely switches to HSI DoclD16139 Rev 5 Clock management AN3029 4 3 2 12 42 Recommendations In the PCB layout all connections should be as short as possible Any additional signals especially those that could interfere with the oscillator should be locally separated from the PCB area around the oscillation circuit using suitable shielding LSE clock The low speed external clock signal LSE can be generated from two possible clock sources e LSE external crystal ceramic resonator see Figure 6 e LSE user external clock see Figure 6 External source LSE bypass In this mode an external clock source must be provided It must have a frequency of 32 768 kHz The external clock signal Square sine or triangle with a duty cycle of about 50 has to drive the OSC32 IN pin while the OSC32 OUT pin must be left high impedance see Figure 5 and Figure 6 Figure 5 External clock Microcontroller OSC32 IN OSC32 OUT Hi Z Exter
36. sual Develop STVD provides an easy to use efficient environment for start to finish control of application development from building and debugging the application code to programming the microcontroller STVD is delivered as part of the free ST toolset which also includes the ST Visual Programmer STVP programming interface and ST Assembler Linker To build applications STVD provides seamless integration of C and assembly tool chains for ST including the Cosmic and Raisonance C compilers and ST Assembler Linker When debugging STVD provides an integrated simulator software and supports a complete range of hardware tools including the low cost RLink in circuit debugger programmer the high end STice emulator and the low cost ST LINK tool To program applications to an STM8L STMBAL the STVD also provides an interface for reading from the microcontroller memories writing to them and verifying them This interface is based on the ST Visual Programmer STVP and supports all the target devices and programming tools supported by STVP The free ST toolset for STM8 is available from STMicroelectronics homepage see www st com 9 2 Compiler STM8L STM8AL devices can be programmed by a free assembler toolchain which is included in the ST toolset As the core is designed for optimized high level language support use of a C compiler is recommended C compilers for STM8 are offered by the third party companies Cosmic Raisonance and IAR A free ver
37. the chosen demonstration firmware package To run the demonstration software on the STM8 evaluation board the project has to be compiled and the correct HW tool must be selected before the debug session can be started Compiling the project The project can be compiled using the Build function in the Build menu see Figure 20 Figure 20 STVD Building the project 1 ST Visual Develop project stw main c C5 File Edit View Project Build Debug Debug instrument Tools Window uso 83 Compile main c Ctrl F7 Raa Build Workspace kas Rebuild All es project stw E i Batch Build project Source Files Clean Include Files External Depen Configurations 1n gt E TERRE Bfil Bbri Baut Aver Adat FERRERS DoclD16139 Rev 5 2 AN3029 Setting up the STM8 development environment 10 3 2 2 Selecting the correct debug instrument In the example below the Rlink tool is used for communicating via the SWIM interface with the on board debug module of the STM8 The Rlink tool can be selected from the Debug Instrument Selection list in the Debug Instrument Settings dialog see Figure 21 Figure 21 STVD Selecting the debug instrument Debug Instrument Settings Target Debug Instrument Selection Select the Target you want to use for debug session Swim Rlink X Target Port Selection Select the connection port for usb usb
38. tion 2 3 Power on power down reset POR PDR 2 DoclD16139 Rev 5 41 42 AN3029 Please Read Carefully Information in this document is provided solely in connection with ST products STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections modifications or improvements to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted under this document If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTI
39. tion previously supplied The ST logo is a registered trademark of STMicroelectronics All other names are the property of their respective owners 2013 STMicroelectronics All rights reserved STMicroelectronics group of companies Australia Belgium Brazil Canada China Czech Republic Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Philippines Singapore Spain Sweden Switzerland United Kingdom United States of America www st com 42 42 DoclD16139 Rev 5 Ly
40. tor 10 uF 1 Ceramic capacitor decoupling capacitor 6 Crystal 1to 16 MHz 1 7 Capacitor 20 to 40 pF 2 Used for crystal Crystal 32 kHz 1 8 Capacitor 5 to 20 pF 2 Used for crystal Ferrite bead Depends on noise to be filtered 9 SWIMconnector 4 pins 1 1 1 8 V to 3 6 V for STM8LO5xxx 2 DoclD16139 Rev 5 19 42 Reference design AN3029 7 2 Schematics Figure 10 Reference design Only if internal booster is used to To power LCD power LCD specifically If LCD is unused pid s gt 1uF JOR OR Vss For noisy _ External reset circuit environment i ar 3 T O b S 1 o as c e oo t P Only if accurate High Speed US mad Oscillator is needed 100nF Ll Ves N Biggest package Vos see note 3 Only if accurate low speed oscillator is needed ai18711b If these components are removed they have to be replaced by a short connection 2 Optional if a separate external reference voltage is connected on Vggr the two capacitors 100 nF and 1 pF must be connected Vref is either connected to VppA or VREF 3 One 100 nF Ceramic capacitor for each VDDx pin and one single 1 uF Tantalum or Ceramic capacitor 2 20 42 DoclD16139 Rev 5 AN3029 STM8 development tools 8 8 1 2 STM8 development tools Typically the following tools are needed to get started e STVD for integrated development environment e STM8C compiler f
41. tune the Rgxr value refer to AN2867 Oscillator design guide for ST microcontrollers 2 DoclD16139 Rev 5 13 42 Reset control AN3029 5 5 1 14 42 Reset control Reset management overview The reset pin is a 3 3 V bidirectional I O After startup it can be programmed by software to be used as a general purpose I O Its output buffer driving capability is fixed to loly n 2 mA 0 45 V in the 1 8 V to 3 6 V range which includes a 45 k pull up Output buffer is reduced to the n channel MOSFET NMOS The receiver includes a glitch filter whereas the output buffer includes a 20 us delay There are many reset sources including e External reset through the NRST pin e Power on reset POR and brown out reset BOR During power on the POR keeps the device under reset until the supply voltage Vpp and Vppx reach the voltage level at which level the BOR starts to function STM8L101xx devices have only a POR e Independent watchdog reset IWDG e Window watchdog reset WWDG featuring also software reset only for STM8LO05xx STM8L15xxx STM8L162xx STM8AL31xx and STM8AL3Lxx e SWIM reset An external device connected to the SWIM interface can request the SWIM block to generate a microcontroller reset e llegal opcode reset If a code to be executed does not correspond to any opcode or prebyte value a reset is generated Figure 7 shows a simplified functional I O reset schematic Figure 7 Reset manageme
Download Pdf Manuals
Related Search
Related Contents
DinionXF – LTC 0510 & LTC 0385 series cameras Delta 28-195 Instruction manual Edge Diving System installation manual - Inter-Fab 角柱ガビオス Untitled 取扱説明書 - SANUS Inversor - Manual Del Usuario Istruzioni per l`uso Philips 19S4LAB User Guide Manual Samsung AVXWNH032CE Manual de Usuario Copyright © All rights reserved.
Failed to retrieve file