STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

更新时间:2023-09-04 22:25:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3

Valueline,16MHzSTM8S8-bitMCU,8KbytesFlash,128bytes

dataEEPROM,10-bitADC,3timers,UART,SPI,

I²C

Interruptmanagement

Nestedinterruptcontrollerwith32interrupts

Upto27externalinterruptson6vectors

Timers

Advancedcontroltimer:16-bit,4CAPCOMchannels,3complementaryoutputs,dead-timeinsertionandflexiblesynchronization

Features

Core

16MHzadvancedSTM8corewithHarvardarchitectureand3-stagepipeline

Extendedinstructionset

generalpurposetimer,with3CAPCOM 16-bit

channels(IC,OCorPWM)

8-bitbasictimerwith8-bitprescaler Autowake-uptimer

watchdogandindependentwatchdog Window

timersCommunicationsinterfaces

UARTwithclockoutputforsynchronous

operation,Smartcard,IrDA,LINmastermode

Memories

Programmemory:8KbytesFlash;dataretention20yearsat55°Cafter100cycles

1Kbytes RAM:

memory:128bytesoftruedataEEPROM; Data

enduranceupto100000write/erasecycles

Clock,resetandsupplymanagement2.95to5.5Voperatingvoltage

SPIinterfaceupto8Mbit/s ICinterfaceupto400Kbit/s

2

Analogtodigitalconverter(ADC)

10-bit,±1LSBADCwithupto5multiplexedchannels,scanmodeandanalogwatchdog

clockcontrol,4masterclocksources: Flexible

-Lowpowercrystalresonatoroscillator-Externalclockinput

-Internal,user-trimmable16MHzRC-Internallowpower128kHzRC

Clocksecuritysystemwithclockmonitor

management: Power

-Lowpowermodes(wait,active-halt,halt)-Switch-offperipheralclocksindividually

active,lowconsumptionpower-on Permanently

andpower-downreset

I/Os

Upto28I/Osona32-pinpackageincluding21highsinkoutputs

robustI/Odesign,immuneagainstcurrent Highlyinjection

Developmentsupport

Embeddedsinglewireinterfacemodule(SWIM)forfaston-chipprogrammingandnonintrusivedebugging

June2012

DocID018576Rev3

1/100

http://www.77cn.com.cn

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

ContentsSTM8S003K3STM8S003F3

Contents

1234

Introduction..............................................................................................................7Description...............................................................................................................8Blockdiagram..........................................................................................................9Productoverview...................................................................................................10

