0% found this document useful (0 votes)
18 views7 pages

Register Usage and Port Configuration

This document serves as an introduction to bare metal programming for the Arm Cortex-M4 MCUs, focusing on register usage and port configuration. It outlines the various modes of GPIO ports, including input, output, and alternate functions, as well as the configuration of pull-up/pull-down resistors and output types. Additionally, it discusses setting port speed and accessing output ports through specific registers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
18 views7 pages

Register Usage and Port Configuration

This document serves as an introduction to bare metal programming for the Arm Cortex-M4 MCUs, focusing on register usage and port configuration. It outlines the various modes of GPIO ports, including input, output, and alternate functions, as well as the configuration of pull-up/pull-down resistors and output types. Additionally, it discusses setting port speed and accessing output ports through specific registers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
rato cae An introduction to ‘Bare Metal’-programming the ‘Arm-Cortex-M4(R) MCUs — Lesson 2: Register usage and port configuration onoarace Citar bet tre crit oppo coat heed os .oHandingresieere Uhenredr ond ire smicoconvliin 00% te caesrgitershe obese Inelergehedefleyoucanfd the EMG feldrnyaurmringnstonment Important: The arooyms fen crrapond 10% ith the mma mont bt sometines hey ont Weil gi its when the [007 cntansregasthet we called" MODES (moeragster “OER [ouput date OR ‘Ares edie an einen th rus honerfles andes forthe repestive MCU 11 exemption: ecesshgrgiter by Inthe career cannes anargitr ert decltedietnadn MSE Re youhereta ecenthelason yt amar eto Sethe remit bef ‘Sexmpl:aating flash mem sine rom it reece rage Inan SIMRAN ath mon sisrnacerentonyvau 6 trenermth ess ness (rvedee| = (lng eantea plaraton A 1-pitersatlerad “sls eed ade the content fre cal APFFTAL2 he conan Fits mem clthan reader fSbratale, 242 Flash size eben te nearest (Gouce TAFE dhe 29 1.2Using\/0 pore poveedup patel becaueths ies eneayconamedly themed ptf the EU! Fi ante entchitflOnta san mere mth Dovt anki on scarp fet theegeiencedAM develope bees esfoerewltrphnntmerkbeceryufegote power Che respecte peeraddeor tne act Inport he uke nother McUsy0u not ganhaflaces to al patstecaessme of themed x02 PAL PRIB PD and PA venta ererarer sh} ti 2. Pt 0 pin niet ‘00 an sie pore FAR] FR Tower] var |e. Theycinte reaped tarda pots bt usin fnetonaly ornare evo le te prazamsourlcUaganbecari wat conmunkatewthyourprazermersnare nhc cnt tore nthe Ls mamerholdthe RESET batten nero lest oninthe savmsncerdstat housed But cheng te codeteloreto preventvingntathesame tp re heragiter thao eededre wecaledthe RCC regherscton Reset ane Cel, Inthe ference mans rte behing wthpage 6 Theregiterthtinecdeatom his secenfysrttopaverupan WO prelate AMBIEN Paster er APB pero lc ere APs one he bute the (CRCEDANDTENG Bat se nobody des tat ween ‘GPG ram Atak mas depron he MCU you he hus) 63:10. RCCANB! peripheral lek register (RCC. AMBTENR) ‘cee wate, eal nord ade ie Taratetntoponarup perfor eampacaniat he 1.3fine what the pot willbe sed for tre (General Pupvalput Outpt cibe MCUmedel Ear) Pore mode reser MODER) \weeneenteryu candies epecterine pr 841 GPIO port mode register (GPIOx MODER) x= A.J) GPIO_MODER 00: Input Mode (Reset state) 01: Output Mode 10: Alternate Function Mode 11: Analog Mode Bits: TTT SLBU Jon | me Lu Pin 15 Pind Pin 0 (Sauce neeretuntnand into bse rotpitn Ifysareta ve 1.3: Beales tare ele 2 niterthevalue into the postin Thief > “stsin to and mice (8). hich ncn than ect rasnthast denediterinsfthe ste. The er seta penhesrrultpesthe pMbE(S by2agan(GuncotheZbt stra and sheninthn Sofa caled“stm3Fanh. We wilarrgier bared eh persone 1.4 DeFiningelecerieal characerites of an output port (PUPOR) ‘hasepdirerthena eho thepr tiers ae mtchedurg the PLPDR (plu denne GPIO_PUPDR 00: No Pull-up or Pull-down 01: Pull-up 10: Pull-down 11: Reserved (do not use) Bits: orb netherautpcednsothe teu ns hee orb puis theprtupte VO sense 0b 1.ssetting port speed (OSPEEDR) be aber tote youd havetocattaomuchatout par eed nd neato ef presalyGuhere ete done ferchevacut past es GPIO_OSPEEDR 00: Low-Speed (2MHz) 01: Mid-Speed (10MHz) 10: Low-Speed (2MHz) 11: High-Speed (50MHz) Bits: si30 |. [32 10 Pin 35 Pint Pind ".6settingeutpr ive type (OTYPER) GPIO_OTYPER 0: Push-Pull Output 1: Open-Drain Output Bits: Pin 15 Pin 1 Pin 0 Letssumlu younend toseepu phair eae seoututthefalanea thes often sores |e (6 “U7 Accessing output ports veyprthstwo renters tocrtl ata fow The "OOF (out cataregite athe DAs regiter Forontrga prt nthe OR 848 GPI0 port output data repster (GPIOx_OOR) (x= AIK) ‘ses hat te estan: 0 C0 cyoucensegnzethcesirhaca whofe ar wll ony ebte( 50) ets Tale sence because coy porches got 6p ‘atte: 00 ce cyaucenrcnce the reirhac witha 2 ie twa ony bite (1S0] eu Trae Sense because cuerpo a0t 16. Gee eth eee ws es Seta Ie ca Thecodngrih eck alata agar Pin 15 Pind Pind Lets al Fountend tose pet phe examplesseutatthefalann2therofcoteae sate: tecStotae s ) 159 Monomers srsve tet ose Sete oc 8 Ifyaitheohwetenfllth the optns aria you might hee earple ‘tubo ‘reco seuenceforecng aay ots bene meronetelan PEA mle acd He This cade pester th PTUs "ere oreherardaaeistetoaciton reece

You might also like