|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
stm8s003k3 stm8S003F3 v alue line, 16 mhz stm8s 8-bit mcu, 8 kbytes flash, 128 bytes data eeprom, 10-bit adc, 3 timers, uar t , spi, i2c features core ? 16 mhz advanced stm8 core with harvard architecture and 3-stage pipeline ? extended instruction set memories ? program memory: 8 kbytes flash; data retention 20 years at 55 c after 100 cycles ? ram: 1 kbytes ? data memory: 128 bytes of true data eeprom; endurance up to 100 000 write/erase cycles clock, reset and supply management ? 2.95 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-of f peripheral clocks individually ? permanently active, low consumption power-on and power-down reset interrupt management ? nested interrupt controller with 32 interrupts ? up to 27 external interrupts on 6 vectors t imers ? 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 wake-up timer ? window watchdog and independent watchdog timers communications interfaces ? uar t with clock output for synchronous operation, smartcard, irda, lin master mode ? spi interface up to 8 mbit/s ? i 2 c interface up to 400 kbit/s analog to digital converter (adc) ? 10-bit, 1 lsb adc with up to 5 multiplexed channels, scan mode and analog watchdog i/os ? up to 28 i/os on a 32-pin package including 21 high sink outputs ? highly robust i/o design, immune against current injection development support ? embedded single wire interface module (swim) for fast on-chip programming and non intrusive debugging 1 / 100 docid018576 rev 3 june 2012 www .st.com lqfp32 7x7 tssop20 ufqfpn20 3x3 free datasheet http:///
contents 1 introduction .............................................................................................................. 7 2 description ............................................................................................................... 8 3 block diagram .......................................................................................................... 9 4 product overview ................................................................................................... 10 4.1 central processing unit stm8 ..................................................................................... 10 4.2 single wire interface module (swim) and debug module (dm) .................................. 10 4.3 interrupt controller ....................................................................................................... 11 4.4 flash program memory and data eeprom ................................................................ 11 4.5 clock controller ............................................................................................................ 12 4.6 power management .................................................................................................... 13 4.7 w atchdog timers .......................................................................................................... 13 4.8 auto wakeup counter ................................................................................................... 14 4.9 beeper ........................................................................................................................ 14 4.10 tim1 - 16-bit advanced control timer ......................................................................... 14 4.1 1 tim2 - 16-bit general purpose timer .......................................................................... 15 4.12 tim4 - 8-bit basic timer .............................................................................................. 15 4.13 analog-to-digital converter (adc1) ............................................................................ 15 4.14 communication interfaces ......................................................................................... 16 4.14.1 uar t1 ............................................................................................... 16 4.14.2 spi ..................................................................................................... 17 4.14.3 i2c ...................................................................................................... 17 5 pinout and pin description ................................................................................... 18 5.1 stm8s003k3 lqfp32 pinout and pin description ...................................................... 18 5.2 stm8S003F3 tssop20/ufqfpn20 pinout and pin description ............................... 21 5.2.1 stm8S003F3 tssop20 pinout and pin description ............................ 21 5.2.2 stm8S003F3 ufqfpn20 pinout ........................................................ 22 5.2.3 stm8S003F3 tssop20/ufqfpn20 pin description .......................... 22 5.3 alternate function remapping ....................................................................................... 24 6 memory and register map ..................................................................................... 25 6.1 memory map ................................................................................................................ 25 6.2 register map ............................................................................................................... 26 6.2.1 i/o port hardware register map ............................................................ 26 6.2.2 general hardware register map .......................................................... 27 6.2.3 cpu/swim/debug module/interrupt controller registers ..................... 36 7 interrupt vector mapping ...................................................................................... 39 8 option bytes ........................................................................................................... 41 8.1 alternate function remapping bits ................................................................................ 43 docid018576 rev 3 2 / 100 stm8s003k3 stm8S003F3 contents 9 electrical characteristics ...................................................................................... 46 9.1 parameter conditions ................................................................................................... 46 9.1.1 minimum and maximum values ........................................................... 46 9.1.2 t ypical values ....................................................................................... 46 9.1.3 t ypical curves ...................................................................................... 46 9.1.4 loading capacitor ................................................................................. 46 9.1.5 pin input voltage ................................................................................... 46 9.2 absolute maximum ratings .......................................................................................... 47 9.3 operating conditions .................................................................................................... 49 9.3.1 vcap external capacitor ...................................................................... 50 9.3.2 supply current characteristics .............................................................. 51 9.3.3 external clock sources and timing characteristics ............................... 60 9.3.4 internal clock sources and timing characteristics ................................. 62 9.3.5 memory characteristics ........................................................................ 64 9.3.6 i/o port pin characteristics ................................................................... 66 9.3.7 reset pin characteristics ...................................................................... 74 9.3.8 spi serial peripheral interface .............................................................. 77 9.3.9 i 2 c interface characteristics ................................................................. 80 9.3.10 10-bit adc characteristics .................................................................. 81 9.3.1 1 emc characteristics ........................................................................... 85 10 package information ........................................................................................... 89 10.1 32-pin lqfp package mechanical data .................................................................... 89 10.2 20-pin tssop package mechanical data .................................................................. 90 10.3 20-lead ufqfpn package mechanical data ............................................................. 92 1 1 thermal characteristics ....................................................................................... 94 1 1.1 reference document ................................................................................................. 94 1 1.2 selecting the product temperature range .................................................................. 94 12 ordering information ........................................................................................... 96 13 stm8 development tools .................................................................................... 97 13.1 emulation and in-circuit debugging tools ................................................................... 97 13.2 software tools ............................................................................................................ 97 13.2.1 stm8 toolset ...................................................................................... 98 13.2.2 c and assembly toolchains ................................................................ 98 13.3 programming tools .................................................................................................... 98 14 revision history ................................................................................................... 99 3 / 100 docid018576 rev 3 contents stm8s003k3 stm8S003F3 list of tables t able 1. stm8s003xx value line features ................................................................................................ 8 t able 2. peripheral clock gating bit assignments in clk_pckenr1/2 registers .................................. 13 t able 3. tim timer features .................................................................................................................... 15 t able 4. legend/abbreviations for pinout tables ................................................................................... 18 t able 5. lqfp32 pin description ............................................................................................................ 19 t able 6. stm8S003F3 pin description ................................................................................................... 22 t able 7. i/o port hardware register map ................................................................................................ 26 t able 8. general hardware register map ............................................................................................... 27 t able 9. cpu/swim/debug module/interrupt controller registers ......................................................... 36 t able 10. interrupt mapping ................................................................................................................... 39 t able 1 1. option bytes ........................................................................................................................... 99 t able 12. option byte description ........................................................................................................... 41 t able 13. stm8s003k3 alternate function remapping bits for 32-pin devices ...................................... 43 t able 14. stm8S003F3 alternate function remapping bits for 20-pin devices ...................................... 44 t able 15. v oltage characteristics ........................................................................................................... 47 t able 16. current characteristics ........................................................................................................... 47 t able 17. thermal characteristics .......................................................................................................... 48 t able 18. general operating conditions ................................................................................................. 49 t able 19. operating conditions at power-up/power-down ...................................................................... 50 t able 20. t otal current consumption with code execution in run mode at v dd = 5 v ............................. 51 t able 21. t otal current consumption with code execution in run mode at v dd = 3.3 v .......................... 52 t able 22. t otal current consumption in wait mode at v dd = 5 v ............................................................ 53 t able 23. t otal current consumption in wait mode at v dd = 3.3 v ......................................................... 53 t able 24. t otal current consumption in active halt mode at v dd = 5 v .................................................. 54 t able 25. t otal current consumption in active halt mode at v dd = 3.3 v ............................................... 54 t able 26. t otal current consumption in halt mode at v dd = 5 v ............................................................. 55 t able 27. t otal current consumption in halt mode at v dd = 3.3 v .......................................................... 55 t able 28. w akeup times ......................................................................................................................... 56 t able 29. t otal current consumption and timing in forced reset state .................................................... 57 t able 30. peripheral current consumption ............................................................................................. 57 t able 31. hse user external clock characteristics ................................................................................. 60 t able 32. hse oscillator characteristics ................................................................................................. 61 t able 33. hsi oscillator characteristics .................................................................................................. 62 t able 34. lsi oscillator characteristics ................................................................................................... 64 t able 35. ram and hardware registers .................................................................................................. 64 t able 36. flash program memory and data eeprom ........................................................................... 65 t able 37. i/o static characteristics ......................................................................................................... 66 t able 38. output driving current (standard ports) .................................................................................. 68 t able 39. output driving current (true open drain ports) ........................................................................ 68 t able 40. output driving current (high sink ports) .................................................................................. 69 t able 41. nrst pin characteristics ........................................................................................................ 74 t able 42. spi characteristics .................................................................................................................. 78 t able 43. i 2 c characteristics .................................................................................................................. 80 t able 44. adc characteristics ................................................................................................................ 82 t able 45. adc accuracy with r ain < 10 k , v dd = 5 v ......................................................................... 82 t able 46. adc accuracy with r ain < 10 k r ain , v dd = 3.3 v .............................................................. 83 t able 47. ems data ................................................................................................................................ 86 docid018576 rev 3 4 / 100 stm8s003k3 stm8S003F3 list of tables t able 48. emi data ................................................................................................................................. 86 t able 49. esd absolute maximum ratings ............................................................................................. 87 t able 50. electrical sensitivities ............................................................................................................. 88 t able 51. 32-pin low profile quad flat package mechanical data ............................................................ 89 t able 52. 20-pin, 4.40 mm body , 0.65 mm pitch mechanical data ......................................................... 91 t able 53. 20-lead ultra thin fine pitch quad flat no-lead package (3x3) mechanical data ...................... 92 t able 54. thermal characteristics .......................................................................................................... 94 t able 55. document revision history ...................................................................................................... 99 5 / 100 docid018576 rev 3 list of tables stm8s003k3 stm8S003F3 list of figures figure 1. block diagram ........................................................................................................................... 9 figure 2. flash memory organization .................................................................................................... 12 figure 3. stm8s003k3 lqfp32 pinout ................................................................................................ 18 figure 4. stm8S003F3 tssop20 pinout .............................................................................................. 21 figure 5. stm8S003F3 ufqfpn20-pin pinout ..................................................................................... 22 figure 6. memory map ........................................................................................................................... 25 figure 7. pin loading conditions ............................................................................................................. 46 figure 8. pin input voltage ..................................................................................................................... 47 figure 9. f cpumax versus v dd ................................................................................................................ 50 figure 10. external capacitor c ext ....................................................................................................... 50 figure 1 1. t yp i dd(run) vs. v dd hse user external clock, f cpu = 16 mhz ............................................. 58 figure 12. t yp i dd(run) vs. f cpu hse user external clock, v dd = 5 v .................................................... 58 figure 13. t yp i dd(run) vs. v dd hsi rc osc, f cpu = 16 mhz ................................................................. 59 figure 14. t yp i dd(wfi) vs. v dd hse user external clock, f cpu = 16 mhz .............................................. 59 figure 15. t yp i dd(wfi) vs. f cpu hse user external clock, v dd = 5 v ..................................................... 60 figure 16. t yp i dd(wfi) vs. v dd hsi rc osc, f cpu = 16 mhz ................................................................. 60 figure 17. hse external clock source .................................................................................................... 61 figure 18. hse oscillator circuit diagram ............................................................................................... 62 figure 19. t ypical hsi frequency variation vs v dd @ 4 temperatures .................................................. 63 figure 20. t ypical lsi frequency variation vs v dd @ 4 temperatures ................................................... 64 figure 21. t ypical v il and v ih vs v dd @ 4 temperatures ...................................................................... 67 figure 22. t ypical pull-up resistance vs v dd @ 4 temperatures ............................................................ 67 figure 23. t ypical pull-up current vs v dd @ 4 temperatures ................................................................. 68 figure 24. t yp. v ol @ v dd = 5 v (standard ports) ................................................................................ 70 figure 25. t yp. v ol @ v dd = 3.3 v (standard ports) ............................................................................. 70 figure 26. t yp. v ol @ v dd = 5 v (true open drain ports) ...................................................................... 71 figure 27. t yp. v ol @ v dd = 3.3 v (true open drain ports) ................................................................... 71 figure 28. t yp. v ol @ v dd = 5 v (high sink ports) ................................................................................ 72 figure 29. t yp. v ol @ v dd = 3.3 v (high sink ports) ............................................................................. 72 figure 30. t yp. v dd - v oh @ v dd = 5 v (standard ports) ....................................................................... 73 figure 31. t yp. v dd - v oh @ v dd = 3.3 v (standard ports) ................................................................... 73 figure 32. t yp. v dd - v oh @ v dd = 5 v (high sink ports) ....................................................................... 74 figure 33. t yp. v dd - v oh @ v dd = 3.3 v (high sink ports) .................................................................... 74 figure 34. t ypical nrst v il and v ih vs v dd @ 4 temperatures ........................................................... 76 figure 35. t ypical nrst pull-up resistance vs v dd @ 4 temperatures ................................................. 76 figure 36. t ypical nrst pull-up current vs v dd @ 4 temperatures ...................................................... 77 figure 37. recommended reset pin protection ...................................................................................... 77 figure 38. spi timing diagram - slave mode and cpha = 0 .................................................................. 79 figure 39. spi timing diagram - slave mode and cpha = 1 .................................................................. 79 figure 40. spi timing diagram - master mode (1) ................................................................................... 80 figure 41. t ypical application with i 2 c bus and timing diagram ............................................................ 84 figure 42. adc accuracy characteristics ............................................................................................... 84 figure 43. t ypical application with adc ................................................................................................ 85 figure 44. 32-pin low profile quad flat package (7 x 7) .......................................................................... 89 figure 45. 20-pin, 4.40 mm body , 0.65 mm pitch ................................................................................... 90 figure 46. 20-lead ultra thin fine pitch quad flat no-lead package outline (3x3) .................................... 92 figure 47. stm8s003x value line ordering information scheme ........................................................... 96 docid018576 rev 3 6 / 100 stm8s003k3 stm8S003F3 list of figures introduction 1 this datasheet contains the description of the device features, pinout, electrical characteristics, mechanical data and ordering information. ? for complete information on the stm8s microcontroller memory , registers and peripherals, please refer to the stm8s microcontroller family reference manual (rm0016). ? for information on programming, erasing and protection of the internal flash memory please refer to the stm8s flash programming manual (pm0051). ? for information on the debug and swim (single wire interface module) refer to the stm8 swim communication protocol and debug module user manual (um0470). ? for information on the stm8 core, please refer to the stm8 cpu programming manual (pm0044). 7 / 100 docid018576 rev 3 introduction stm8s003k3 stm8S003F3 description 2 the stm8s003x value line 8-bit microcontrollers feature 8 kbytes flash program memory , plus integrated true data eeprom. the stm8s microcontroller family reference manual (rm0016) refers to devices in this family as low-density . they provide the following benefits: performance, robustness, and reduced system cost. device performance and robustness are ensured by integrated true data eeprom supporting up to 100000 write/erase cycles, advanced core and peripherals made in a state-of-the art technology , a 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 high system integration level with internal clock oscillators, watchdog and brown-out reset. full documentation is of fered as well as a wide choice of development tools. t able 1: stm8s003xx value line features stm8S003F3 stm8s003k3 device 20 32 pin count 16 28 maximum number of gpios (i/os) 16 27 ext. interrupt pins 7 7 t imer capcom channels 2 3 t imer complementary outputs 5 4 a/d converter channels 12 21 high sink i/os 8k 8k low density flash program memory (bytes) 1k 1k ram (bytes) 128 (1) 128 (1) t rue data eeprom (bytes) multipurpose timer (tim1), spi, i 2 c, uar t window wdg,independent wdg, adc, pwm timer (tim2), 8-bit timer (tim4) peripheral set (1) without read-while-write capability . docid018576 rev 3 8 / 100 stm8s003k3 stm8S003F3 description block diagram 3 figure 1: block diagram 9 / 100 docid018576 rev 3 block diagram stm8s003k3 stm8S003F3 xt al 1-16 mhz rc int. 16 mhz rc int. 128 khz stm8 core deb ug/swim spi u ar t1 16-bit gener al pur pose a wu timer reset b loc k reset por bor cloc k controller detector cloc k to per ipher als and core 8 mbit/s lin master address and data b us windo w wdg 8-kb yte 1-kb yte adc1 4 capcom reset 400 kbit/s single wire deb ug interf . spi em ul. channels +3 prog r am flash 16-bit adv anced control timer (tim1) 8-bit basic timer ram up to beeper 1/2/4 khz beep independent wdg (tim4) 3 capcom channels up to complementar y outputs timer (tim2) up to 5 channels i 2 c 128-b yte data eepr om product overview 4 the following section intends to give an overview of the basic features of the device functional modules and peripherals. for more detailed information please refer to the corresponding family reference manual (rm0016). central processing unit stm8 4.1 the 8-bit stm8 core is designed for code ef ficiency and performance. it contains 6 internal registers which are directly addressable in each execution context, 20 addressing modes including indexed indirect and relative addressing and 80 instructions. architecture and registers ? harvard architecture ? 3-stage pipeline ? 32-bit wide program memory bus - single cycle fetching for most instructions ? x and y 16-bit index registers - enabling indexed addressing modes with or without of fset and read-modify-write type data manipulations ? 8-bit accumulator ? 24-bit program counter - 16-mbyte linear memory space ? 16-bit stack pointer - access to a 64 k-level stack ? 8-bit condition code register - 7 condition flags for the result of the last instruction addressing ? 20 addressing modes ? indexed indirect addressing mode for look-up tables located anywhere in the address space ? stack pointer relative addressing mode for local variables and parameter passing instruction set ? 80 instructions with 2-byte average instruction size ? standard data movement and logic/arithmetic functions ? 8-bit by 8-bit multiplication ? 16-bit by 8-bit and 16-bit by 16-bit division ? bit manipulation ? data transfer between stack and accumulator (push/pop) with direct stack access ? data transfer using the x and y registers or direct memory-to-memory transfers single wire interface module (swim) and debug module (dm) 4.2 the single wire interface module and debug module permits non-intrusive, real-time in-circuit debugging and fast memory programming. docid018576 rev 3 10 / 100 stm8s003k3 stm8S003F3 product overview swim single wire interface module for direct access to the debug module and memory programming. the interface can be activated in all device operation modes. the maximum data transmission speed is 145 bytes/ms. debug module the non-intrusive debugging module features a performance close to a full-featured emulator . beside memory and peripherals, also cpu operation can be monitored in real-time by means of shadow registers. ? r/w to ram and peripheral registers in real-time ? r/w access to all resources by stalling the cpu ? breakpoints on all program-memory instructions (software breakpoints) ? t wo advanced breakpoints, 23 predefined configurations interrupt controller 4.3 ? nested interrupts with three software priority levels ? 32 interrupt vectors with hardware priority ? up to 27 external interrupts on 6 vectors including tli ? t rap and reset interrupts flash program memory and data eeprom 4.4 ? 8 kbytes of flash program single voltage flash memory ? 128 bytes of true data eeprom ? user option byte area w rite protection (wp) w rite protection of flash program memory and data eeprom is provided to avoid unintentional overwriting of memory that could result from a user software malfunction. there are two levels of write protection. the first level is known as mass (memory access security system). mass is always enabled and protects the main flash program memory , the data eeprom, and the option bytes. t o perform in-application programming (iap), this write protection can be removed by writing a mass key sequence in a control register . this allows the application to modify the content of the main program memory and data eeprom, or to reprogram the device option bytes. a second level of write protection, can be enabled to further protect a specific area of memory known as ubc (user boot code). refer to the figure below . the size of the ubc is programmable through the ubc option byte, in increments of 1 page (64-byte block) by programming the ubc option byte in icp mode. this divides the program memory into two areas: ? main program memory: 8 kbytes minus ubc ? user-specific boot code (ubc): configurable up to 8 kbytes the ubc area remains write-protected during in-application programming. this means that the mass keys do not unlock the ubc area. it protects the memory used to store the boot 1 1 / 100 docid018576 rev 3 product overview stm8s003k3 stm8S003F3 program, specific code libraries, reset and interrupt vectors, the reset routine and usually the iap and communication routines. figure 2: flash memory organization read-out protection (rop) the read-out protection blocks reading and writing from/to the flash program memory and the data eeprom in icp mode (and debug mode). once the read-out protection is activated, any attempt to toggle its status triggers a global erase of the program memory . even if no protection can be considered as totally unbreakable, the feature provides a very high level of protection for a general purpose microcontroller . clock controller 4.5 the clock controller distributes the system clock (f master ) coming from dif ferent oscillators to the core and the peripherals. it also manages clock gating for low power modes and ensures clock robustness. features ? clock prescaler: t o get the best compromise between speed and current consumption the clock frequency to the cpu and peripherals can be adjusted by a programmable prescaler . ? safe clock switching: clock sources can be changed safely on the fly in run mode through a configuration register . the clock signal is not switched until the new clock source is ready . the design guarantees glitch-free switching. ? clock management: t o reduce power consumption, the clock controller can stop the clock to the core, individual peripherals or memory . ? master clock sources: four dif ferent clock sources can be used to drive the master clock: - 1-16 mhz high-speed external crystal (hse) - up to 16 mhz high-speed user-external clock (hse user-ext) - 16 mhz high-speed internal rc oscillator (hsi) - 128 khz low-speed internal rc (lsi) docid018576 rev 3 12 / 100 stm8s003k3 stm8S003F3 product overview ubc area prog r am memor y area remains wr ite protected dur ing iap wr ite access possib le f or iap option b ytes prog r ammab le b ytes (1 page) up to 8 kb ytes (in 1 page steps) area from 64 ? lo w density flash prog r am memor y (8 kb ytes) data eepr om (128 b ytes) ? startup clock: after reset, the microcontroller restarts by default with an internal 2 mhz clock (hsi/8). the prescaler ratio and clock source can be changed by the application program as soon as the code execution starts. ? clock security system (css): this feature can be enabled by software. if an hse clock failure occurs, the internal rc (16 mhz/8) is automatically selected by the css and an interrupt can optionally be generated. ? configurable main clock output (cco): this outputs an external clock for use by the application. t able 2: peripheral clock gating bit assignments in clk_pckenr1/2 registers peripheral clock bit peripheral clock bit peripheral clock bit peripheral clock bit adc pcken23 reserved pcken27 uar t1 pcken13 tim1 pcken17 a wu pcken22 reserved pcken26 reserved pcken12 reserved pcken16 reserved pcken21 reserved pcken25 spi pcken1 1 tim2 pcken15 reserved pcken20 reserved pcken24 i 2 c pcken10 tim4 pcken14 power management 4.6 for ef ficent power management, the application can be put in one of four dif ferent low-power modes. y ou can configure each mode to obtain the best compromise between lowest power consumption, fastest start-up time and available wakeup sources. ? w ait mode: in this mode, the cpu is stopped, but peripherals are kept running. the wakeup is performed by an internal or external interrupt or reset. ? active halt mode with regulator on: in this mode, the cpu and peripheral clocks are stopped. an internal wakeup is generated at programmable intervals by the auto wake up unit (a wu). the main voltage regulator is kept powered on, so current consumption is higher than in active halt mode with regulator of f, but the wakeup time is faster . w akeup is triggered by the internal a wu interrupt, external interrupt or reset. ? active halt mode with regulator of f: this mode is the same as active halt with regulator on, except that the main voltage regulator is powered of f, so the wake up time is slower . ? halt mode: in this mode the microcontroller uses the least power . the cpu and peripheral clocks are stopped, the main voltage regulator is powered of f. w akeup is triggered by external event or reset. w atchdog timers 4.7 the watchdog system is based on two independent timers providing maximum security to the applications. activation of the watchdog timers is controlled by option bytes or by software. once activated, the watchdogs cannot be disabled by the user program without performing a reset. 13 / 100 docid018576 rev 3 product overview stm8s003k3 stm8S003F3 w indow watchdog timer the window watchdog is used to detect the occurrence of a software fault, usually generated by external interferences or by unexpected logical conditions, which cause the application program to abandon its normal sequence. the window function can be used to trim the watchdog behavior to match the application perfectly . the application software must refresh the counter before time-out and during a limited time window . a reset is generated in two situations: 1. t imeout: at 16 mhz cpu clock the time-out period can be adjusted between 75 s up to 64 ms. 2. refresh out of window: the downcounter is refreshed before its value is lower than the one stored in the window register . independent watchdog timer the independent watchdog peripheral can be used to resolve processor malfunctions due to hardware or software failures. it is clocked by the 128 khz lsi internal rc clock source, and thus stays active even in case of a cpu clock failure the iwdg time base spans from 60 s to 1 s. auto wakeup counter 4.8 ? used for auto wakeup from active halt mode ? clock source: internal 128 khz internal low frequency rc oscillator or external clock ? lsi clock can be internally connected to tim1 input capture channel 1 for calibration beeper 4.9 the beeper function outputs a signal on the beep pin for sound generation. the signal is in the range of 1, 2 or 4 khz. the beeper output port is only available through the alternate function remap option bit afr7. tim1 - 16-bit advanced control timer 4.10 this is a high-end timer designed for a wide range of control applications. with its complementary outputs, dead-time control and center-aligned pwm capability , the field of applications is extended to motor control, lighting and half-bridge driver ? 16-bit up, down and up/down autoreload counter with 16-bit prescaler ? four independent capture/compare channels (capcom) configurable as input capture, output compare, pwm generation (edge and center aligned mode) and single pulse mode output ? synchronization module to control the timer with external signals ? break input to force the timer outputs into a defined state ? three complementary outputs with adjustable dead time docid018576 rev 3 14 / 100 stm8s003k3 stm8S003F3 product overview ? encoder mode ? interrupt sources: 3 x input capture/output compare, 1 x overflow/update, 1 x break tim2 - 16-bit general purpose timer 4.1 1 ? 16-bit autoreload (ar) up-counter ? 15-bit prescaler adjustable to fixed power of 2 ratios 132768 ? 3 individually configurable capture/compare channels ? pwm mode ? interrupt sources: 3 x input capture/output compare, 1 x overflow/update tim4 - 8-bit basic timer 4.12 ? 8-bit autoreload, adjustable prescaler ratio to any power of 2 from 1 to 128 ? clock source: cpu clock ? interrupt source: 1 x overflow/update t able 3: tim timer features t imer synchronization/ chaining ext. trigger complem. outputs capcom channels counting mode prescaler counter size (bits) t imer no y es 3 4 up/down any integer from 1 to 65536 16 tim1 no 0 3 up any power of 2 from 1 to 32768 16 tim2 no 0 0 up any power of 2 from 1 to 128 8 tim4 analog-to-digital converter (adc1) 4.13 the stm8s003xx products contain a 10-bit successive approximation a/d converter (adc1) with up to 5 external multiplexed inputs channels and the following features: ? input voltage range: 0 to v dd ? conversion time: 14 clock cycles ? single and continuous and buf fered continuous conversion modes ? buf fer size (n x 10 bits) where n = number of input channels ? scan mode for single and continuous conversion of a sequence of channels ? analog watchdog capability with programmable upper and lower thresholds ? analog watchdog interrupt 15 / 100 docid018576 rev 3 product overview stm8s003k3 stm8S003F3 ? external trigger input ? t rigger from tim1 trgo ? end of conversion (eoc) interrupt communication interfaces 4.14 the following communication interfaces are implemented: ? uar t1: full feature uar t , synchronous mode, spi master mode, smartcard mode, irda mode, single wire mode, lin2.1 master capability ? spi : full and half-duplex, 8 mbit/s ? i2c: up to 400 kbit/s uart1 4.14.1 main features ? one mbit/s full duplex sci ? spi emulation ? high precision baud rate generator ? smartcard emulation ? irda sir encoder decoder ? lin master mode ? single wire half duplex mode asynchronous communication (uart mode) ? full duplex communication - nrz standard format (mark/space) ? programmable transmit and receive baud rates up to 1 mbit/s (f cpu /16) and capable of following any standard baud rate regardless of the input frequency ? separate enable bits for transmitter and receiver ? t wo receiver wakeup modes: - address bit (msb) - idle line (interrupt) ? t ransmission error detection with interrupt generation ? parity control synchronous communication ? full duplex synchronous transfers ? spi master operation ? 8-bit data communication ? maximum speed: 1 mbit/s at 16 mhz (f cpu /16) lin master mode ? emission: generates 13-bit synch break frame ? reception: detects 1 1-bit break frame docid018576 rev 3 16 / 100 stm8s003k3 stm8S003F3 product overview spi 4.14.2 ? maximum speed: 8 mbit/s (f master /2) both for master and slave ? full duplex synchronous transfers ? simplex synchronous transfers on two lines with a possible bidirectional data line ? master or slave operation - selectable by hardware or software ? crc calculation ? 1 byte tx and rx buf fer ? slave/master selection input pin i2c 4.14.3 ? i2c master features: - clock generation - start and stop generation ? i2c slave features: - programmable i2c address detection - stop bit detection ? generation and detection of 7-bit/10-bit addressing and general call ? supports dif ferent communication speeds: - standard speed (up to 100 khz) - fast speed (up to 400 khz) 17 / 100 docid018576 rev 3 product overview stm8s003k3 stm8S003F3 pinout and pin description 5 t able 4: legend/abbreviations for pinout tables i= input, o = output, s = power supply t ype cm = cmos input level hs = high sink output o1 = slow (up to 2 mhz) output speed o2 = fast (up to 10 mhz) o3 = fast/slow programmability with slow as default state after reset o4 = fast/slow programmability with fast as default state after reset float = floating, wpu = weak pull-up input port and control configuration t = t rue open drain, od = open drain, pp = push pull output bold x (pin state after internal reset release). reset state unless otherwise specified, the pin state is the same during the reset phase and after the internal reset release. stm8s003k3 lqfp32 pinout and pin description 5.1 figure 3: stm8s003k3 lqfp32 pinout docid018576 rev 3 18 / 100 stm8s003k3 stm8S003F3 pinout and pin description i 2 c_scl/(t) pb4 tim1_etr/ain3/(hs) pb3 tim1_ch3n/ ain2/ (hs) pb2 tim1_ch2n/ ain1/(hs) pb1 tim1_ch1n/ain0/(hs) pb0 pb7 pb6 i 2 c_sd a/ (t) pb5 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 vcap v dd [spi_nss] tim2_ch3/(hs)p a3 pf4 nrst oscin/p a1 oscout/p a2 v ss pc3 (hs) /tim1_ch3 pc2 (hs) /tim1_ch2 pc1 (hs) /tim1_ch1/ u ar t1_ck pe5 (hs) /spi_nss pc7 (hs)/spi_miso pc6 (hs)/spi_mosi pc5 (hs)/spi_sck pc4 (hs) /tim1_ch4/clk_cco pd3 (hs)/tim2_ch2/adc_etr pd2 (hs) [tim2_ch3] pd1 (hs)/swim pd0 (hs)/ tim1_bkin [clk_cco] pd7 (hs)/tli [ tim1_ch4] pd6 (hs)/u ar t1_rx pd5 (hs)/u ar t1_tx pd4 (hs)/beep/tim2_ch1 1. (hs) high sink capability . 2. (t) t rue open drain (p-buf fer and protection diode to v dd not implemented). 3. [ ] alternate function remapping option (if the same alternate function is shown twice, it indicates an exclusive choice not a duplication of the function). t able 5: lqfp32 pin description alternate function after remap [option bit] default alternate function main function (after reset) output input t ype pin name pin no. pp od speed high sink (1) ext. interrupt wpu floating reset x i/o nrst 1 resonator/ crystal in port a1 x x o1 x x x i/o p a1/ osci (2) 2 resonator/ crystal out port a2 x x o1 x x x i/o p a2/ oscout 3 digital ground s v ss 4 1.8 v regulator capacitor s vcap 5 digital power supply s v dd 6 spi master/ slave select [afr1] t imer 2 channel 3 port a3 x x o3 hs x x x i/o p a3/ tim2_ch3 [spi_nss] 7 port f4 x x o1 x x i/o pf4 8 port b7 x x o1 x x x i/o pb7 9 port b6 x x o1 x x x i/o pb6 10 i 2 c data port b5 t (3) o1 x x i/o pb5/ i 2 c_sda 1 1 i 2 c clock port b4 t (3) o1 x x i/o pb4/ i 2 c_scl 12 analog input 3/ t imer 1 external trigger port b3 x x o3 hs x x x i/o pb3/ain3/ tim1_etr 13 analog input 2/ t imer 1 - port b2 x x o3 hs x x x i/o pb2/ain2/ tim1_ch3n 14 inverted channel 3 19 / 100 docid018576 rev 3 pinout and pin description stm8s003k3 stm8S003F3 alternate function after remap [option bit] default alternate function main function (after reset) output input t ype pin name pin no. pp od speed high sink (1) ext. interrupt wpu floating analog input 1/ t imer 1 - port b1 x x o3 hs x x x i/o pb1/ain1/ tim1_ch2n 15 inverted channel 2 analog input 0/ t imer 1 - port b0 x x o3 hs x x x i/o pb0/ain0/ tim1_ch1n 16 inverted channel 1 spi master/slave select port e5 x x o3 hs x x x i/o pe5/ spi_nss 17 t imer 1 - channel 1 uar t1 clock port c1 x x o3 hs x x x i/o pc1/ tim1_ch1/ uar t1_ck 18 t imer 1 - channel 2 port c2 x x o3 hs x x x i/o pc2/ tim1_ch2 19 t imer 1 - channel 3 port c3 x x o3 hs x x x i/o pc3/ tim1_ch3 20 t imer 1 - channel 4 port c4 x x o3 hs x x x i/o pc4/ tim1_ch4/ clk_cco 21 /configurable clock output spi clock port c5 x x o3 hs x x x i/o pc5/ spi_sck 22 spi master out/slave in port c6 x x o3 hs x x x i/o pc6/ pi_mosi 23 spi master in/ slave out port c7 x x o3 hs x x x i/o pc7/ pi_miso 24 configurable clock output [afr5] t imer 1 - break input port d0 x x o3 hs x x x i/o pd0/ tim1_bkin [clk_cco] 25 swim data interface port d1 x x o4 hs x x x i/o pd1/ swim (4) 26 t imer 2 - channel 3[afr1] port d2 x x o3 hs x x x i/o pd2 [tim2_ch3] 27 docid018576 rev 3 20 / 100 stm8s003k3 stm8S003F3 pinout and pin description alternate function after remap [option bit] default alternate function main function (after reset) output input t ype pin name pin no. pp od speed high sink (1) ext. interrupt wpu floating t imer 2 - channel 2/adc external trigger port d3 x x o3 hs x x x i/o pd3/ tim2_ch2/ adc_etr 28 t imer 2 - channel 1/beep output port d4 x x o3 hs x x x i/o pd4/beep/ tim2_ch1 29 uar t1 data transmit port d5 x x o3 hs x x x i/o pd5/ uar t1_tx 30 uar t1 data receive port d6 x x o3 hs x x x i/o pd6/ uar t1_rx 31 t imer 1 - channel 4 [afr6] t op level interrupt port d7 x x o3 hs x x x i/o pd7/ tli [tim1_ch4] 32 (1) i/o pins used simultaneously for high current source/sink must be uniformly spaced around the package. in addition, the total driven current must respect the absolute maximum ratings (see electrical characteristics ). (2) when the mcu is in halt/active-halt mode, p a1 is automatically configured in input weak pull-up and cannot be used for waking up the device. in this mode, the output state of p a1 is not driven. it is recommended to use p a1 only in input mode if halt/active-halt is used in the application. (3) in the open-drain output column, "t" defines a true open-drain i/o (p-buf fer , weak pull-up, and protection diode to v dd are not implemented). (4) the pd1 pin is in input pull-up during the reset phase and after internal reset release. stm8S003F3 tssop20/ufqfpn20 pinout and pin description 5.2 stm8S003F3 tssop20 pinout and pin description 5.2.1 figure 4: stm8S003F3 tssop20 pinout 1. hs high sink capability . 21 / 100 docid018576 rev 3 pinout and pin description stm8s003k3 stm8S003F3 20 19 18 17 16 15 14 13 1 2 3 4 5 6 7 8 u ar t1_ck/tim2_ch1/beep/(hs)pd4 nrst v dd vcap v ss oscout/p a2 pd3 (hs)/ain4/tim2_ch2/adc_etr pd1(hs)/swim pb4 (t)/ i 2 c_scl [adc_etr] pc3 (hs) /tim1_ch3 [tli] [tim1_ch1n] pc4 (hs) /tim1_ch4/clk_cco/ain2/[tim1_ch2n] pc5 (hs)/spi_sck [tim2_ch1] 12 11 9 10 [spi_nss] tim2_ch3/(hs) p a3 pd2 (hs) /ain3/[tim2_ch3] oscin/p a1 pb5 (t)/ i 2 c_sd a [tim1_bkin] u ar t1_tx/ain5 /(hs) pd5 u ar t1_rx/ain6 /(hs) pd6 pc6 (hs) /spi_mosi [tim1_ch1] pc7 (hs) /spi_miso [tim1_ch2] 2. (t) t rue open drain (p-buf fer and protection diode to v dd not implemented). 3. [ ] alternate function remapping option (if the same alternate function is shown twice, it indicates an exclusive choice not a duplication of the function). stm8S003F3 ufqfpn20 pinout 5.2.2 figure 5: stm8S003F3 ufqfpn20-pin pinout 1. hs high sink capability . 2. (t) t rue open drain (p-buf fer and protection diode to v dd not implemented). 3. [ ] alternate function remapping option (if the same alternate function is shown twice, it indicates an exclusive choice not a duplication of the function). stm8S003F3 tssop20/ufqfpn20 pin description 5.2.3 t able 6: stm8S003F3 pin description alternate function after remap [option bit] default alternate function main function (after reset) output input t ype pin name pin no. pp od speed high sink (1) ext. interr . wpu floating ufqfpn20 tssop20 t imer 2 - channel port d4 x x o3 hs x x x i/o pd4/ beep/ tim2_ ch1/ uar t1 _ck 18 1 1/beep output/ docid018576 rev 3 22 / 100 stm8s003k3 stm8S003F3 pinout and pin description 2 1 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 vcap v ss oscout/p a2 oscin/p a1 [spi_nss] tim2_ch3/(hs) p a3 nrst pd4 (hs)/beep / tim2_ch1/u ar t1_ck pd5(hs)/ain5/u ar t1_tx pd3 (hs)/ain4/tim2_ch2/adc_etr pd2(hs)/ain3/{tim2_ch3] pc4(hs)/tim1_ch4/clk_cco/ain2/[tim1_ch2n] pc5 (hs)/spi_sck [tim2_ch1] pc6(hs)/spi_mosi [tim1_ch1] pc7(hs)/spi_miso[tim1_ch2] pd1(hs)/swim [tim1_bkin] i 2 c_sd a/(t)pb5 1 0 [tim1_ch1n] [tli] tim1_ch3 /(hs)pc3 pd6(hs)/ain6/u ar t1_rx 20 v dd [adc_etr] i 2 c_scl/(t)pb4 alternate function after remap [option bit] default alternate function main function (after reset) output input t ype pin name pin no. pp od speed high sink (1) ext. interr . wpu floating ufqfpn20 tssop20 uar t1 clock analog input 5/ port d5 x x o3 hs x x x i/o pd5/ ain5/ uar t1 _tx 19 2 uar t1 data transmit analog input 6/ port d6 x x o3 hs x x x i/o pd6/ ain6/ uar t1 _rx 20 3 uar t1 data receive reset x i/o nrst 1 4 resonator/ crystal in port a1 x x o1 x x x i/o p a1/ oscin (2) 2 5 resonator/ crystal out port a2 x x o1 x x x i/o p a2/ oscout 3 6 digital ground s v ss 4 7 1.8 v regulator capacitor s vcap 5 8 digital power supply s v dd 6 9 spi master/ slave select [afr1] t imer 2 channel 3 port a3 x x o3 hs x x x i/o p a3/ tim2_ ch3 [spi_ nss] 7 10 t imer 1 - break input [afr4] i 2 c data port b5 t (3) o1 x x i/o pb5/ i 2 c_ sda [tim1_ bkin] 8 1 1 adc external trigger [afr4] i 2 c clock port b4 t (3) o1 x x i/o pb4/ i 2 c_ scl 9 12 t op level interrupt t imer 1 - channel 3 port c3 x x o3 hs x x x i/o pc3/ tim1_ch3 [tli] [tim1_ ch1n] 10 13 [afr3] t imer 1 - inverted channel 1 [afr7] t imer 1 - inverted configurable clock port c4 x x o3 hs x x x i/o pc4/ clk_cco/ tim1_ 1 1 14 channel 2 [afr7] output/t imer 1 - channel 4/analog input 2 ch4/ain2/[tim1_ ch2n] t imer 2 - channel 1 [afr0] spi clock port c5 x x o3 hs x x x i/o pc5/ spi_sck [tim2_ ch1] 12 15 23 / 100 docid018576 rev 3 pinout and pin description stm8s003k3 stm8S003F3 alternate function after remap [option bit] default alternate function main function (after reset) output input t ype pin name pin no. pp od speed high sink (1) ext. interr . wpu floating ufqfpn20 tssop20 t imer 1 - channel 1 [afr0] spi master out/slave in port c6 x x o3 hs x x x i/o pc6/ spi_mosi [tim1_ ch1] 13 16 t imer 1 - channel 2 [afr0] spi master in/ slave out port c7 x x o3 hs x x x i/o pc7/ spi_miso [tim1_ ch2] 14 17 swim data interface port d1 x x o4 hs x x x i/o pd1/ swim (4) 15 18 t imer 2 - channel 3 [afr1] analog input 3 port d2 x x o3 hs x x x i/o pd2/ain3/[tim2_ ch3] 16 19 analog input 4/ port d3 x x o3 hs x x x i/o pd3/ ain4/ tim2_ ch2/ adc_ etr 17 20 t imer 2 - channel 2/adc external trigger (1) i/o pins used simultaneously for high current source/sink must be uniformly spaced around the package. in addition, the total driven current must respect the absolute maximum ratings. (2) when the mcu is in halt/active-halt mode, p a1 is automatically configured in input weak pull-up and cannot be used for waking up the device. in this mode, the output state of p a1 is not driven. it is recommended to use p a1 only in input mode if halt/active-halt is used in the application. (3) in the open-drain output column, "t" defines a true open-drain i/o (p-buf fer , weak pull-up, and protection diode to v dd are not implemented). (4) the pd1 pin is in input pull-up during the reset phase and after internal reset release. alternate function remapping 5.3 as shown in the rightmost column of the pin description table, some alternate functions can be remapped at dif ferent i/o ports by programming one of eight afr (alternate function remap) option bits. when the remapping option is active, the default alternate function is no longer available. t o use an alternate function, the corresponding peripheral must be enabled in the peripheral registers. alternate function remapping does not ef fect gpio capabilities of the i/o ports (see the gpio section of the family reference manual, rm0016). docid018576 rev 3 24 / 100 stm8s003k3 stm8S003F3 pinout and pin description memory and register map 6 memory map 6.1 figure 6: memory map 25 / 100 docid018576 rev 3 memory and register map stm8s003k3 stm8S003F3 0x00 9fff flash prog r am memor y (8 kb ytes) 0x00 0000 ram 0x00 03ff (1 kb yte) 513 b ytes stac k reser v ed reser v ed 0x00 a000 0x02 7fff 0x00 47ff 0x00 8000 32 interr upt v ectors 0x00 807f gpio and per iph. reg. 0x00 5000 0x00 57ff 0x00 5800 0x00 7fff 0x00 480b 0x00 4fff 0x00 7eff cpu/swim/deb ug/itc registers 0x00 7f00 reser v ed option b ytes 0x00 480a 0x00 4800 0x00 0800 0x00 8080 reser v ed 0x00 407f data eepr om 0x00 4000 reser v ed register map 6.2 i/o port hardware register map 6.2.1 t able 7: i/o port hardware register map reset status register name register label block address 0x00 port a data output latch register p a_odr port a 0x00 5000 0xxx (1) port a input pin value register p a_idr 0x00 5001 0x00 port a data direction register p a_ddr 0x00 5002 0x00 port a control register 1 p a_cr1 0x00 5003 0x00 port a control register 2 p a_cr2 0x00 5004 0x00 port b data output latch register pb_odr port b 0x00 5005 0xxx (1) port b input pin value register pb_idr 0x00 5006 0x00 port b data direction register pb_ddr 0x00 5007 0x00 port b control register 1 pb_cr1 0x00 5008 0x00 port b control register 2 pb_cr2 0x00 5009 0x00 port c data output latch register pc_odr port c 0x00 500a 0xxx (1) port c input pin value register pb_idr 0x00 500b 0x00 port c data direction register pc_ddr 0x00 500c 0x00 port c control register 1 pc_cr1 0x00 500d 0x00 port c control register 2 pc_cr2 0x00 500e 0x00 port d data output latch register pd_odr port d 0x00 500f 0xxx (1) port d input pin value register pd_idr 0x00 5010 0x00 port d data direction register pd_ddr 0x00 501 1 0x02 port d control register 1 pd_cr1 0x00 5012 0x00 port d control register 2 pd_cr2 0x00 5013 0x00 port e data output latch register pe_odr port e 0x00 5014 0xxx (1) port e input pin value register pe_idr 0x00 5015 0x00 port e data direction register pe_ddr 0x00 5016 0x00 port e control register 1 pe_cr1 0x00 5017 docid018576 rev 3 26 / 100 stm8s003k3 stm8S003F3 memory and register map reset status register name register label block address 0x00 port e control register 2 pe_cr2 port e 0x00 5018 0x00 port f data output latch register pf_odr port f 0x00 5019 0xxx (1) port f input pin value register pf_idr 0x00 501a 0x00 port f data direction register pf_ddr 0x00 501b 0x00 port f control register 1 pf_cr1 0x00 501c 0x00 port f control register 2 pf_cr2 0x00 501d (1) depends on the external circuitry . general hardware register map 6.2.2 t able 8: general hardware register map reset status register name register label block address reserved area (60 bytes) 0x00 501e to 0x00 5059 0x00 flash control register 1 flash_cr1 flash 0x00 505a 0x00 flash control register 2 flash_cr2 0x00 505b 0xff flash complementary control register 2 flash_ncr2 0x00 505c 0x00 flash protection register flash _fpr 0x00 505d 0xff flash complementary protection register flash _nfpr 0x00 505e 0x00 flash in-application programming status register flash _iapsr 0x00 505f reserved area (2 bytes) 0x00 5060 to 0x00 5061 0x00 flash program memory unprotection register flash _pukr flash 0x00 5062 27 / 100 docid018576 rev 3 memory and register map stm8s003k3 stm8S003F3 reset status register name register label block address reserved area (1 byte) 0x00 5063 0x00 data eeprom unprotection register flash_dukr flash 0x00 5064 reserved area (59 bytes) 0x00 5065 to 0x00 509f 0x00 external interrupt control register 1 exti_cr1 itc 0x00 50a0 0x00 external interrupt control register 2 exti_cr2 0x00 50a1 reserved area (17 bytes) 0x00 50a2 to 0x00 50b2 0xxx (1) reset status register rst_sr rst 0x00 50b3 reserved area (12 bytes) 0x00 50b4 to 0x00 50bf 0x01 internal clock control register clk_ickr clk 0x00 50c0 0x00 external clock control register clk_eckr 0x00 50c1 reserved area (1 byte) 0x00 50c2 0xe1 clock master status register clk_cmsr clk 0x00 50c3 0xe1 clock master switch register clk_swr 0x00 50c4 0xxx clock switch control register clk_swcr 0x00 50c5 0x18 clock divider register clk_ckdivr 0x00 50c6 0xff peripheral clock gating register 1 clk_pckenr1 0x00 50c7 0x00 clock security system register clk_cssr 0x00 50c8 0x00 configurable clock control register clk_ccor 0x00 50c9 0xff peripheral clock gating register 2 clk_pckenr2 0x00 50ca docid018576 rev 3 28 / 100 stm8s003k3 stm8S003F3 memory and register map reset status register name register label block address 0x00 hsi clock calibration trimming register clk_hsitrimr 0x00 50cc 0bxxxx xxx0 swim clock control register clk_swimccr 0x00 50cd reservlk ed area (3 bytes) 0x00 50ce to 0x00 50d0 0x7f wwdg control register wwdg_cr wwdg 0x00 50d1 0x7f wwdr window register wwdg_wr 0x00 50d2 reserved area (13 bytes) 0x00 50d3 to 00 50df 0xxx (2) iwdg key register iwdg_kr iwdg 0x00 50e0 0x00 iwdg prescaler register iwdg_pr 0x00 50e1 0xff iwdg reload register iwdg_rlr 0x00 50e2 reserved area (13 bytes) 0x00 50e3 to 0x00 50ef 0x00 a wu control/status register 1 a wu_csr1 a wu 0x00 50f0 0x3f a wu asynchronous prescaler buf fer register a wu_apr 0x00 50f1 0x00 a wu timebase selection register a wu_tbr 0x00 50f2 0x1f beep control/status register beep_csr beep 0x00 50f3 reserved area (12 bytes) 0x00 50f4 to 0x00 50ff 0x00 spi control register 1 spi_cr1 spi 0x00 5200 0x00 spi control register 2 spi_cr2 0x00 5201 29 / 100 docid018576 rev 3 memory and register map stm8s003k3 stm8S003F3 reset status register name register label block address 0x00 spi interrupt control register spi_icr 0x00 5202 0x02 spi status register spi_sr 0x00 5203 0x00 spi data register spi_dr 0x00 5204 0x07 spi crc polynomial register spi_crcpr 0x00 5205 0xff spi rx crc register spi_rxcrcr 0x00 5206 0xff spi tx crc register spi_txcrcr 0x00 5207 reserved area (8 bytes) 0x00 5208 to 0x00 520f 0x00 i 2 c control register 1 i2c_cr1 i 2 c 0x00 5210 0x00 i 2 c control register 2 i2c_cr2 0x00 521 1 0x00 i 2 c frequency register i2c_freqr 0x00 5212 0x00 i 2 c own address register low i2c_oarl 0x00 5213 0x00 i 2 c own address register high i2c_oarh 0x00 5214 reserved 0x00 5215 0x00 i 2 c data register i2c_dr 0x00 5216 0x00 i 2 c status register 1 i2c_sr1 0x00 5217 0x00 i 2 c status register 2 i2c_sr2 0x00 5218 0x0x i 2 c status register 3 i2c_sr3 0x00 5219 0x00 i 2 c interrupt control register i2c_itr 0x00 521a 0x00 i 2 c clock control register low i2c_ccrl 0x00 521b docid018576 rev 3 30 / 100 stm8s003k3 stm8S003F3 memory and register map reset status register name register label block address 0x00 i 2 c clock control register high i2c_ccrh 0x00 521c 0x02 i 2 c trise register i2c_triser 0x00 521d 0x00 i 2 c packet error checking register i2c_pecr 0x00 521e reserved area (17 bytes) 0x00 521f to 0x00 522f 0xc0 uar t1 status register uar t1_sr uar t1 0x00 5230 0xxx uar t1 data register uar t1_dr 0x00 5231 0x00 uar t1 baud rate register 1 uar t1_brr1 0x00 5232 0x00 uar t1 baud rate register 2 uar t1_brr2 0x00 5233 0x00 uar t1 control register 1 uar t1_cr1 0x00 5234 0x00 uar t1 control register 2 uar t1_cr2 0x00 5235 0x00 uar t1 control register 3 uar t1_cr3 0x00 5236 0x00 uar t1 control register 4 uar t1_cr4 0x00 5237 0x00 uar t1 control register 5 uar t1_cr5 0x00 5238 0x00 uar t1 guard time register uar t1_gtr 0x00 5239 0x00 uar t1 prescaler register uar t1_pscr 0x00 523a reserved area (21 bytes) 0x00 523b to 0x00 523f 0x00 tim1 control register 1 tim1_cr1 tim1 0x00 5250 0x00 tim1 control register 2 tim1_cr2 0x00 5251 31 / 100 docid018576 rev 3 memory and register map stm8s003k3 stm8S003F3 reset status register name register label block address 0x00 tim1 slave mode control register tim1_smcr 0x00 5252 0x00 tim1 external trigger register tim1_etr 0x00 5253 0x00 tim1 interrupt enable register tim1_ier 0x00 5254 0x00 tim1 status register 1 tim1_sr1 0x00 5255 0x00 tim1 status register 2 tim1_sr2 0x00 5256 0x00 tim1 event generation register tim1_egr 0x00 5257 0x00 tim1 capture/compare mode register 1 tim1_ccmr1 0x00 5258 0x00 tim1 capture/compare mode register 2 tim1_ccmr2 0x00 5259 0x00 tim1 capture/compare mode register 3 tim1_ccmr3 0x00 525a 0x00 tim1 capture/compare mode register 4 tim1_ccmr4 0x00 525b 0x00 tim1 capture/compare enable register 1 tim1_ccer1 0x00 525c 0x00 tim1 capture/compare enable register 2 tim1_ccer2 0x00 525d 0x00 tim1 counter high tim1_cntrh 0x00 525e 0x00 tim1 counter low tim1_cntrl 0x00 525f 0x00 tim1 prescaler register high tim1_pscrh 0x00 5260 0x00 tim1 prescaler register low tim1_pscrl 0x00 5261 0xff tim1 auto-reload register high tim1_arrh 0x00 5262 0xff tim1 auto-reload register low tim1_arrl 0x00 5263 0x00 tim1 repetition counter register tim1_rcr 0x00 5264 docid018576 rev 3 32 / 100 stm8s003k3 stm8S003F3 memory and register map reset status register name register label block address 0x00 tim1 capture/compare register 1 high tim1_ccr1h 0x00 5265 0x00 tim1 capture/compare register 1 low tim1_ccr1l 0x00 5266 0x00 tim1 capture/compare register 2 high tim1_ccr2h 0x00 5267 0x00 tim1 capture/compare register 2 low tim1_ccr2l 0x00 5268 0x00 tim1 capture/compare register 3 high tim1_ccr3h 0x00 5269 0x00 tim1 capture/compare register 3 low tim1_ccr3l 0x00 526a 0x00 tim1 capture/compare register 4 high tim1_ccr4h 0x00 526b 0x00 tim1 capture/compare register 4 low tim1_ccr4l 0x00 526c 0x00 tim1 break register tim1_bkr 0x00 526d 0x00 tim1 dead-time register tim1_dtr 0x00 526e 0x00 tim1 output idle state register tim1_oisr 0x00 526f reserved area (147 bytes) 0x00 5270 to 0x00 52ff 0x00 tim2 control register 1 tim2_cr1 tim2 0x00 5300 reserved 0x00 5301 reserved 0x00 5302 0x00 tim2 interrupt enable register tim2_ier 0x00 5303 0x00 tim2 status register 1 tim2_sr1 0x00 5304 0x00 tim2 status register 2 tim2_sr2 0x00 5305 0x00 tim2 event generation register tim2_egr 0x00 5306 33 / 100 docid018576 rev 3 memory and register map stm8s003k3 stm8S003F3 reset status register name register label block address 0x00 tim2 capture/compare mode register 1 tim2_ccmr1 0x00 5307 0x00 tim2 capture/compare mode register 2 tim2_ccmr2 0x00 5308 0x00 tim2 capture/compare mode register 3 tim2_ccmr3 0x00 5309 0x00 tim2 capture/compare enable register 1 tim2_ccer1 0x00 530a 0x00 tim2 capture/compare enable register 2 tim2_ccer2 0x00 530b 0x00 tim2 counter high tim2_cntrh 0x00 530c 0x00 tim2 counter low tim2_cntrl 0x00 530d 0x00 tim2 prescaler register tim2_pscr 0x00 530e 0xff tim2 auto-reload register high tim2_arrh 0x00 530f 0xff tim2 auto-reload register low tim2_arrl 0x00 5310 0x00 tim2 capture/compare register 1 high tim2_ccr1h 0x00 531 1 0x00 tim2 capture/compare register 1 low tim2_ccr1l 0x00 5312 0x00 tim2 capture/compare reg. 2 high tim2_ccr2h 0x00 5313 0x00 tim2 capture/compare register 2 low tim2_ccr2l 0x00 5314 0x00 tim2 capture/compare register 3 high tim2_ccr3h 0x00 5315 0x00 tim2 capture/compare register 3 low tim2_ccr3l 0x00 5316 reserved area (43 bytes) 0x00 5317 to 0x00 533f 0x00 tim4 control register 1 tim4_cr1 tim4 0x00 5340 reserved 0x00 5341 docid018576 rev 3 34 / 100 stm8s003k3 stm8S003F3 memory and register map reset status register name register label block address reserved 0x00 5342 0x00 tim4 interrupt enable register tim4_ier 0x00 5343 0x00 tim4 status register tim4_sr 0x00 5344 0x00 tim4 event generation register tim4_egr 0x00 5345 0x00 tim4 counter tim4_cntr 0x00 5346 0x00 tim4 prescaler register tim4_pscr 0x00 5347 0xff tim4 auto-reload register tim4_arr 0x00 5348 reserved area (153 bytes) 0x00 5349 to 0x00 53df 0x00 adc data buf fer registers adc _dbxr adc1 0x00 53e0 to 0x00 53f3 reserved area (12 bytes) 0x00 53f4 to 0x00 53ff 0x00 adc control/status register adc _csr adc1 0x00 5400 0x00 adc configuration register 1 adc_cr1 0x00 5401 0x00 adc configuration register 2 adc_cr2 0x00 5402 0x00 adc configuration register 3 adc_cr3 0x00 5403 0xxx adc data register high adc_drh 0x00 5404 0xxx adc data register low adc_drl 0x00 5405 0x00 adc schmitt trigger disable register high adc_tdrh 0x00 5406 0x00 adc schmitt trigger disable register low adc_tdrl 0x00 5407 35 / 100 docid018576 rev 3 memory and register map stm8s003k3 stm8S003F3 reset status register name register label block address 0x03 adc high threshold register high adc_htrh 0x00 5408 0xff adc high threshold register low adc_htrl 0x00 5409 0x00 adc low threshold register high adc_l trh 0x00 540a 0x00 adc low threshold register low adc_l trl 0x00 540b 0x00 adc analog watchdog status register high adc_a wsrh 0x00 540c 0x00 adc analog watchdog status register low adc_a wsrl 0x00 540d 0x00 adc analog watchdog control register high adc _a wcrh 0x00 540e 0x00 adc analog watchdog control register low adc_a wcrl 0x00 540f reserved area (1008 bytes) 0x00 5410 to 0x00 57ff (1) depends on the previous reset source. (2) w rite only register . cpu/swim/debug module/interrupt controller registers 6.2.3 t able 9: cpu/swim/debug module/interrupt controller registers reset status register name register label block address 0x00 accumulator a cpu (1) 0x00 7f00 0x00 program counter extended pce 0x00 7f01 0x00 program counter high pch 0x00 7f02 0x00 program counter low pcl 0x00 7f03 0x00 x index register high xh 0x00 7f04 0x00 x index register low xl 0x00 7f05 docid018576 rev 3 36 / 100 stm8s003k3 stm8S003F3 memory and register map reset status register name register label block address 0x00 y index register high yh 0x00 7f06 0x00 y index register low yl 0x00 7f07 0x03 stack pointer high sph 0x00 7f08 0xff stack pointer low spl 0x00 7f09 0x28 condition code register ccr 0x00 7f0a reserved area (85 bytes) 0x00 7f0b to 0x00 7f5f 0x00 global configuration register cfg_gcr cpu 0x00 7f60 0xff interrupt software priority register 1 itc_spr1 itc 0x00 7f70 0xff interrupt software priority register 2 itc_spr2 0x00 7f71 0xff interrupt software priority register 3 itc_spr3 0x00 7f72 0xff interrupt software priority register 4 itc_spr4 0x00 7f73 0xff interrupt software priority register 5 itc_spr5 0x00 7f74 0xff interrupt software priority register 6 itc_spr6 0x00 7f75 0xff interrupt software priority register 7 itc_spr7 0x00 7f76 0xff interrupt software priority register 8 itc_spr8 0x00 7f77 reserved area (2 bytes) 0x00 7f78 to 0x00 7f79 0x00 swim control status register swim_csr swim 0x00 7f80 reserved area (15 bytes) 0x00 7f81 to 0x00 7f8f 0xff dm breakpoint 1 register extended byte dm_bk1re dm 0x00 7f90 0xff dm breakpoint 1 register high byte dm_bk1rh 0x00 7f91 0xff dm breakpoint 1 register low byte dm_bk1rl 0x00 7f92 0xff dm breakpoint 2 register extended byte dm_bk2re 0x00 7f93 0xff dm breakpoint 2 register high byte dm_bk2rh 0x00 7f94 0xff dm breakpoint 2 register low byte dm_bk2rl 0x00 7f95 0x00 dm debug module control register 1 dm_cr1 0x00 7f96 0x00 dm debug module control register 2 dm_cr2 0x00 7f97 37 / 100 docid018576 rev 3 memory and register map stm8s003k3 stm8S003F3 reset status register name register label block address 0x10 dm debug module control/status register 1 dm_csr1 0x00 7f98 0x00 dm debug module control/status register 2 dm_csr2 0x00 7f99 0xff dm enable function register dm_enfctr 0x00 7f9a reserved area (5 bytes) 0x00 7f9b to 0x00 7f9f (1) accessible by debug module only docid018576 rev 3 38 / 100 stm8s003k3 stm8S003F3 memory and register map interrupt vector mapping 7 t able 10: interrupt mapping v ector address w akeup from active-halt mode w akeup from halt mode description source block irq no. 0x00 8000 y es y es reset reset 0x00 8004 - - software interrupt trap 0x00 8008 - - external top level interrupt tli 0 0x00 800c y es - auto wake up from halt a wu 1 0x00 8010 - - clock controller clk 2 0x00 8014 y es (1) y es (1) port a external interrupts exti0 3 0x00 8018 y es y es port b external interrupts exti1 4 0x00 801c y es y es port c external interrupts exti2 5 0x00 8020 y es y es port d external interrupts exti3 6 0x00 8024 y es y es port e external interrupts exti4 7 0x00 8028 - - reserved 8 0x00 802c - - reserved 9 0x00 8030 y es y es end of transfer spi 10 0x00 8034 - - tim1 update/ overflow/ underflow/ trigger/ break tim1 1 1 0x00 8038 - - tim1 capture/ compare tim1 12 0x00 803c - - tim2 update/ overflow tim2 13 0x00 8040 - - tim2 capture/ compare tim2 14 0x00 8044 - - reserved 15 0x00 8048 - - reserved 16 0x00 804c - - tx complete uar t1 17 0x00 8050 - - receive register da t a full uar t1 18 0x00 8054 y es y es i 2 c interrupt i 2 c 19 0x00 8058 - - reserved 20 0x00 805c - - reserved 21 0x00 8060 - - adc1 end of conversion/ analog watchdog interrupt adc1 22 39 / 100 docid018576 rev 3 interrupt vector mapping stm8s003k3 stm8S003F3 v ector address w akeup from active-halt mode w akeup from halt mode description source block irq no. 0x00 8064 - - tim4 update/ overflow tim4 23 0x00 8068 - - eop/wr_pg_dis flash 24 0x00 806c to 0x00 807c reserved (1) except p a1 docid018576 rev 3 40 / 100 stm8s003k3 stm8S003F3 interrupt vector mapping option bytes 8 option bytes contain configurations for device hardware features as well as the memory protection of the device. they are stored in a dedicated block of the memory . except for the rop (read-out protection) byte, each option byte has to be stored twice, in a regular form (optx) and a complemented one (noptx) for redundancy . option bytes can be modified in icp mode (via swim) by accessing the eeprom address shown in the table below . option bytes can also be modified on the fly by the application in iap mode, except the rop option that can only be modified in icp mode (via swim). refer to the stm8s flash programming manual (pm0051) and stm8 swim communication protocol and debug module user manual (um0470) for information on swim programming procedures. t able 1 1: option bytes factory default setting option bits option byte no. option name addr . 0 1 2 3 4 5 6 7 0x00 rop [7:0] opt0 read-out protection (rop) 0x4800 0x00 ubc [7:0] opt1 user boot code(ubc) 0x4801 0xff nubc [7:0] nopt1 0x4802 0x00 afr0 afr1 afr2 afr3 afr4 afr5 afr6 afr7 opt2 alternate function 0x4803 0xff nafr0 nafr1 nafr2 nafr3 nafr4 nafr5 nafr6 nafr7 nopt2 0x4804 remapping (afr) 0x00 wwdg _hal t wwdg _hw iwdg _hw lsi_ en hsi trim reserved opt3 miscell. option 0x4805h 0xff nww g_hal t nwwdg _hw niwdg _hw nlsi_ en nhsi trim reserved nopt3 0x4806 0x00 prs c0 prs c1 cka wu sel ext clk reserved opt4 clock option 0x4807 0xff npr sc0 nprsc1 ncka wusel next clk reserved nopt4 0x4808 0x00 hsecnt [7:0] opt5 hse clock startup 0x4809 0xff nhsecnt [7:0] nopt5 0x480a t able 12: option byte description description option byte no. rop[7:0] memory readout protection (rop) opt0 0xaa: enable readout protection (write access via swim protocol) 41 / 100 docid018576 rev 3 option bytes stm8s003k3 stm8S003F3 description option byte no. note: refer to the family reference manual (rm0016) section on flash/eeprom memory readout protection for details. ubc[7:0] user boot code area opt1 0x00: no ubc, no write-protection 0x01: page 0 defined as ubc, memory write-protected 0x02: pages 0 to 1 defined as ubc, memory write-protected. page 0 and 1 contain the interrupt vectors. ... 0x7f: pages 0 to 126 defined as ubc, memory write-protected other values: pages 0 to 127 defined as ubc, memory write-protected note: refer to the family reference manual (rm0016) section on flash write protection for more details. afr[7:0] opt2 refer to following section for alternate function remapping decriptions of bits [7:2] and [1:0] respectively . hsitrim :high speed internal clock trimming register size opt3 0: 3-bit trimming supported in clk_hsitrimr register 1: 4-bit trimming supported in clk_hsitrimr register lsi_en :low speed internal clock enable 0: lsi clock is not available as cpu clock source 1: lsi clock is available as cpu clock source iwdg_hw : independent watchdog 0: iwdg independent watchdog activated by software 1: iwdg independent watchdog activated by hardware wwdg_hw : window watchdog activation 0: wwdg window watchdog activated by software 1: wwdg window watchdog activated by hardware wwdg_hal t : window watchdog reset on halt docid018576 rev 3 42 / 100 stm8s003k3 stm8S003F3 option bytes description option byte no. 0: no reset generated on halt if wwdg active 1: reset generated on halt if wwdg active extclk : external clock selection opt4 0: external crystal connected to oscin/oscout 1: external clock signal on oscin cka wusel :auto wake-up unit/clock 0: lsi clock source selected for a wu 1: hse clock with prescaler selected as clock source for for a wu prsc[1:0] a wu clock prescaler 0x: 16 mhz to 128 khz prescaler 10: 8 mhz to 128 khz prescaler 1 1: 4 mhz to 128 khz prescaler hsecnt[7:0] :hse crystal oscillator stabilization time opt5 0x00: 2048 hse cycles 0xb4: 128 hse cycles 0xd2: 8 hse cycles 0xe1: 0.5 hse cycles alternate function remapping bits 8.1 t able 13: stm8s003k3 alternate function remapping bits for 32-pin devices description (1) option byte no. afr7 alternate function remapping option 7 opt2 reserved. afr6 alternate function remapping option 6 0: afr6 remapping option inactive: default alternate function (2) . 1: port d7 alternate function = tim1_ch4. afr5 alternate function remapping option 5 0: afr5 remapping option inactive: default alternate function (2) . 43 / 100 docid018576 rev 3 option bytes stm8s003k3 stm8S003F3 description (1) option byte no. 1: port d0 alternate function = clk_cco. afr[4:2] alternate function remapping options 4:2 reserved. afr1 alternate function remapping option 1 0: afr1 remapping option inactive: default alternate functions (2) . 1: port a3 alternate function = spi_nss; port d2 alternate function = tim2_ch3. afr0 alternate function remapping option 0 reserved. (1) do not use more than one remapping option in the same port. it is forbidden to enable both afr1 and afr0. (2) refer to pinout description. t able 14: stm8S003F3 alternate function remapping bits for 20-pin devices description option byte no. afr7 alternate function remapping option 7 opt2 0: afr7 remapping option inactive: default alternate functions (1) . 1: port c3 alternate function = tim1_ch1n; port c4 alternate function = tim1_ch2n. afr6 alternate function remapping option 6 reserved. afr5 alternate function remapping option 5 reserved. afr4 alternate function remapping option 4 0: afr4 remapping option inactive: default alternate functions (1) . 1: port b4 alternate function = adc_etr; port b5 alternate function = tim1_bkin. afr3 alternate function remapping option 3 0: afr3 remapping option inactive: default alternate function (1) . 1: port c3 alternate function = tli. afr2 alternate function remapping option 2 docid018576 rev 3 44 / 100 stm8s003k3 stm8S003F3 option bytes description option byte no. reserved afr1 alternate function remapping option 1 (2) 0: afr1 remapping option inactive: default alternate functions (1) . 1: port a3 alternate function = spi_nss; port d2 alternate function = tim2_ch3. afr0 alternate function remapping option 0 (2) 0: afr0 remapping option inactive: default alternate functions (1) . 1: port c5 alternate function = tim2_ch1; port c6 alternate function = tim1_ch1; port c7 alternate function = tim1_ch2. (1) refer to pinout description. (2) do not use more than one remapping option in the same port. it is forbidden to enable both afr1 and afr0. 45 / 100 docid018576 rev 3 option bytes stm8s003k3 stm8S003F3 electrical characteristics 9 parameter conditions 9.1 unless otherwise specified, all voltages are referred to v ss . minimum and maximum values 9.1.1 unless otherwise specified the minimum and maximum values are guaranteed in the worst conditions of ambient temperature, supply voltage and frequencies by tests in production on 100 % of the devices with an ambient temperature at t a = 25 c and t a = t amax (given by the selected temperature range). data based on characterization results, design simulation and/or technology characteristics are indicated in the table footnotes and are not tested in production. based on characterization, the minimum and maximum values refer to sample tests and represent the mean value plus or minus three times the standard deviation (mean 3 ). t ypical values 9.1.2 unless otherwise specified, typical data are based on t a = 25 c, v dd = 5 v . they are given only as design guidelines and are not tested. t ypical adc accuracy values are determined by characterization of a batch of samples from a standard dif fusion lot over the full temperature range, where 95% of the devices have an error less than or equal to the value indicated (mean 2 ). t ypical curves 9.1.3 unless otherwise specified, all typical curves are given only as design guidelines and are not tested. loading capacitor 9.1.4 the loading conditions used for pin parameter measurement are shown in the following figure. figure 7: pin loading conditions pin input voltage 9.1.5 the input voltage measurement on a pin of the device is described in the following figure. docid018576 rev 3 46 / 100 stm8s003k3 stm8S003F3 electrical characteristics 5 0 p f stm 8 p i n figure 8: pin input voltage absolute maximum ratings 9.2 stresses above those listed as absolute maximum ratings may cause permanent damage to the device. this is a stress rating only and functional operation of the device under these conditions is not implied. exposure to maximum rating conditions for extended periods may af fect device reliability . t able 15: v oltage characteristics unit max min ratings symbol v 6.5 -0.3 supply voltage (1) v ddx - v ss 6.5 v ss - 0.3 input voltage on true open drain pins (2) v in v dd + 0.3 v ss - 0.3 input voltage on any other pin (2) mv 50 v ariations between dif ferent power pins |v ddx - v dd | 50 v ariations between all the dif ferent ground pins |v ssx - v ss | see "absolute maximum ratings (electrical sensitivity)" electrostatic discharge voltage v esd (1) all power (v dd ) and ground (v ss ) pins must always be connected to the external power supply (2) i inj(pin) must never be exceeded. this is implicitly insured if v in maximum is respected. if v in maximum cannot be respected, the injection current must be limited externally to the i inj(pin) value. a positive injection is induced by v in >v dd while a negative injection is induced by v in unit max (1) ratings symbol 80 t otal current out of v ss ground lines (sink) (2) i vss 20 output current sunk by any i/o and control pin i io - 20 output current source by any i/os and control pin 4 injected current on nrst pin i inj(pin) (3) (4) 4 injected current on oscin pin 4 injected current on any other pin (5) 20 t otal injected current (sum of all i/o and control pins) (5) i inj(pin) (3) (1) data based on characterization results, not tested in production. (2) all power (v dd ) and ground (v ss ) pins must always be connected to the external supply . (3) i inj(pin) must never be exceeded. this is implicitly insured if v in maximum is respected. if v in maximum cannot be respected, the injection current must be limited externally to the i inj(pin) value. a positive injection is induced by v in >v dd while a negative injection is induced by v in operating conditions 9.3 t able 18: general operating conditions unit max min conditions parameter symbol mhz 16 0 internal cpu clock frequency f cpu v 5.5 2.95 standard operating voltage v dd nf 3300 470 c ext : capacitance of external capacitor vcap (1) 0.3 - at 1 mhz (2) esr of external capacitor nh 15 - esl of external capacitor mw 238 - tssop20 power dissipation at t a = 85 c for suf fix 6 p d (3) 220 - ufqfpn20 330 - lqfp32 c 85 -40 maximum power dissipation ambient temperature for 6 suf fix version t a 105 -40 junction temperature range for suf fix 6 t j (1) care should be taken when selecting the capacitor , due to its tolerance, as well as the parameter dependency on temperature, dc bias and frequency in addition to other factors. the parameter maximum value must be respected for the full application range. (2) this frequency of 1 mhz as a condition for vcap parameters is given by design of internal regulator . (3) t o calculate p dmax (t a ), use the formula p dmax =(t jmax - t a )/ ja (see thermal characteristics ) with the value for t jmax given in the previous table and the value for ja given in thermal characteristics . 49 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 figure 9: f cpumax versus v dd t able 19: operating conditions at power-up/power-down unit max t yp min conditions parameter symbol s/v 2 v dd rise time rate t vdd 2 v dd fall time rate (1) ms 1.7 v dd rising reset release delay t temp v 2.85 2.7 2.6 power-on reset threshold v it+ 2.8 2.65 2.5 brown-out reset threshold v it- mv 70 brown-out reset hysteresis v hys(bor) (1) reset is always generated after a t temp delay . the application must ensure that v dd is still above the minimum ooperating voltage (v dd min) when the t temp delay has elapsed. vcap external capacitor 9.3.1 stabilization for the main regulator is achieved connecting an external capacitor c ext to the v cap pin. c ext is specified in the operating conditions section. care should be taken to limit the series inductance to less than 15 nh. figure 10: external capacitor c ext 1. esr is the equivalent series resistance and esl is the equivalent inductance. docid018576 rev 3 50 / 100 stm8s003k3 stm8S003F3 electrical characteristics c rlea k es r e s l 16 12 8 4 0 2.95 4.0 5.0 5.5 f cpu (mhz) functionality guar anteed @t a -40 to 85 c supply v oltage functionality not guar anteed in this area supply current characteristics 9.3.2 the current consumption is measured as described in pin input voltage . t otal current consumption in run mode 9.3.2.1 the mcu is placed under the following conditions: ? all i/o pins in input mode with a static value at v dd or v ss (no load) ? all peripherals are disabled (clock stopped by peripheral clock gating registers) except if explicitly mentioned. subject to general operating conditions for v dd and t a . t able 20: t otal current consumption with code execution in run mode at v dd = 5 v unit max (1) t yp conditions parameter symbol ma 2.3 hse crystal osc. (16 mhz) f cpu = f master = 16 mhz supply current in run mode, code executed from ram i dd(run) 2.35 2 hse user ext. clock (16 mhz) 2 1.7 hsi rc osc. (16 mhz) 0.86 hse user ext. clock (16 mhz) f cpu = f master /128 = 125 khz 0.87 0.7 hsi rc osc. (16 mhz) 0.58 0.46 hsi rc osc. (16 mhz/8) f cpu = f master /128 = 15.625 khz 0.55 0.41 lsi rc osc. (128 khz) f cpu = f master = 128 khz 4.5 hse crystal osc. (16 mhz) f cpu = f master = 16 mhz supply current in run mode, code executed from flash 4.75 4.3 hse user ext. clock (16 mhz) 4.5 3.7 hsi rc osc. (16 mhz) ma 1.05 0.84 hsi rc osc. (16 mhz/8) (2) f cpu = f master = 2 mhz supply current in run mode, code executed from flash i dd(run) 0.9 0.72 hsi rc osc. (16 mhz) f cpu = f master /128 = 125 khz 0.58 0.46 hsi rc osc. (16 mhz/8) f cpu = f master /128 = 15.625 khz 0.57 0.42 lsi rc osc. (128 khz) f cpu = f master = 128 khz 51 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 (1) data based on characterization results, not tested in production. (2) default clock configuration measured with all peripherals of f. t able 21: t otal current consumption with code execution in run mode at v dd = 3.3 v unit max (1) t yp conditions parameter symbol ma 1.8 hse crystal osc. (16 mhz) f cpu = f master = 16 mhz supply current in run mode, code executed from ram i dd(run) 2.3 2 hse user ext. clock (16 mhz) 2 1.5 hsi rc osc. (16 mhz) 0.81 hse user ext. clock (16 mhz) f cpu = f master / 128 = 125 khz 0.87 0.7 hsi rc osc. (16 mhz) 0.58 0.46 hsi rc osc. (16 mhz/8) f cpu = f master / 128 = 15.625 khz 0.55 0.41 lsi rc osc. (128 khz) f cpu = f master = 128 khz 4 hse crystal osc. (16 mhz) f cpu = f master = 16 mhz supply current in run mode, code executed from flash 4.7 3.9 hse user ext. clock (16 mhz) 4.5 3.7 hsi rc osc. (16 mhz) 1.05 0.84 hsi rc osc. (16 mhz/8) (2) f cpu = f master = 2 mhz 0.9 0.72 hsi rc osc. (16 mhz) f cpu = f master / 128 = 125 khz 0.58 0.46 hsi rc osc. (16 mhz/8) f cpu = f master / 128 = 15.625 khz 0.57 0.42 lsi rc osc. (128 khz) f cpu = f master = 128 khz (1) data based on characterization results, not tested in production. (2) default clock configuration measured with all peripherals of f. docid018576 rev 3 52 / 100 stm8s003k3 stm8S003F3 electrical characteristics t otal current consumption in wait mode 9.3.2.2 t able 22: t otal current consumption in wait mode at v dd = 5 v unit max (1) t yp conditions parameter symbol ma 1.6 hse crystal osc. (16 mhz) f cpu = f master = 16 mhz supply current in wait mode i dd(wfi) 1.3 1.1 hse user ext. clock (16 mhz) 1.1 0.89 hsi rc osc. (16 mhz) 0.88 0.7 hsi rc osc. (16 mhz) f cpu = f master /128 = 125 khz 0.57 0.45 hsi rc osc. (16 mhz/8) (2) f cpu = f master /128 = 15.625 khz 0.54 0.4 lsi rc osc. (128 khz) f cpu = f master = 128 khz (1) data based on characterization results, not tested in production. (2) default clock configuration measured with all peripherals of f. t able 23: t otal current consumption in wait mode at v dd = 3.3 v unit max (1) t yp conditions parameter symbol ma 1.1 hse crystal osc. (16 mhz) f cpu = f master = 16 mhz supply current in wait mode i dd(wfi) 1.3 1.1 hse user ext. clock (16 mhz) 1.1 0.89 hsi rc osc. (16 mhz) 0.88 0.7 hsi rc osc. (16 mhz) f cpu = f master / 128 = 125 khz 0.57 0.45 hsi rc osc. (16 mhz/8) (2) f cpu = f master / 128 = 15.625 khz 0.54 0.4 lsi rc osc. (128 khz) f cpu = f master = 128 khz 53 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 (1) data based on characterization results, not tested in production. (2) default clock configuration measured with all peripherals of f. t otal current consumption in active halt mode 9.3.2.3 t able 24: t otal current consumption in active halt mode at v dd = 5 v unit max at 85 c (1) t yp conditions parameter symbol clock source flash mode (3) main voltage regulator (mvr) (2) a 1030 hse crystal osc. (16 mhz) operating mode on supply current in active halt mode i dd(ah) 260 200 lsi rc osc. (128 khz) operating mode on supply current in active halt mode i dd(ah) 970 hse crystal osc. (16 mhz) power-down mode on supply current in active halt mode i dd(ah) 200 150 lsi rc osc. (128 khz) power-down mode on supply current in active halt mode i dd(ah) 85 66 lsi rc osc. (128 khz) operating mode of f supply current in active halt mode i dd(ah) 20 10 lsi rc osc. (128 khz) power-down mode supply current in active halt mode i dd(ah) (1) data based on characterization results, not tested in production (2) configured by the regah bit in the clk_ickr register . (3) configured by the ahal t bit in the flash_cr1 register . t able 25: t otal current consumption in active halt mode at v dd = 3.3 v unit max at 85 c (1) t yp conditions parameter symbol clock source flash mode (3) main voltage regulator (mvr) (2) a 550 hse crystal osc. (16 mhz) operating mode on supply current in active halt mode i dd(ah) docid018576 rev 3 54 / 100 stm8s003k3 stm8S003F3 electrical characteristics unit max at 85 c (1) t yp conditions parameter symbol clock source flash mode (3) main voltage regulator (mvr) (2) a 260 200 lsi rc osc. (128 khz) operating mode on supply current in active halt mode i dd(ah) 970 hse crystal osc. (16 mhz) power-down mode i dd(ah) 200 150 lsi rc osc. (128 khz) supply current in active halt mode i dd(ah) 80 66 lsi rc osc. (128 khz) operating mode of f i dd(ah) 18 10 power-down mode i dd(ah) (1) data based on characterization results, not tested in production (2) configured by the regah bit in the clk_ickr register . (3) configured by the ahal t bit in the flash_cr1 register . t otal current consumption in halt mode 9.3.2.4 t able 26: t otal current consumption in halt mode at v dd = 5 v unit max at 85 c (1) t yp conditions parameter symbol a 75 63 flash in operating mode, hsi clock after wakeup supply current in halt mode i dd(h) 20 6.0 flash in power-down mode, hsi clock after wakeup (1) data based on characterization results, not tested in production t able 27: t otal current consumption in halt mode at v dd = 3.3 v unit max at 85 c (1) t yp conditions parameter symbol a 75 60 flash in operating mode, hsi clock after wakeup supply current in halt mode i dd(h) 55 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 unit max at 85 c (1) t yp conditions parameter symbol 17 4.5 flash in power-down mode, hsi clock after wakeup (1) data based on characterization results, not tested in production low power mode wakeup times 9.3.2.5 t able 28: w akeup times unit max (1) t yp conditions parameter symbol s see note (2) 0 to 16 mhz w akeup time from wait mode to run t wu(wfi) 0.56 f cpu = f master = 16 mhz mode (3) 2 (6) 1 (6) hsi (after flash in operating mode (5) mvr voltage regulator on (4) w akeup time active halt mode to run mode (3) t wu(ah) wakeup) 3 (6) hsi (after flash in power-down mvr voltage regulator w akeup time active halt mode to run wakeup) mode (5) on (4) mode (3) 48 (6) hsi (after flash in operating mode (5) mvr voltage regulator of f (4) w akeup time active halt mode to run mode (3) wakeup) 50 (6) hsi (after flash in power-down mvr voltage regulator w akeup time active halt mode to run wakeup) mode (5) of f (4) mode (3) 52 flash in operating mode (5) w akeup time from halt mode to run t wu(h) 54 flash in power-down mode (5) mode (3) (1) data guaranteed by design, not tested in production. (2) t wu(wfi) = 2 x 1/f master + x 1/f cpu. docid018576 rev 3 56 / 100 stm8s003k3 stm8S003F3 electrical characteristics (3) measured from interrupt event to interrupt vector fetch. (4) configured by the regah bit in the clk_ickr register . (5) configured by the ahal t bit in the flash_cr1 register . (6) plus 1 lsi clock depending on synchronization. t otal current consumption and timing in forced reset state 9.3.2.6 t able 29: t otal current consumption and timing in forced reset state unit max (1) t yp conditions parameter symbol a 400 v dd = 5 v supply current in reset state (2) i dd(r) 300 v dd = 3.3 v s 150 reset pin release to vector fetch t resetbl (1) data guaranteed by design, not tested in production. (2) characterized with all i/os tied to v ss . current consumption of on-chip peripherals 9.3.2.7 subject to general operating conditions for v dd and t a . hsi internal rc/f cpu = f master = 16 mhz, v dd = 5 v t able 30: peripheral current consumption unit t yp. parameter symbol a 210 tim1 supply current (1) i dd(tim1) 130 tim2 supply current (1) i dd(tim2) 50 tim4 timer supply current (1) i dd(tim4) 120 uar t1 supply current (2) i dd(uar t1) 45 spi supply current (2) i dd(spi) 65 i 2 c supply current (2) i dd(i 2 c) 1000 adc1 supply current when converting (3) i dd(adc1) 57 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 (1) data based on a dif ferential i dd measurement between reset configuration and timer counter running at 16 mhz. no ic/oc programmed (no i/o pads toggling). not tested in production. (2) data based on a dif ferential i dd measurement between the on-chip peripheral when kept under reset and not clocked and the on-chip peripheral when clocked and not kept under reset. no i/o pads toggling. not tested in production. (3) data based on a dif ferential i dd measurement between reset configuration and continuous a/d conversions. not tested in production. current consumption curves 9.3.2.8 the following figures show typical current consumption measured with code executing in ram. figure 1 1: t yp i dd(run) vs. v dd hse user external clock, f cpu = 16 mhz figure 12: t yp i dd(run) vs. f cpu hse user external clock, v dd = 5 v docid018576 rev 3 58 / 100 stm8s003k3 stm8S003F3 electrical characteristics figure 13: t yp i dd(run) vs. v dd hsi rc osc, f cpu = 16 mhz figure 14: t yp i dd(wfi) vs. v dd hse user external clock, f cpu = 16 mhz 59 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 figure 15: t yp i dd(wfi) vs. f cpu hse user external clock, v dd = 5 v figure 16: t yp i dd(wfi) vs. v dd hsi rc osc, f cpu = 16 mhz external clock sources and timing characteristics 9.3.3 hse user external clock subject to general operating conditions for v dd and t a . t able 31: hse user external clock characteristics unit max min conditions parameter symbol mhz 16 0 user external clock source frequency f hse_ext v v dd + 0.3 v 0.7 x v dd oscin input pin high level voltage v hseh (1) 0.3 x v dd v ss oscin input pin low level voltage v hsel (1) a +1 -1 v ss < v in < v dd oscin input leakage current i leak_hse docid018576 rev 3 60 / 100 stm8s003k3 stm8S003F3 electrical characteristics (1) data based on characterization results, not tested in production. figure 17: hse external clock source hse crystal/ceramic resonator oscillator the hse clock can be supplied with a 1 to 16 mhz crystal/ceramic resonator oscillator . all the information given in this paragraph is based on characterization results with specified typical external components. in the application, the resonator and the load capacitors have to be placed as close as possible to the oscillator pins in order to minimize output distortion and start-up stabilization time. refer to the crystal resonator manufacturer for more details (frequency , package, accuracy ...). t able 32: hse oscillator characteristics unit max t yp min conditions parameter symbol mhz 16 1 external high speed oscillator frequency f hse k? 220 feedback resistor r f pf 20 recommended load capacitance (2) c (1) ma 6 (startup) c = 20 pf , hse oscillator power consumption i dd(hse) 1.6 (stabilized) (3) f osc = 16 mhz 6 (startup) c = 10 pf , 1.2 (stabilized) (3) f osc =16 mhz ma/v 5 oscillator transconductance g m ms 1 v dd is stabilized startup time t su(hse) (4) 61 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 v hseh v hsel exter nal cloc k source oscin f hse stm8 (1) c is approximately equivalent to 2 x crystal cload. (2) the oscillator selection can be optimized in terms of supply current using a high quality resonator with small r m value. refer to crystal manufacturer for more details (3) data based on characterization results, not tested in production. (4) t su(hse) is the start-up time measured from the moment it is enabled (by software) to a stabilized 16 mhz oscillation is reached. this value is measured for a standard crystal resonator and it can vary significantly with the crystal manufacturer . figure 18: hse oscillator circuit diagram hse oscillator critical g m equation g mcrit = (2 f hse ) 2 r m (2co + c) 2 r m : notional resistance (see crystal specification) l m : notional inductance (see crystal specification) c m : notional capacitance (see crystal specification) co: shunt capacitance (see crystal specification) c l1 = c l2 = c: grounded external capacitance g m >> g mcrit internal clock sources and timing characteristics 9.3.4 subject to general operating conditions for v dd and t a . high speed internal rc oscillator (hsi) t able 33: hsi oscillator characteristics unit max t yp min conditions parameter symbol mhz 16 frequency f hsi docid018576 rev 3 62 / 100 stm8s003k3 stm8S003F3 electrical characteristics oscout oscin f hse to core c l1 c l2 r f stm8 resonator consumption control g m r m c m l m c o resonator unit max t yp min conditions parameter symbol % 1.0 (3) user-trimmed with clk_hsitrimr register for accuracy of hsi oscillator acc hsi given v dd and t a conditions (1) 5 -5 v dd = 5 v , -40 c t a 85 c accuracy of hsi oscillator (factory calibrated) s 1.0 (3) hsi oscillator wakeup time t su(hsi) including calibration a 250 (2) 170 hsi oscillator power i dd(hsi) consumption (1) refer to application note. (2) data based on characterization results, not tested in production. (3) guaranteed by design, not tested in production. figure 19: t ypical hsi frequency variation vs v dd @ 4 temperatures 63 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 low speed internal rc oscillator (lsi) subject to general operating conditions for v dd and t a . t able 34: lsi oscillator characteristics unit max t yp parameter symbol khz 128 frequency f lsi s 7 lsi oscillator wake-up time t su(lsi) a 5 lsi oscillator power consumption i dd(lsi) figure 20: t ypical lsi frequency variation vs v dd @ 4 temperatures memory characteristics 9.3.5 ram and hardware registers t able 35: ram and hardware registers unit min conditions parameter symbol v v it-max (2) halt mode (or reset) data retention mode (1) v rm (1) minimum supply voltage without losing data stored in ram (in halt mode or under reset) or in hardware registers (only in halt mode). guaranteed by design, not tested in production. (2) refer to the operating conditions section for the value of v it-max docid018576 rev 3 64 / 100 stm8s003k3 stm8S003F3 electrical characteristics flash program memory and data eeprom t able 36: flash program memory and data eeprom unit max t yp min (1) conditions parameter symbol v 5.5 2.95 f cpu 16 mhz operating voltage (all modes, execution/ write/erase) v dd ms 6.6 6 standard programming time (including erase) for t prog byte/word/block (1 byte/ 4 bytes/64 bytes) 3.33 3 fast programming time for 1 block (64 bytes) 3.33 3 erase time for 1 block (64 bytes) t erase cycles 100 t a = 85 c erase/write cycles (2) (program memory) n r w 100 k erase/write cycles (2) (data memory) years 20 t ret = 55c data retention (program memory) after 100 erase/write cycles at t a = 85 c t ret 20 data retention (data memory) after 10 k erase/write cycles at t a = 85 c 1 t ret = 85c data retention (data memory) after 100 k erase/write cycles at t a = 85 c ma 2 supply current (flash programming or erasing i dd for 1 to 128 bytes) 65 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 (1) data based on characterization results, not tested in production. (2) the physical granularity of the memory is 4 bytes, so cycling is performed on 4 bytes even when a write/erase operation addresses a single byte. i/o port pin characteristics 9.3.6 general characteristics subject to general operating conditions for v dd and t a unless otherwise specified. all unused pins must be kept at a fixed voltage: using the output mode of the i/o for example or an external pull-up or pull-down resistor . t able 37: i/o static characteristics unit max t yp min conditions parameter symbol v 0.3 x v dd -0.3 v v dd = 5 v input low level voltage v il v dd + 0.3 0.7 x v dd input high level voltage v ih mv 700 hysteresis (1) v hys k 80 55 30 v dd = 5 v , v in = v ss pull-up resistor r pu ns 20 (2) fast i/os load = 50 pf rise and fall time (10 % - 90 %) t r , t f 125 (2) standard and high sink i/os load = 50 pf a 1 (2) v ss v in v dd digital input leakage current i lkg na 250 (2) v ss v in v dd analog input leakage current i lkg ana a 1 (2) injection current 4 ma leakage current in adjacent i/o i lkg(inj) (1) hysteresis voltage between schmitt trigger switching levels. based on characterization results, not tested in production. (2) data based on characterisation results, not tested in production. docid018576 rev 3 66 / 100 stm8s003k3 stm8S003F3 electrical characteristics figure 21: t ypical v il and v ih vs v dd @ 4 temperatures figure 22: t ypical pull-up resistance vs v dd @ 4 temperatures 67 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 figure 23: t ypical pull-up current vs v dd @ 4 temperatures t able 38: output driving current (standard ports) unit max min conditions parameter symbol v 2.0 i io = 10 ma, v dd = 5 v output low level with 8 pins sunk v ol 1.0 (1) i io = 4 ma, v dd = 3.3 v output low level with 4 pins sunk 2.8 i io = 10 ma, v dd = 5 v output high level with 8 pins sourced v oh 2.1 (1) i io = 4 ma, v dd = 3.3 v output high level with 4 pins sourced (1) data based on characterization results, not tested in production t able 39: output driving current (true open drain ports) unit max conditions parameter symbol v 1 .0 i io = 10 ma, v dd = 5 v output low level with 2 pins sunk v ol 1.5 (1) i io = 10 ma, v dd = 3.3 v output low level with 2 pins sunk v ol docid018576 rev 3 68 / 100 stm8s003k3 stm8S003F3 electrical characteristics unit max conditions parameter symbol 2.0 (1) i io = 20 ma, v dd = 5 v output low level with 2 pins sunk v ol (1) data based on characterization results, not tested in production t able 40: output driving current (high sink ports) unit max min conditions parameter symbol v 0.8 i io = 10 ma, v dd = 5 v output low level with 8 pins sunk v ol v 1.0 (1) i io = 10 ma, v dd = 3.3 v output low level with 4 pins sunk v ol 1.5 (1) i io = 20 ma, v dd = 5 v output low level with 4 pins sunk 4.0 i io = 10 ma, v dd = 5 v output high level with 8 pins sourced v oh 2.1 (1) i io = 10 ma, v dd = 3.3 v output high level with 4 pins sourced 3.3 (1) i io = 20 ma, v dd = 5 v output high level with 4 pins sourced (1) data based on characterization results, not tested in production 69 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 figure 24: t yp. v ol @ v dd = 5 v (standard ports) figure 25: t yp. v ol @ v dd = 3.3 v (standard ports) docid018576 rev 3 70 / 100 stm8s003k3 stm8S003F3 electrical characteristics figure 26: t yp. v ol @ v dd = 5 v (true open drain ports) figure 27: t yp. v ol @ v dd = 3.3 v (true open drain ports) 71 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 figure 28: t yp. v ol @ v dd = 5 v (high sink ports) figure 29: t yp. v ol @ v dd = 3.3 v (high sink ports) docid018576 rev 3 72 / 100 stm8s003k3 stm8S003F3 electrical characteristics figure 30: t yp. v dd - v oh @ v dd = 5 v (standard ports) figure 31: t yp. v dd - v oh @ v dd = 3.3 v (standard ports) 73 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 figure 32: t yp. v dd - v oh @ v dd = 5 v (high sink ports) figure 33: t yp. v dd - v oh @ v dd = 3.3 v (high sink ports) reset pin characteristics 9.3.7 subject to general operating conditions for v dd and t a unless otherwise specified. t able 41: nrst pin characteristics unit max t yp min conditions parameter symbol v 0.3 x v dd -0.3 v nrst input low v il(nrst) docid018576 rev 3 74 / 100 stm8s003k3 stm8S003F3 electrical characteristics unit max t yp min conditions parameter symbol level voltage (1) v dd + 0.3 0.7 x v dd i ol =2 ma nrst input high v ih(nrst) level voltage (1) 0.5 nrst output low v ol(nrst) level voltage (1) k 80 55 30 nrst pull-up r pu(nrst) resistor (2) ns 75 nrst input filtered t i fp(nrst) pulse (3) 500 nrst input not t in fp(nrst) filtered pulse (3) s 20 nrst output pulse (3) t op(nrst) (1) data based on characterization results, not tested in production. (2) the r pu pull-up equivalent resistor is based on a resistive transistor (3) data guaranteed by design, not tested in production. 75 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 figure 34: t ypical nrst v il and v ih vs v dd @ 4 temperatures figure 35: t ypical nrst pull-up resistance vs v dd @ 4 temperatures docid018576 rev 3 76 / 100 stm8s003k3 stm8S003F3 electrical characteristics figure 36: t ypical nrst pull-up current vs v dd @ 4 temperatures the reset network shown in the following figure protects the device against parasitic resets. the user must ensure that the level on the nrst pin can go below v il(nrst) max. (see #unique_55/cd662 ), otherwise the reset is not taken into account internally . for power consumption sensitive applications, the external reset capacitor value can be reduced to limit the charge/discharge current. if nrst signal is used to reset external circuitry , attention must be taken to the charge/discharge time of the external capacitor to fulfill the external devices reset timing conditions. minimum recommended capacity is 10 nf . figure 37: recommended reset pin protection spi serial peripheral interface 9.3.8 unless otherwise specified, the parameters given in the following table are derived from tests performed under ambient temperature, f master frequency and v dd supply voltage conditions. t master = 1/f master . refer to i/o port characteristics for more details on the input/output alternate function characteristics (nss, sck, mosi, miso). 77 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 0 . 1 f ext e r na l rese t circui t stm8 f i l t e r r pu v dd i n t e r n al r e s e t nr s t (optio n a l ) t able 42: spi characteristics unit max min conditions (1) parameter symbol mhz 8 0 master mode spi clock frequency f sck 1/ t c(sck) mhz 7 (2) 0 spi clock frequency f sck 1/ t c(sck) f sck 1/ t c(sck) ns 25 capacitive load: c = 30 pf spi clock rise and fall time t r(sck) t f(sck) 4 x t master slave mode nss setup time t su(nss) (3) 70 slave mode nss hold time t h(nss) (3) t sck / 2 +15 t sck / 2 - 15 master mode sck high and low time t w(sckh) (3) t w(sckl) (3) 5 master mode data input setup time t su(mi) (3) t su(si) (3) 5 slave mode 7 master mode data input hold time t h(mi) (3) t h(si) (3) 10 slave mode 3 x t master slave mode data output access time t a(so) (3) (4) 25 slave mode data output disable time t dis(so) (3) (5) 65 (2) slave mode (after enable edge) data output valid time t v(so) (3) 30 master mode (after enable edge) data output valid time t v(mo) (3) 27 (2) slave mode (after enable edge) data output hold time t h(so) (3) 1 1 (2) master mode (after enable edge) data output hold time t h(mo) (3) docid018576 rev 3 78 / 100 stm8s003k3 stm8S003F3 electrical characteristics (1) parameters are given by selecting 10 mhz i/o output frequency . (2) data characterization in progress. (3) v alues based on design simulation and/or characterization results, and not tested in production. (4) min time is for the minimum time to drive the output and the max time is for the maximum time to validate the data. (5) min time is for the minimum time to invalidate the output and the max time is for the maximum time to put the data in hi-z. figure 38: spi timing diagram - slave mode and cpha = 0 figure 39: spi timing diagram - slave mode and cpha = 1 1. measurement points are made at cmos levels: 0.3 vdd and 0.7 vdd. 79 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 ai14135 sck input c p h a =1 m o s i i n p u t m i s o o u t p u t c p h a =1 m s b o u t m s b i n b i t 6 o u t l s b i n l s b o u t c p o l = 0 c p o l = 1 b i t 1 i n t su(nss) t c(sck) t h(nss) t a(so) t w(sckh) t w(sckl) t v(so) t h(so) t r(sck) t f(sck) t dis(so) t su(si) t h(si) nss input ai14134 sck input c p h a = 0 m o s i i n p u t m i s o o u t p u t c p h a = 0 m s b o u t m s b i n b i t 6 o u t l s b i n l s b o u t c p o l = 0 c p o l = 1 b i t 1 i n n s s input t su(nss) t c(sck) t h(nss) t a(so) t w(sckh) t w(sckl) t v(so) t h(so) t r(sck) t f(sck) t dis(so) t su(si) t h(si) figure 40: spi timing diagram - master mode (1) 1. measurement points are made at cmos levels: 0.3 vdd and 0.7 vdd. i 2 c interface characteristics 9.3.9 t able 43: i 2 c characteristics unit fast mode i 2 c (1) standard mode i 2 c parameter symbol max (2) min (2) max (2) min (2) s 1.3 4.7 scl clock low time t w(scll) 0.6 4.0 scl clock high time t w(sclh) ns 100 250 sda setup time t su(sda) 900 (3) 0 (4) 0 (3) sda data hold time t h(sda) 300 1000 sda and scl rise time t r(sda) t r(scl) 300 300 sda and scl fall time t f(sda) t f(scl) s 0.6 4.0 st ar t condition hold time t h(st a) 0.6 4.7 repeated st ar t condition setup time t su(st a) docid018576 rev 3 80 / 100 stm8s003k3 stm8S003F3 electrical characteristics ai14136b sck intput c p h a = 0 m o s i out u t m i s o in p u t c p h a = 0 m s bin m s b out b i t 6 in l s b out l s b in c p o l = 0 c p o l = 1 b i t 1 out n s s input t c(sck) t w(sckh) t w(sckl) t r(sck) t f(sck) t h(mi) high sck output c p h a =1 c p h a =1 c p o l = 0 c p o l = 1 t su(mi) t v(mo) t h(mo) unit fast mode i 2 c (1) standard mode i 2 c parameter symbol max (2) min (2) max (2) min (2) 0.6 4.0 st op condition setup time t su(st o) s 1.3 4.7 st op to st ar t condition time (bus free) t w(st o:st a) pf 400 400 capacitive load for each bus line c b (1) f master , must be at least 8 mhz to achieve max fast i 2 c speed (400khz) (2) data based on standard i 2 c protocol requirement, not tested in production (3) the maximum hold time of the start condition has only to be met if the interface does not stretch the low time (4) the device must internally provide a hold time of at least 300 ns for the sda signal in order to bridge the undefined region of the falling edge of scl figure 41: t ypical application with i 2 c bus and timing diagram 1. measurement points are made at cmos levels: 0.3 x vdd and 0.7 x vdd. 10-bit adc characteristics 9.3.10 subject to general operating conditions for v dd , f master , and t a unless otherwise specified. 81 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 t f ( s d a ) t r ( s d a ) t s u (s d a ) t h ( s d a ) t f( s c l ) t r ( s c l ) t w ( s c ll ) t w ( s c l h ) t h ( s t a ) t s u ( s t o ) t s u ( s t a) t w ( s t o :s t a ) sd a scl 4 . 7 k ? s d a s c l 1 0 0 ? 1 0 0 ? 4. 7 k ? i 2 c b u s st ar t st ar t st op repea ted st ar t stm8s v dd v dd ai17490 t able 44: adc characteristics unit max t yp min conditions parameter symbol mhz 4 1 v dd =2.95 to 5.5 v adc clock frequency f adc 6 1 v dd =4.5 to 5.5 v v v dd v ss conversion voltage range (1) v ain pf 3 internal sample and hold capacitor c adc s 0.75 f adc = 4 mhz minimum sampling time t s (1) 0.5 f adc = 6 mhz s 7 w ake-up time from standby t st ab s 3.5 f adc = 4 mhz minimum total conversion time (including sampling time, 10-bit resolution) t conv s 2.33 f adc = 6 mhz 1/f adc 14 (1) during the sample time the input capacitance c ain (3 pf max) can be charged/discharged by the external source. the internal resistance of the analog source must allow the capacitance to reach its final voltage level within t s. after the end of the sample time t s , changes of the analog input voltage have no ef fect on the conversion result. v alues for the sample clock t s depend on programming. t able 45: adc accuracy with r ain < 10 k , v dd = 5 v unit max (1) t yp conditions parameter symbol lsb 3.5 1.6 f adc = 2 mhz t otal unadjusted error (2) |e t | 4 2.2 f adc = 4 mhz 4.5 2.4 f adc = 6 mhz 2.5 1.1 f adc = 2 mhz of fset error (2) |e o | docid018576 rev 3 82 / 100 stm8s003k3 stm8S003F3 electrical characteristics unit max (1) t yp conditions parameter symbol 3 1.5 f adc = 4 mhz 3 1.8 f adc = 6 mhz 3 1.5 f adc = 2 mhz gain error (2) |e g | 3 2.1 f adc = 4 mhz 4 2.2 f adc = 6 mhz 1.5 0.7 f adc = 2 mhz dif ferential linearity error (2) |e d | 1.5 0.7 f adc = 4 mhz 1.5 0.7 f adc = 6 mhz 1.5 0.6 f adc = 2 mhz integral linearity error (2) |e l | 2 0.8 f adc = 4 mhz 2 0.8 f adc = 6 mhz (1) data based on characterization results, not tested in production. (2) adc accuracy vs. negative injection current: injecting negative current on any of the analog input pins should be avoided as this significantly reduces the accuracy of the conversion being performed on another analog input. it is recommended to add a schottky diode (pin to ground) to standard analog pins which may potentially inject negative current. any positive injection current within the limits specified for i inj(pin) and i inj(pin) in the i/o port pin characteristics section does not af fect the adc accuracy . t able 46: adc accuracy with r ain < 10 k r ain , v dd = 3.3 v unit max (1) t yp conditions parameter symbol lsb 3.5 1.6 f adc = 2 mhz t otal unadjusted error (2) |e t | 4 1.9 f adc = 4 mhz 2.5 1 f adc = 2 mhz of fset error (2) |e o | 83 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 unit max (1) t yp conditions parameter symbol 2.5 1.5 f adc = 4 mhz 3 1.3 f adc = 2 mhz gain error (2) |e g | 3 2 f adc = 4 mhz 1 0.7 f adc = 2 mhz dif ferential linearity error (2) |e d | 1.5 0.7 f adc = 4 mhz 1.5 0.6 f adc = 2 mhz integral linearity error (2) |e l | 2 0.8 f adc = 4 mhz (1) data based on characterization results, not tested in production. (2) adc accuracy vs. negative injection current: injecting negative current on any of the analog input pins should be avoided as this significantly reduces the accuracy of the conversion being performed on another analog input. it is recommended to add a schottky diode (pin to ground) to standard analog pins which may potentially inject negative current. any positive injection current within the limits specified for i inj(pin) and i inj(pin) in i/o port pin characteristics does not af fect the adc accuracy . figure 42: adc accuracy characteristics 1. example of an actual transfer curve. 2. the ideal transfer curve docid018576 rev 3 84 / 100 stm8s003k3 stm8S003F3 electrical characteristics 3. end point correlation line e t = t otal unadjusted error: maximum deviation between the actual and the ideal transfer curves. e o = of fset error: deviation between the first actual transition and the first ideal one. e g = gain error: deviation between the last ideal transition and the last actual one. e d = dif ferential linearity error: maximum deviation between actual steps and the ideal one. e l = integral linearity error: maximum deviation between any actual transition and the end point correlation line. figure 43: t ypical application with adc emc characteristics 9.3.1 1 susceptibility tests are performed on a sample basis during product characterization. functional ems (electromagnetic susceptibility) 9.3.1 1.1 while executing a simple application (toggling 2 leds through i/o ports), the product is stressed by two electromagnetic events until a failure occurs (indicated by the leds). ? fesd: functional electrostatic discharge (positive and negative) is applied on all pins of the device until a functional disturbance occurs. this test conforms with the iec 61000-4-2 standard. ? ftb: a burst of fast transient voltage (positive and negative) is applied to v dd and v ss through a 100 pf capacitor , until a functional disturbance occurs. this test conforms with the iec 61000-4-4 standard. a device reset allows normal operations to be resumed. the test results are given in the table below based on the ems levels and classes defined in application note an1709 (emc design guide for stmicrocontrollers). designing hardened software to avoid noise problems 9.3.1 1.2 emc characterization and optimization are performed at component level with a typical application environment and simplified mcu software. it should be noted that good emc performance is highly dependent on the user application and the software in particular . therefore it is recommended that the user applies emc software optimization and prequalification tests in relation with the emc level requested for his application. 85 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 stm8 10-bit a/d con v ersion r ain c ain v ain ainx v dd v t 0.6 v v t 0.6 v i l 1 a c adc prequalification trials most of the common failures (unexpected reset and program counter corruption) can be recovered by applying a low state on the nrst pin or the oscillator pins for 1 second. t o complete these trials, esd stress can be applied directly on the device, over the range of specification values. when unexpected behavior is detected, the software can be hardened to prevent unrecoverable errors occurring. see application note an1015 (software techniques for improving microcontroller emc performance). t able 47: ems data level/ class conditions parameter symbol 2/b (1) v dd = 3.3 v , t a = 25 c, f master = 16 mhz (hsi clock), conforming to iec 61000-4-2 v oltage limits to be applied on any i/o pin to induce a functional disturbance v fesd 4/a (1) v dd = 3.3 v , t a = 25 c ,f master = 16 mhz (hsi clock),conforming to iec 61000-4-4 fast transient voltage burst limits to be applied through 100 pf on v dd v eftb and v ss pins to induce a functional disturbance (1) data obtained with hsi clock configuration, after applying hw recommendations described in an2860 (emc guidelines for stm8s microcontrollers). electromagnetic interference (emi) 9.3.1 1.3 based on a simple application running on the product (toggling 2 leds through the i/o ports), the product is monitored in terms of emission. this emission test is in line with the norm sae iec 61967-2 which specifies the board and the loading of each pin. t able 48: emi data unit conditions parameter symbol max f hse /f cpu (1) monitored frequency band general conditions 16 mhz/ 16 mhz 16 mhz/ 8 mhz dbv 5 5 0.1 mhz to v dd = 5 v t a = 25 c peak level s emi 30 mhz lqfp32 package 5 4 30 mhz to docid018576 rev 3 86 / 100 stm8s003k3 stm8S003F3 electrical characteristics unit conditions parameter symbol max f hse /f cpu (1) monitored frequency band general conditions 16 mhz/ 16 mhz 16 mhz/ 8 mhz conforming to sae iec 61967-2 130 mhz 5 5 130 mhz to 1 ghz 2.5 2.5 sae emi level sae emi level (1) data based on characterisation results, not tested in production. absolute maximum ratings (electrical sensitivity) 9.3.1 1.4 based on three dif ferent tests (esd, dlu and lu) using specific measurement methods, the product is stressed to determine its performance in terms of electrical sensitivity . for more details, refer to the application note an1 181. electrostatic discharge (esd) 9.3.1 1.5 electrostatic discharges (a positive then a negative pulse separated by 1 second) are applied to the pins of each sample according to each pin combination. the sample size depends on the number of supply pins in the device (3 parts*(n+1) supply pin). one model can be simulated: human body model. this test conforms to the jesd22-a1 14a/a1 15a standard. for more details, refer to the application note an1 181. t able 49: esd absolute maximum ratings unit maximum value (1) class conditions ratings symbol v 4000 a t a = 25c, conforming to electrostatic discharge v esd(hbm) jesd22-a1 14 voltage (human body model) 1000 iv t a lqfp32 package = electrostatic discharge v esd(cdm) 25c, conforming to voltage sd22-c101 (charge device model) 87 / 100 docid018576 rev 3 electrical characteristics stm8s003k3 stm8S003F3 (1) data based on characterization results, not tested in production static latch-up 9.3.1 1.6 t wo complementary static tests are required on 10 parts to assess the latch-up performance: ? a supply overvoltage (applied to each power supply pin) ? a current injection (applied to each input, output and configurable i/o pin) are performed on each sample. this test conforms to the eia/jesd 78 ic latch-up standard. for more details, refer to the application note an1 181. t able 50: electrical sensitivities class (1) conditions parameter symbol a t a = 25 c static latch-up class lu a t a = 85 c (1) class description: a class is an stmicroelectronics internal specification. all its limits are higher than the jedec specifications, that means when a device belongs to class a it exceeds the jedec standard. b class strictly covers all the jedec criteria (international standard). docid018576 rev 3 88 / 100 stm8s003k3 stm8S003F3 electrical characteristics package information 10 in order to meet environmental requirements, st of fers these devices in dif ferent grades of ecop ack ? packages, depending on their level of environmental compliance. ecop ack ? specifications, grade definitions and product status are available at: www .st.com. ecop ack ? is an st trademark. 32-pin lqfp package mechanical data 10.1 figure 44: 32-pin low profile quad flat package (7 x 7) t able 51: 32-pin low profile quad flat package mechanical data inches (1) mm dim. max t yp min max t yp min 0.0630 1.600 a 0.0059 0.0020 0.150 0.050 a1 0.0571 0.0551 0.0531 1.450 1.400 1.350 a2 0.0177 0.0146 0.01 18 0.450 0.370 0.300 b 0.0079 0.0035 0.200 0.090 c 0.3622 0.3543 0.3465 9.200 9.000 8.800 d 0.2835 0.2756 0.2677 7.200 7.000 6.800 d1 89 / 100 docid018576 rev 3 package information stm8s003k3 stm8S003F3 5v_me l a1 k l1 c a a2 ccc c d d1 d3 e3 e1 e 16 17 24 25 b 32 1 pin 1 identification 8 9 inches (1) mm dim. max t yp min max t yp min 0.2205 5.600 d3 0.3622 0.3543 0.3465 9.200 9.000 8.800 e 0.2835 0.2756 0.2677 7.200 7.000 6.800 e1 0.2205 5.600 e3 0.0315 0.800 e 0.0295 0.0236 0.0177 0.750 0.600 0.450 l 0.0394 1.000 l1 7.0 3.5 0.0 7.0 3.5 0.0 k 0.0039 0.100 ccc (1) v alues in inches are converted from mm and rounded to 4 decimal digits 20-pin tssop package mechanical data 10.2 figure 45: 20-pin, 4.40 mm body , 0.65 mm pitch docid018576 rev 3 90 / 100 stm8s003k3 stm8S003F3 package information y a_me 1 20 cp c l e e1 d a2 a k e b 10 11 a1 l1 aaa t able 52: 20-pin, 4.40 mm body , 0.65 mm pitch mechanical data inches (1) mm dim. max t yp min max t yp min 0.0472 1.200 a 0.0059 0.0020 0.150 0.050 a1 0.0413 0.0394 0.0315 1.050 1.000 0.800 a2 0.01 18 0.0075 0.300 0.190 b 0.0079 0.0035 0.200 0.090 c 0.2598 0.2559 0.2520 6.600 6.500 6.400 d 0.2598 0.2520 0.2441 6.600 6.400 6.200 e 0.1772 0.1732 0.1693 4.500 4.400 4.300 e1 0.0256 0.650 e 0.0295 0.0236 0.0177 0.750 0.600 0.450 l 0.0394 1.000 l1 8.0 0.0 8.0 0.0 k 0.0039 0.100 aaa (1) v alues in inches are converted from mm and rounded to 4 decimal digits 91 / 100 docid018576 rev 3 package information stm8s003k3 stm8S003F3 20-lead ufqfpn package mechanical data 10.3 figure 46: 20-lead ultra thin fine pitch quad flat no-lead package outline (3x3) 1. drawing is not to scale. t able 53: 20-lead ultra thin fine pitch quad flat no-lead package (3x3) mechanical data inches (1) mm dim. max t yp min max t yp min 0.1 181 3.000 d 0.1 181 3.000 e 0.0236 0.0217 0.0197 0.600 0.550 0.500 a 0.0020 0.0008 0.0000 0.050 0.020 0.000 a1 0.0060 0.152 a3 0.0197 0.500 e 0.0236 0.0217 0.0197 0.600 0.550 0.500 l1 0.0157 0.0138 0.01 18 0.400 0.350 0.300 l2 0.0059 0.150 l3 0.0079 0.200 l4 0.01 18 0.0098 0.0071 0.300 0.250 0.180 b docid018576 rev 3 92 / 100 stm8s003k3 stm8S003F3 package information 103_a0a5_me 11 15 16 20 1 5 d e b e e a1 a ddd l2 10 l1 a3 l3 l4 d e t op view side view bo tt om view pin 1 inches (1) mm dim. max t yp min max t yp min 0.0020 0.050 ddd (1) v alues in inches are converted from mm and rounded to 4 decimal digits. 93 / 100 docid018576 rev 3 package information stm8s003k3 stm8S003F3 thermal characteristics 1 1 the maximum chip junction temperature (t j max ) must never exceed the values given in operating conditions . the maximum chip-junction temperature, t jmax , in degrees celsius, may be calculated using the following equation: t jmax = t amax + (p dmax x ja ) where: ? t amax is the maximum ambient temperature in c ? ja is the package junction-to-ambient thermal resistance in c/w ? p dmax is the sum of p intmax and p i/omax (pdmax = p intmax + p i/omax ) ? p intmax is the product of i dd andv dd , expressed in w atts. this is the maximum chip internal power . ? p i/omax represents the maximum power dissipation on output pins where: p i/omax = (v ol *i ol ) + ((v dd -v oh )*i oh ), taking into account the actual v ol /i ol and v oh /i oh of the i/os at low and high level in the application. t able 54: thermal characteristics unit v alue parameter (1) symbol c/w 84 thermal resistance junction-ambient tssop20 - 4.4 mm ja 90 thermal resistance junction-ambient ja ufqfpn20 - 3 x 3 mm 60 thermal resistance junction-ambient lqfp32 - 7 x 7 mm ja (1) thermal resistances are based on jedec jesd51-2 with 4-layer pcb in a natural convection environment. reference document 1 1.1 jesd51-2 integrated circuits thermal test method environment conditions - natural convection (still air). a vailable from www .jedec.org. selecting the product temperature range 1 1.2 when ordering the microcontroller , the temperature range is specified in the order code. docid018576 rev 3 94 / 100 stm8s003k3 stm8S003F3 thermal characteristics the following example shows how to calculate the temperature range needed for a given application. assuming the following application conditions: ? maximum ambient temperature t amax = 75 c (measured according to jesd51-2) ? i ddmax = 8 ma, v dd = 5 v ? maximum 20 i/os used at the same time in output at low level with i ol = 8 ma, v ol = 0.4 v p intmax = 8 ma x 5 v = 400 mw amax ? p dmax = 400 mw + 64 mw thus: p dmax = 464 mw t jmax for lqfp32 can be calculated as follows, using the thermal resistance ja : t jmax = 75 c + (60 c/w x 464 mw) = 75 c + 27.8 c = 102.8 c this is within the range of the suf fix 6 version parts (-40 < t j < 105 c). in this case, parts must be ordered at least with the temperature range suf fix 6. 95 / 100 docid018576 rev 3 thermal characteristics stm8s003k3 stm8S003F3 ordering information 12 figure 47: stm8s003x value line ordering information scheme 1. tssop and ufqfpn package. 2. lqfp package. for a list of available options (e.g. package, packing) and orderable part numbers or for further information on any aspect of this device, please go to www .st.com or contact the st sales of fice nearest to you. docid018576 rev 3 96 / 100 stm8s003k3 stm8S003F3 ordering information pin count k = 32 pins f = 20 pins example: sub-f amily type 00x = v alue line 003 sub-f amily f amily type s = standard t emper ature r ange 6 = -40 c to 85 c prog r am memor y siz e 3 = 8 kb ytes p ac king no char acter = t r a y or tube tr = t ape and reel p ac kage pitch blank = 0.5 or 0.65 mm( 1) c = 0.8 mm (2) stm8 s 003 k 3 t 6 tr product class stm8 microcontroller p ac kage type 1 p = tssop t = lqfp u = ufqfpn stm8 development tools 13 development tools for the stm8 microcontrollers include the full-featured st ice emulation system supported by a complete software tool package including c compiler , assembler and integrated development environment with high-level language debugger . in addition, the stm8 is to be supported by a complete range of tools including starter kits, evaluation boards and a low-cost in-circuit debugger/programmer . emulation and in-circuit debugging tools 13.1 the st ice emulation system of fers a complete range of emulation and in-circuit debugging features on a platform that is designed for versatility and cost-ef fectiveness. in addition, stm8 application development is supported by a low-cost in-circuit debugger/programmer . the st ice is the fourth generation of full featured emulators from stmicroelectronics. it of fers new advanced debugging capabilities including profiling and coverage to help detect and eliminate bottlenecks in application execution and dead code when fine tuning an application. in addition, st ice of fers in-circuit debugging and programming of stm8 microcontrollers via the stm8 single wire interface module (swim), which allows non-intrusive debugging of an application while it runs on the target microcontroller . for improved cost ef fectiveness, st ice is based on a modular design that allows you to order exactly what you need to meet your development requirements and to adapt your emulation system to support existing and future st microcontrollers. st ice key features ? occurrence and time profiling and code coverage (new features) ? advanced breakpoints with up to 4 levels of conditions ? data breakpoints ? program and data trace recording up to 128 kb records ? read/write on the fly of memory during emulation ? in-circuit debugging/programming via swim protocol ? 8-bit probe analyzer ? 1 input and 2 output triggers ? power supply follower managing application voltages between 1.62 to 5.5 v ? modularity that allows you to specify the components you need to meet your development requirements and adapt to future requirements ? supported by free software tools that include integrated development environment (ide), programming software interface and assembler for stm8. software tools 13.2 stm8 development tools are supported by a complete, free software package from stmicroelectronics that includes st v isual develop (stvd) ide and the st v isual programmer (stvp) software interface. stvd provides seamless integration of the cosmic and raisonance c compilers for stm8, which are available in a free version that outputs up to 16 kbytes of code. 97 / 100 docid018576 rev 3 stm8 development tools stm8s003k3 stm8S003F3 stm8 toolset 13.2.1 stm8 toolset with stvd integrated development environment and stvp programming software is available for free download at www .st.com/mcu. this package includes: st v isual develop C full-featured integrated development environment from st , featuring ? seamless integration of c and asm toolsets ? full-featured debugger ? project management ? syntax highlighting editor ? integrated programming interface ? support of advanced emulation features for st ice such as code profiling and coverage st v isual programmer (stvp) C easy-to-use, unlimited graphical interface allowing read, write and verify of your stm8 microcontroller s flash program memory , data eeprom and option bytes. stvp also of fers project mode for saving programming configurations and automating programming sequences. c and assembly toolchains 13.2.2 control of c and assembly toolchains is seamlessly integrated into the stvd integrated development environment, making it possible to configure and control the building of your application directly from an easy-to-use graphical interface. a vailable toolchains include: ? cosmic c compiler for stm8 C a vailable in a free version that outputs up to 16 kbytes of code. for more information, see www .cosmic-software.com. ? raisonance c compiler for stm8 C a vailable in a free version that outputs up to 16 kbytes of code. for more information, see www .raisonance.com. ? stm8 assembler linker C free assembly toolchain included in the stvd toolset, which allows you to assemble and link your application source code. programming tools 13.3 during the development cycle, st ice provides in-circuit programming of the stm8 flash microcontroller on your application board via the swim protocol. additional tools are to include a low-cost in-circuit programmer as well as st socket boards, which provide dedicated programming platforms with sockets for programming your stm8. for production environments, programmers will include a complete range of gang and automated programming solutions from third-party tool developers already supplying programmers for the stm8 family . docid018576 rev 3 98 / 100 stm8s003k3 stm8S003F3 stm8 development tools revision history 14 t able 55: document revision history changes revision date initial revision. 1 12-jul-201 1 added n r w and t ret for data eeprom in t able 36: flash program memory and data eeprom . 2 09-jan-2012 updated r pu in t able 41: nrst pin characteristics and t able 37: i/o static characteristics . updated notes related to v cap in t able 18: general operating conditions . updated temperature condition for factory calibrated acc hsi in t able 33: hsi oscillator characteristics . changed sck input to sck output in figure 40: spi timing diagram - master mode(1) 3 12-jun-2012 modified figure 46: 20-lead ultra thin fine pitch quad flat no-lead package outline (3x3) to add package top view . 99 / 100 docid018576 rev 3 revision history stm8s003k3 stm8S003F3 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 anytime, 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 other wise set forth in sts terms and conditions of sale st disclaims any express or implied w arranty with respect t o the use and/or sale of st products including without limit a tion implied w arranties of merchant ability , fitness for a p articular purpose (and their equiv alents under the la ws of any jurisdiction), or infringement of any p a tent , copyright or other intellectual property right . unless expressl y approved in writing by two authorized st represent a tives, st products are not recommended, authorized or w arranted for use in milit ar y , air craft , sp ace, life sa ving, or life sust aining applica tions, nor in products or systems where f ailure or malfunction ma y resul t in personal injur y , dea th, or severe property or environment al damage. st products which are not specified as "aut omotive grade" ma y onl y be used in aut omotive applica tions a t users own risk. resale of st products with provisions dif ferent from the statements and/or technical features set forth in this document shall immediately voidany 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 information previously supplied. the st logo is a registered trademark of stmicroelectronics. all other names are the property of their respective owners. ? 2012 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 docid018576 rev 3 100 / 100 stm8s003k3 stm8S003F3 |
Price & Availability of 8S003F3 |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |