STM8S003K3STM8S003F3Valueline,16MHzSTM8S8-bitMCU,8KbytesFlash,128bytesdataEEPROM,10-bitADC,3timers,UART,SPI,I²CLQFP327x7TSSOP20UFQFPN203x3FeaturesCore•16MHzadvancedSTM8corewithHarvardarchitectureand3-stagepipeline•ExtendedinstructionsetMemories•Programmemory:8KbytesFlash;dataretention20yearsat55°Cafter100cycles•RAM:1Kbytes•Datamemory:128bytesoftruedataEEPROM;enduranceupto100000write/erasecyclesClock,resetandsupplymanagement•2.95to5.5Voperatingvoltage•Flexibleclockcontrol,4masterclocksources:-Lowpowercrystalresonatoroscillator-Externalclockinput-Internal,user-trimmable16MHzRC-Internallowpower128kHzRC•Clocksecuritysystemwithclockmonitor•Powermanagement:-Lowpowermodes(wait,active-halt,halt)-Switch-offperipheralclocksindividually•Permanentlyactive,lowconsumptionpower-onandpower-downresetInterruptmanagement•Nestedinterruptcontrollerwith32interrupts•Upto27externalinterruptson6vectorsTimers•Advancedcontroltimer:16-bit,4CAPCOMchannels,3complementaryoutputs,dead-timeinsertionandflexiblesynchronization•16-bitgeneralpurposetimer,with3CAPCOMchannels(IC,OCorPWM)•8-bitbasictimerwith8-bitprescaler•Autowake-uptimer•WindowwatchdogandindependentwatchdogtimersCommunicationsinterfaces•UARTwithclockoutputforsynchronousoperation,Smartcard,IrDA,LINmastermode•SPIinterfaceupto8Mbit/s•I2Cinterfaceupto400Kbit/sAnalogtodigitalconverter(ADC)•10-bit,±1LSBADCwithupto5multiplexedchannels,scanmodeandanalogwatchdogI/Os•Upto28I/Osona32-pinpackageincluding21highsinkoutputs•HighlyrobustI/Odesign,immuneagainstcurrentinjectionDevelopmentsupport•Embeddedsinglewireinterfacemodule(SWIM)forfaston-chipprogrammingandnonintrusivedebugging1/100DocID018576Rev3June2012(SWIM)anddebugmodule(DM)..................................104.3Interruptcontroller.......................................................................................................114.4FlashprogrammemoryanddataEEPROM................................................................114.5Clockcontroller............................................................................................................124.6Powermanagement....................................................................................................134.7Watchdogtimers..........................................................................................................134.8Autowakeupcounter...................................................................................................144.9Beeper........................................................................................................................144.10TIM1-16-bitadvancedcontroltimer.........................................................................144.11TIM2-16-bitgeneralpurposetimer..........................................................................154.12TIM4-8-bitbasictimer..............................................................................................154.13Analog-to-digitalconverter(ADC1)............................................................................154.14Communicationinterfaces.........................................................................................164.14.1UART1...............................................................................................164.14.2SPI.....................................................................................................174.14.3I²C......................................................................................................175Pinoutandpindescription...................................................................................185.1STM8S003K3LQFP32pinoutandpindescription......................................................185.2STM8S003F3TSSOP20/UFQFPN20pinoutandpindescription...............................215.2.1STM8S003F3TSSOP20pinoutandpindescription............................215.2.2STM8S003F3UFQFPN20pinout........................................................225.2.3STM8S003F3TSSOP20/UFQFPN20pindescription..........................225.3Alternatefunctionremapping.......................................................................................246Memoryandregistermap.....................................................................................256.1Memorymap......................................................................................................