STM8S903K3STM8S903F316MHzSTM8S8-bitMCU,upto8KbytesFlash,1KbyteRAM,640bytesEEPROM,10-bitADC,2timers,UART,SPI,I²CUFQFPN325x5LQFP327x7SDIP32400milsTSSOP20SO20W300milsUFQFPN203x3FeaturesCore•16MHzadvancedSTM8corewithHarvardarchitectureand3-stagepipeline•ExtendedinstructionsetMemories•Programmemory:8KbytesFlash;dataretention20yearsat55°Cafter10kcycles•Datamemory:640bytestruedataEEPROM;endurance300kcycles•RAM:1KbytesClock,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•Upto28externalinterruptson7vectorsTimers•Advancedcontroltimer:16-bit,4CAPCOMchannels,3complementaryoutputs,dead-timeinsertionandflexiblesynchronization•16-bitgeneralpurposetimer,with3CAPCOMchannels(IC,OCorPWM)•8-bitbasictimerwith8-bitprescaler•Autowakeuptimer•WindowandindependentwatchdogtimersCommunicationsinterfaces•UARTwithclockoutputforsynchronousoperation,Smartcard,IrDA,LINmastermode•SPIinterfaceupto8Mbit/s•I2Cinterfaceupto400Kbit/sAnalogtodigitalconverter(ADC)•10-bit,±1LSBADCwithupto7muxedchannels+1internalchannel,scanmodeandanalogwatchdog•InternalreferencevoltagemeasurementI/Os•Upto28I/Osona32-pinpackageincluding21highsinkoutputs•HighlyrobustI/Odesign,immuneagainstcurrentinjectionDevelopmentsupport•Embeddedsinglewireinterfacemodule(SWIM)forfaston-chipprogrammingandnonintrusivedebuggingUniqueID:96-bitkeyincludinglotnumber1/116DocID15590Rev8June2012(SWIM)anddebugmodule(DM)..................................114.3Interruptcontroller.......................................................................................................124.4FlashprogramanddataEEPROMmemory................................................................124.5Clockcontroller............................................................................................................134.6Powermanagement....................................................................................................144.7Watchdogtimers..........................................................................................................144.8Autowakeupcounter...................................................................................................154.9Beeper........................................................................................................................154.10TIM1-16-bitadvancedcontroltimer.........................................................................154.11TIM5-16-bitgeneralpurposetimer..........................................................................164.12TIM6-8-bitbasictimer..............................................................................................164.13Analog-to-digitalconverter(ADC1)............................................................................164.14Communicationinterfaces.........................................................................................174.14.1UART1...............................................................................................174.14.2SPI.....................................................................................................184.14.3I²C......................................................................................................185Pinoutandpindescription...................................................................................195.1STM8S903F3TSSOP20/SO20pinout........................................................................205.2STM8S903F3UFQFPN20pinout................................................................................215.3TSSOP/SO/UFQFPN20pindescription......................................................................225.4STM8S903K3UFQFPN32/LQFP32/SDIP32pinout....................................................235.5UFQFPN/LQFP/SDIP32pindescription......................................................................245.6Alternatefunctionremapping.......................................................................................266Memoryandregistermap..............................