4.1CentralprocessingunitSTM8.....................................................................................104.2Singlewireinterfacemodule(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.........................................................................................16

4.14.1UART1...............................................................................................164.14.2SPI.....................................................................................................174.14.3I²C......................................................................................................17

5Pinoutandpindescription...................................................................................18

5.1STM8S003K3LQFP32pinoutandpindescription......................................................185.2STM8S003F3TSSOP20/UFQFPN20pinoutandpindescription...............................21

5.2.1STM8S003F3TSSOP20pinoutandpindescription............................215.2.2STM8S003F3UFQFPN20pinout........................................................225.2.3STM8S003F3TSSOP20/UFQFPN20pindescription..........................22

5.3Alternatefunctionremapping.......................................................................................24

6Memoryandregistermap.....................................................................................25

6.1Memorymap6.2Registermap

6.2.16.2.26.2.3

................................................................................................................25...............................................................................................................26I/Oporthardwareregistermap............................................................26Generalhardwareregistermap..........................................................27CPU/SWIM/debugmodule/interruptcontrollerregisters.....................36

7Interruptvectormapping......................................................................................398Optionbytes...........................................................................................................41

8.1Alternatefunctionremappingbits................................................................................43

2/100DocID018576Rev3

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3Contents

9Electricalcharacteristics......................................................................................46

9.1Parameterconditions...................................................................................................46

9.1.1Minimumandmaximumvalues...........................................................469.1.2Typicalvalues.......................................................................................469.1.3Typicalcurves......................................................................................469.1.4Loadingcapacitor.................................................................................469.1.5Pininputvoltage...................................................................................46

9.2Absolutemaximumratings..........................................................................................479.3Operatingconditions....................................................................................................49

9.3.1VCAPexternalcapacitor......................................................................509.3.2Supplycurrentcharacteristics..............................................................519.3.3Externalclocksourcesandtimingcharacteristics...............................609.3.4Internalclocksourcesandtimingcharacteristics.................................629.3.5Memorycharacteristics........................................................................649.3.6I/Oportpincharacteristics...................................................................669.3.7Resetpincharacteristics......................................................................749.3.8SPIserialperipheralinterface..............................................................77

2

9.3.9ICinterfacecharacteristics.................................................................80

9.3.1010-bitADCcharacteristics..................................................................819.3.11EMCcharacteristics...........................................................................85

10Packageinformation...........................................................................................89

10.132-pinLQFPpackagemechanicaldata....................................................................8910.220-pinTSSOPpackagemechanicaldata..................................................................9010.320-leadUFQFPNpackagemechanicaldata.............................................................92

11Thermalcharacteristics.......................................................................................94

11.1Referencedocument.................................................................................................9411.2Selectingtheproducttemperaturerange..................................................................94

12Orderinginformation...........................................................................................9613STM8developmenttools....................................................................................97

13.1Emulationandin-circuitdebuggingtools...................................................................9713.2Softwaretools............................................................................................................97

13.2.1STM8toolset......................................................................................9813.2.2Candassemblytoolchains................................................................98

13.3Programmingtools....................................................................................................98

14Revisionhistory...................................................................................................99

DocID018576Rev33/100

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

ListoftablesSTM8S003K3STM8S003F3

Listoftables

Table1.STM8S003xxvaluelinefeatures................................................................................................8Table2.PeripheralclockgatingbitassignmentsinCLK_PCKENR1/2registers..................................13Table3.TIMtimerfeatures....................................................................................................................15Table4.Legend/abbreviationsforpinouttables...................................................................................18Table5.LQFP32pindescription............................................................................................................19Table6.STM8S003F3pindescription...................................................................................................22Table7.I/Oporthardwareregistermap................................................................................................26Table8.Generalhardwareregistermap...............................................................................................27Table9.CPU/SWIM/debugmodule/interruptcontrollerregisters.........................................................36Table10.Interruptmapping...................................................................................................................39Table11.Optionbytes...........................................................................................................................99Table12.Optionbytedescription...........................................................................................................41Table13.STM8S003K3alternatefunctionremappingbitsfor32-pindevices......................................43Table14.STM8S003F3alternatefunctionremappingbitsfor20-pindevices......................................44Table15.Voltagecharacteristics...........................................................................................................47Table16.Currentcharacteristics...........................................................................................................47Table17.Thermalcharacteristics..........................................................................................................48Table18.Generaloperatingconditions.................................................................................................49Table19.Operatingconditionsatpower-up/power-down......................................................................50Table20.TotalcurrentconsumptionwithcodeexecutioninrunmodeatVDD=5V.............................51Table21.TotalcurrentconsumptionwithcodeexecutioninrunmodeatVDD=3.3V..........................52Table22.TotalcurrentconsumptioninwaitmodeatVDD=5V............................................................53Table23.TotalcurrentconsumptioninwaitmodeatVDD=3.3V.........................................................53Table24.TotalcurrentconsumptioninactivehaltmodeatVDD=5V..................................................54Table25.TotalcurrentconsumptioninactivehaltmodeatVDD=3.3V...............................................54Table26.TotalcurrentconsumptioninhaltmodeatVDD=5V.............................................................55Table27.TotalcurrentconsumptioninhaltmodeatVDD=3.3V..........................................................55Table28.Wakeuptimes.........................................................................................................................56Table29.Totalcurrentconsumptionandtiminginforcedresetstate....................................................57Table30.Peripheralcurrentconsumption.............................................................................................57Table31.HSEuserexternalclockcharacteristics.................................................................................60Table32.HSEoscillatorcharacteristics.................................................................................................61Table33.HSIoscillatorcharacteristics..................................................................................................62Table34.LSIoscillatorcharacteristics...................................................................................................64Table35.RAMandhardwareregisters..................................................................................................64Table36.FlashprogrammemoryanddataEEPROM...........................................................................65Table37.I/Ostaticcharacteristics.........................................................................................................66Table38.Outputdrivingcurrent(standardports)..................................................................................68Table39.Outputdrivingcurrent(trueopendrainports)........................................................................68Table40.Outputdrivingcurrent(highsinkports)..................................................................................69Table41.NRSTpincharacteristics........................................................................................................74Table42.SPIcharacteristics..................................................................................................................78

2

Table43.ICcharacteristics..................................................................................................................80Table44.ADCcharacteristics................................................................................................................82Table45.ADCaccuracywithRAIN<10kΩ,VDD=5V.........................................................................82Table46.ADCaccuracywithRAIN<10kΩRAIN,VDD=3.3V..............................................................83Table47.EMSdata................................................................................................................................86

4/100DocID018576Rev3

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3Listoftables

Table48.EMIdata.................................................................................................................................86Table49.ESDabsolutemaximumratings.............................................................................................87Table50.Electricalsensitivities.............................................................................................................88Table51.32-pinlowprofilequadflatpackagemechanicaldata............................................................89Table52.20-pin,4.40mmbody,0.65mmpitchmechanicaldata.........................................................91Table53.20-leadultrathinfinepitchquadflatno-leadpackage(3x3)mechanicaldata......................92Table54.Thermalcharacteristics..........................................................................................................94Table55.Documentrevisionhistory......................................................................................................99

DocID018576Rev35/100

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

ListoffiguresSTM8S003K3STM8S003F3

Listoffigures

Figure1.Blockdiagram...........................................................................................................................9Figure2.Flashmemoryorganization....................................................................................................12Figure3.STM8S003K3LQFP32pinout................................................................................................18Figure4.STM8S003F3TSSOP20pinout..............................................................................................21Figure5.STM8S003F3UFQFPN20-pinpinout.....................................................................................22Figure6.Memorymap...........................................................................................................................25Figure7.Pinloadingconditions.............................................................................................................46Figure8.Pininputvoltage.....................................................................................................................47Figure9.fCPUmaxversusVDD................................................................................................................50Figure10.ExternalcapacitorCEXT.......................................................................................................50Figure11.TypIDD(RUN)vs.VDDHSEuserexternalclock,fCPU=16MHz.............................................58Figure12.TypIDD(RUN)vs.fCPUHSEuserexternalclock,VDD=5V....................................................58Figure13.TypIDD(RUN)vs.VDDHSIRCosc,fCPU=16MHz.................................................................59Figure14.TypIDD(WFI)vs.VDDHSEuserexternalclock,fCPU=16MHz..............................................59Figure15.TypIDD(WFI)vs.fCPUHSEuserexternalclock,VDD=5V.....................................................60Figure16.TypIDD(WFI)vs.VDDHSIRCosc,fCPU=16MHz.................................................................60Figure17.HSEexternalclocksource....................................................................................................61Figure18.HSEoscillatorcircuitdiagram...............................................................................................62Figure19.TypicalHSIfrequencyvariationvsVDD@4temperatures..................................................63Figure20.TypicalLSIfrequencyvariationvsVDD@4temperatures...................................................64Figure21.TypicalVILandVIHvsVDD@4temperatures......................................................................67Figure22.Typicalpull-upresistancevsVDD@4temperatures............................................................67Figure23.Typicalpull-upcurrentvsVDD@4temperatures.................................................................68Figure24.Typ.VOL@VDD=5V(standardports)................................................................................70Figure25.Typ.VOL@VDD=3.3V(standardports).............................................................................70Figure26.Typ.VOL@VDD=5V(trueopendrainports)......................................................................71Figure27.Typ.VOL@VDD=3.3V(trueopendrainports)...................................................................71Figure28.Typ.VOL@VDD=5V(highsinkports)................................................................................72Figure29.Typ.VOL@VDD=3.3V(highsinkports).............................................................................72Figure30.Typ.VDD-VOH@VDD=5V(standardports).......................................................................73Figure31.Typ.VDD-VOH@VDD=3.3V(standardports)...................................................................73Figure32.Typ.VDD-VOH@VDD=5V(highsinkports).......................................................................74Figure33.Typ.VDD-VOH@VDD=3.3V(highsinkports)....................................................................74Figure34.TypicalNRSTVILandVIHvsVDD@4temperatures...........................................................76Figure35.TypicalNRSTpull-upresistancevsVDD@4temperatures.................................................76Figure36.TypicalNRSTpull-upcurrentvsVDD@4temperatures......................................................77Figure37.Recommendedresetpinprotection......................................................................................77Figure38.SPItimingdiagram-slavemodeandCPHA=0..................................................................79Figure39.SPItimingdiagram-slavemodeandCPHA=1..................................................................79

(1)

Figure40.SPItimingdiagram-mastermode...................................................................................80

2

Figure41.TypicalapplicationwithICbusandtimingdiagram............................................................84Figure42.ADCaccuracycharacteristics...............................................................................................84Figure43.TypicalapplicationwithADC................................................................................................85Figure44.32-pinlowprofilequadflatpackage(7x7)..........................................................................89Figure45.20-pin,4.40mmbody,0.65mmpitch...................................................................................90Figure46.20-leadultrathinfinepitchquadflatno-leadpackageoutline(3x3)....................................92Figure47.STM8S003xvaluelineorderinginformationscheme...........................................................96

6/100DocID018576Rev3

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3Introduction

1Introduction

Thisdatasheetcontainsthedescriptionofthedevicefeatures,pinout,electricalcharacteristics,mechanicaldataandorderinginformation.

ForcompleteinformationontheSTM8Smicrocontrollermemory,registersandperipherals,pleaserefertotheSTM8Smicrocontrollerfamilyreferencemanual(RM0016).

informationonprogramming,erasingandprotectionoftheinternalFlashmemory For

pleaserefertotheSTM8SFlashprogrammingmanual(PM0051).

informationonthedebugandSWIM(singlewireinterfacemodule)refertotheSTM8 For

SWIMcommunicationprotocolanddebugmoduleusermanual(UM0470).

informationontheSTM8core,pleaserefertotheSTM8CPUprogrammingmanual For

(PM0044).

DocID018576Rev37/100

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

DescriptionSTM8S003K3STM8S003F3

2Description

TheSTM8S003xvalueline8-bitmicrocontrollersfeature8KbytesFlashprogrammemory,plusintegratedtruedataEEPROM.TheSTM8Smicrocontrollerfamilyreferencemanual(RM0016)referstodevicesinthisfamilyaslow-density.Theyprovidethefollowingbenefits:performance,robustness,andreducedsystemcost.

DeviceperformanceandrobustnessareensuredbyintegratedtruedataEEPROMsupportingupto100000write/erasecycles,advancedcoreandperipheralsmadeinastate-of-thearttechnology,a16MHzclockfrequency,robustI/Os,independentwatchdogswithseparateclocksource,andaclocksecuritysystem.

Thesystemcostisreducedthankstohighsystemintegrationlevelwithinternalclockoscillators,watchdogandbrown-outreset.

Fulldocumentationisofferedaswellasawidechoiceofdevelopmenttools.

Table1:STM8S003xxvaluelinefeatures

DevicePincount

MaximumnumberofGPIOs(I/Os)Ext.interruptpinsTimerCAPCOMchannelsTimercomplementaryoutputsA/DconverterchannelsHighsinkI/Os

STM8S003K332282773421

STM8S003F3201616725128K1K

(1)

LowdensityFlashprogrammemory(bytes)8KRAM(bytes)

TruedataEEPROM(bytes)Peripheralset

1K128

128

(1)

2

Multipurposetimer(TIM1),SPI,IC,UARTwindowWDG,independentWDG,ADC,PWMtimer(TIM2),8-bittimer(TIM4)

(1)

Withoutread-while-writecapability.

8/100DocID018576Rev3

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3Blockdiagram

3Blockdiagram

Figure1:Blockdiagram

DocID018576Rev39/100

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

ProductoverviewSTM8S003K3STM8S003F3

4Productoverview

Thefollowingsectionintendstogiveanoverviewofthebasicfeaturesofthedevicefunctionalmodulesandperipherals.

Formoredetailedinformationpleaserefertothecorrespondingfamilyreferencemanual(RM0016).

4.1CentralprocessingunitSTM8

The8-bitSTM8coreisdesignedforcodeefficiencyandperformance.

Itcontains6internalregisterswhicharedirectlyaddressableineachexecutioncontext,20addressingmodesincludingindexedindirectandrelativeaddressingand80instructions.ArchitectureandregistersHarvardarchitecture

3-stagepipeline

32-bitwideprogrammemorybus-singlecyclefetchingformostinstructions

andY16-bitindexregisters-enablingindexedaddressingmodeswithorwithoutoffset X

andread-modify-writetypedatamanipulations 8-bitaccumulator

24-bitprogramcounter-16-Mbytelinearmemoryspace 16-bitstackpointer-accesstoa64K-levelstack

8-bitconditioncoderegister-7conditionflagsfortheresultofthelastinstruction

Addressing

20addressingmodes

indirectaddressingmodeforlook-uptableslocatedanywhereintheaddress Indexed

space

Stackpointerrelativeaddressingmodeforlocalvariablesandparameterpassing

Instructionset

80instructionswith2-byteaverageinstructionsize

Standarddatamovementandlogic/arithmeticfunctions 8-bitby8-bitmultiplication

16-bitby8-bitand16-bitby16-bitdivision Bitmanipulation

Datatransferbetweenstackandaccumulator(push/pop)withdirectstackaccess DatatransferusingtheXandYregistersordirectmemory-to-memorytransfers

4.2

Singlewireinterfacemodule(SWIM)anddebugmodule(DM)

Thesinglewireinterfacemoduleanddebugmodulepermitsnon-intrusive,real-timein-circuitdebuggingandfastmemoryprogramming.

10/100DocID018576Rev3

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3

SWIM

Productoverview

Singlewireinterfacemodulefordirectaccesstothedebugmoduleandmemoryprogramming.Theinterfacecanbeactivatedinalldeviceoperationmodes.Themaximumdatatransmissionspeedis145bytes/ms.Debugmodule

Thenon-intrusivedebuggingmodulefeaturesaperformanceclosetoafull-featuredemulator.Besidememoryandperipherals,alsoCPUoperationcanbemonitoredinreal-timebymeansofshadowregisters.

R/WtoRAMandperipheralregistersinreal-time

R/WaccesstoallresourcesbystallingtheCPU

Breakpointsonallprogram-memoryinstructions(softwarebreakpoints) Twoadvancedbreakpoints,23predefinedconfigurations

4.3

Interruptcontroller

Nestedinterruptswiththreesoftwareprioritylevels 32interruptvectorswithhardwarepriority

Upto27externalinterruptson6vectorsincludingTLI Trapandresetinterrupts

4.4

FlashprogrammemoryanddataEEPROM

8KbytesofFlashprogramsinglevoltageFlashmemory

bytesoftruedataEEPROM 128

Useroptionbytearea

Writeprotection(WP)

WriteprotectionofFlashprogrammemoryanddataEEPROMisprovidedtoavoidunintentionaloverwritingofmemorythatcouldresultfromausersoftwaremalfunction.

Therearetwolevelsofwriteprotection.ThefirstlevelisknownasMASS(memoryaccesssecuritysystem).MASSisalwaysenabledandprotectsthemainFlashprogrammemory,thedataEEPROM,andtheoptionbytes.

Toperformin-applicationprogramming(IAP),thiswriteprotectioncanberemovedbywritingaMASSkeysequenceinacontrolregister.ThisallowstheapplicationtomodifythecontentofthemainprogrammemoryanddataEEPROM,ortoreprogramthedeviceoptionbytes.Asecondlevelofwriteprotection,canbeenabledtofurtherprotectaspecificareaofmemoryknownasUBC(userbootcode).Refertothefigurebelow.

ThesizeoftheUBCisprogrammablethroughtheUBCoptionbyte,inincrementsof1page(64-byteblock)byprogrammingtheUBCoptionbyteinICPmode.Thisdividestheprogrammemoryintotwoareas:Mainprogrammemory:8KbytesminusUBC

User-specificbootcode(UBC):Configurableupto8Kbytes

TheUBCarearemainswrite-protectedduringin-applicationprogramming.ThismeansthattheMASSkeysdonotunlocktheUBCarea.Itprotectsthememoryusedtostoretheboot

DocID018576Rev311/100

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

ProductoverviewSTM8S003K3STM8S003F3

program,specificcodelibraries,resetandinterruptvectors,theresetroutineandusuallytheIAPandcommunicationroutines.

Figure2:Flashmemoryorganization

Read-outprotection(ROP)

Theread-outprotectionblocksreadingandwritingfrom/totheFlashprogrammemoryandthedataEEPROMinICPmode(anddebugmode).Oncetheread-outprotectionisactivated,anyattempttotoggleitsstatustriggersaglobaleraseoftheprogrammemory.Evenifnoprotectioncanbeconsideredastotallyunbreakable,thefeatureprovidesaveryhighlevelofprotectionforageneralpurposemicrocontroller.

4.5Clockcontroller

Theclockcontrollerdistributesthesystemclock(fMASTER)comingfromdifferentoscillatorstothecoreandtheperipherals.Italsomanagesclockgatingforlowpowermodesandensuresclockrobustness.

Features

Clockprescaler:TogetthebestcompromisebetweenspeedandcurrentconsumptiontheclockfrequencytotheCPUandperipheralscanbeadjustedbyaprogrammableprescaler.

clockswitching:Clocksourcescanbechangedsafelyontheflyinrunmode Safe

throughaconfigurationregister.Theclocksignalisnotswitcheduntilthenewclocksourcemanagement:Toreducepowerconsumption,theclockcontrollercanstopthe Clock

clocktothecore,individualperipheralsormemory.

clocksources:Fourdifferentclocksourcescanbeusedtodrivethemaster Master

clock:

-1-16MHzhigh-speedexternalcrystal(HSE)

-Upto16MHzhigh-speeduser-externalclock(HSEuser-ext)-16MHzhigh-speedinternalRCoscillator(HSI)-128kHzlow-speedinternalRC(LSI)isready.Thedesignguaranteesglitch-freeswitching.

12/100DocID018576Rev3

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3Productoverview

clock:Afterreset,themicrocontrollerrestartsbydefaultwithaninternal2MHz Startup

clock(HSI/8).Theprescalerratioandclocksourcecanbechangedbytheapplicationsecuritysystem(CSS):Thisfeaturecanbeenabledbysoftware.IfanHSEclock Clock

failureoccurs,theinternalRC(16MHz/8)isautomaticallyselectedbytheCSSandanmainclockoutput(CCO):Thisoutputsanexternalclockforusebythe Configurable

application.Table2:PeripheralclockgatingbitassignmentsinCLK_PCKENR1/2registers

BitPCKEN17PCKEN16PCKEN15PCKEN14

PeripheralBitclockTIM1ReservedTIM2TIM4

PCKEN13PCKEN12PCKEN11PCKEN10

PeripheralBitclockUART1ReservedSPIIC

2

programassoonasthecodeexecutionstarts.

interruptcanoptionallybegenerated.

PeripheralBitclockReservedReservedReservedReserved

PCKEN23PCKEN22PCKEN21PCKEN20

PeripheralclockADCAWUReservedReserved

PCKEN27PCKEN26PCKEN25PCKEN24

4.6Powermanagement

Forefficentpowermanagement,theapplicationcanbeputinoneoffourdifferentlow-powermodes.Youcanconfigureeachmodetoobtainthebestcompromisebetweenlowestpowerconsumption,fasteststart-uptimeandavailablewakeupsources.

Waitmode:Inthismode,theCPUisstopped,butperipheralsarekeptrunning.Thewakeupisperformedbyaninternalorexternalinterruptorreset.

haltmodewithregulatoron:Inthismode,theCPUandperipheralclocksare Active

stopped.Aninternalwakeupisgeneratedatprogrammableintervalsbytheautowakeup

unit(AWU).Themainvoltageregulatoriskeptpoweredon,socurrentconsumptionishigherthaninactivehaltmodewithregulatoroff,butthewakeuptimeisfaster.WakeupistriggeredbytheinternalAWUinterrupt,externalinterruptorreset.

haltmodewithregulatoroff:Thismodeisthesameasactivehaltwithregulator Active

on,exceptthatthemainvoltageregulatorispoweredoff,sothewakeuptimeisslower.

mode:Inthismodethemicrocontrollerusestheleastpower.TheCPUandperipheral Halt

clocksarestopped,themainvoltageregulatorispoweredoff.Wakeupistriggeredbyexternaleventorreset.

4.7Watchdogtimers

Thewatchdogsystemisbasedontwoindependenttimersprovidingmaximumsecuritytotheapplications.

Activationofthewatchdogtimersiscontrolledbyoptionbytesorbysoftware.Onceactivated,thewatchdogscannotbedisabledbytheuserprogramwithoutperformingareset.

DocID018576Rev313/100

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

Productoverview

Windowwatchdogtimer

STM8S003K3STM8S003F3

Thewindowwatchdogisusedtodetecttheoccurrenceofasoftwarefault,usuallygeneratedbyexternalinterferencesorbyunexpectedlogicalconditions,whichcausetheapplicationprogramtoabandonitsnormalsequence.

Thewindowfunctioncanbeusedtotrimthewatchdogbehaviortomatchtheapplicationperfectly.

Theapplicationsoftwaremustrefreshthecounterbeforetime-outandduringalimitedtimewindow.

Aresetisgeneratedintwosituations:

1.Timeout:At16MHzCPUclockthetime-outperiodcanbeadjustedbetween75µsupto64ms.2.Refreshoutofwindow:Thedowncounterisrefreshedbeforeitsvalueislowerthantheonestoredinthewindowregister.Independentwatchdogtimer

Theindependentwatchdogperipheralcanbeusedtoresolveprocessormalfunctionsduetohardwareorsoftwarefailures.

Itisclockedbythe128kHZLSIinternalRCclocksource,andthusstaysactiveevenincaseofaCPUclockfailure

TheIWDGtimebasespansfrom60µsto1s.

4.8Autowakeupcounter

Usedforautowakeupfromactivehaltmode

Clocksource:Internal128kHzinternallowfrequencyRCoscillatororexternalclock LSIclockcanbeinternallyconnectedtoTIM1inputcapturechannel1forcalibration

4.9

Beeper

ThebeeperfunctionoutputsasignalontheBEEPpinforsoundgeneration.Thesignalisintherangeof1,2or4kHz.

ThebeeperoutputportisonlyavailablethroughthealternatefunctionremapoptionbitAFR7.

4.10TIM1-16-bitadvancedcontroltimer

Thisisahigh-endtimerdesignedforawiderangeofcontrolapplications.Withits

complementaryoutputs,dead-timecontrolandcenter-alignedPWMcapability,thefieldofapplicationsisextendedtomotorcontrol,lightingandhalf-bridgedriver16-bitup,downandup/downautoreloadcounterwith16-bitprescaler

independentcapture/comparechannels(CAPCOM)configurableasinputcapture, Four

outputcompare,PWMgeneration(edgeandcenteralignedmode)andsinglepulsemode Synchronizationmoduletocontrolthetimerwithexternalsignals Breakinputtoforcethetimeroutputsintoadefinedstate Threecomplementaryoutputswithadjustabledeadtime

14/100

DocID018576Rev3

output

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3Productoverview

Encodermode

Interruptsources:3xinputcapture/outputcompare,1xoverflow/update,1xbreak

4.11

TIM2-16-bitgeneralpurposetimer

16-bitautoreload(AR)up-counter

15-bitprescaleradjustabletofixedpowerof2ratios1…32768 3individuallyconfigurablecapture/comparechannels PWMmode

Interruptsources:3xinputcapture/outputcompare,1xoverflow/update

4.12

TIM4-8-bitbasictimer

8-bitautoreload,adjustableprescalerratiotoanypowerof2from1to128 Clocksource:CPUclock

Interruptsource:1xoverflow/update

Table3:TIMtimerfeatures

Timer

Countersize(bits)

PrescalerAnyintegerfrom1to65536Anypowerof2from1to32768Anypowerof2from1to128

Countingmode

CAPCOMchannels

Complem.Ext.outputstrigger

Timer

synchronization/chaining

TIM116Up/down43Yes

TIM216Up30NoNo

TIM48Up00No

4.13Analog-to-digitalconverter(ADC1)

TheSTM8S003xxproductscontaina10-bitsuccessiveapproximationA/Dconverter(ADC1)withupto5externalmultiplexedinputschannelsandthefollowingfeatures:Inputvoltagerange:0toVDD

Conversiontime:14clockcycles

Singleandcontinuousandbufferedcontinuousconversionmodes Buffersize(nx10bits)wheren=numberofinputchannels

Scanmodeforsingleandcontinuousconversionofasequenceofchannels Analogwatchdogcapabilitywithprogrammableupperandlowerthresholds Analogwatchdoginterrupt

DocID018576Rev3

15/100

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

ProductoverviewSTM8S003K3STM8S003F3

Externaltriggerinput TriggerfromTIM1TRGO

Endofconversion(EOC)interrupt

4.14

Communicationinterfaces

Thefollowingcommunicationinterfacesareimplemented:

UART1:FullfeatureUART,synchronousmode,SPImastermode,Smartcardmode,IrDAmode,singlewiremode,LIN2.1mastercapability

SPI:Fullandhalf-duplex,8Mbit/s I²C:Upto400Kbit/s

4.14.1

UART1

Mainfeatures

OneMbit/sfullduplexSCI

SPIemulation

Highprecisionbaudrategenerator Smartcardemulation

IrDASIRencoderdecoder LINmastermode

Singlewirehalfduplexmode

Asynchronouscommunication(UARTmode)

Fullduplexcommunication-NRZstandardformat(mark/space)

transmitandreceivebaudratesupto1Mbit/s(f/16)andcapableof Programmable

followinganystandardbaudrateregardlessoftheinputfrequency Separateenablebitsfortransmitterandreceiver

receiverwakeupmodes: TwoAddress

bit(MSB)--Idleline(interrupt)

Transmissionerrordetectionwithinterruptgeneration Paritycontrol

CPU

Synchronouscommunication

Fullduplexsynchronoustransfers

SPImasteroperation 8-bitdatacommunication

Maximumspeed:1Mbit/sat16MHz(f

Reception:Detects11-bitbreakframe

16/100

CPU/16)

LINmastermode

Emission:Generates13-bitsynchbreakframe

DocID018576Rev3

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3Productoverview

4.14.2SPI

Maximumspeed:8Mbit/s(f/2)bothformasterandslave Fullduplexsynchronoustransfers

Simplexsynchronoustransfersontwolineswithapossiblebidirectionaldataline Masterorslaveoperation-selectablebyhardwareorsoftware CRCcalculation

1byteTxandRxbuffer

Slave/masterselectioninputpin

MASTER

4.14.3I²C

masterfeatures: I²CClock

generation--Startandstopgenerationslavefeatures: I²CProgrammable

I2Caddressdetection--Stopbitdetection

Generationanddetectionof7-bit/10-bitaddressingandgeneralcall

differentcommunicationspeeds: Supports

-Standardspeed(upto100kHz)-Fastspeed(upto400kHz)

DocID018576Rev317/100

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

PinoutandpindescriptionSTM8S003K3STM8S003F3

5Pinoutandpindescription

Table4:Legend/abbreviationsforpinouttables

5.1STM8S003K3LQFP32pinoutandpindescription

Figure3:STM8S003K3LQFP32pinout

18/100DocID018576Rev3

STM8S003F3U6TR,STM8S003K3T6C,STM8S003F3P6, 规格书,Datasheet 资料

STM8S003K3STM8S003F3Pinoutandpindescription

1.(HS)highsinkcapability.

2.(T)Trueopendrain(P-bufferandprotectiondiodetoVDDnotimplemented).

3.[]alternatefunctionremappingoption(ifthesamealternatefunctionisshowntwice,itindicatesanexclusivechoicenotaduplicationofthefunction).

Table5:LQFP32pindescription

DocID018576Rev319/100

本文来源:https://www.bwwdw.com/article/sz6i.html

Top