FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Principle Analysis of SM32 Single Chipping Belt Operation

     

    Sys.h bit operation code in the file, performs operations on bits of each of the IO port STM32, including read and output. Of course, before these functions are called, the IO-clock must be performed and the IO port function is defined. one. Principle of operation with a bit The expansion is a bit of a 32-bit address, if you want to write this bit is 1, only 1 write to this address. two. What regional support-bit operation? For example, a SRAM area There on the 0x20000000 32 bits, each bit can be mapped into an address, if you want one where to write one, just need to write this one address mapping so as to achieve the purpose of the operation 1. bit. three. Bit operation superiority No bit operation, it should bit2 is set to 1, first read the value of 0x20000000, then bit2 is set to 1, and then write back the value of the register 0x20000000, if a bit operation, already know the address mapping bit2 is 0x22000008 , directly to the address written on it 1. Four. Relational mapping A register or a peripheral will have a base address, you must first find the address register before you can find the relevant bit, then you can get the address mapping calculated by the formula. We need not go into here. Fives. sys.h GPIO input output section of the operation to achieve a bit GPIOA address the ODR GPIOA the base address + offset address the ODR = GPIOA_BASE + 0x0C E.g. PAout output register operating ODR, PAout (. 1) is calculated through a series of calculations that an address mapping, the address of the operation PAin input operation is the IDR register. six. Examples of operation Marquee experiment Write-step process: LED0 pick PB5, LED1 connected PE5 led.c file // Initialize PB5 and PE5 to the output port. And these two ports can clock // LED IO initialization void LED_Init (void) { GPIO_InitTypeDef GPIO_InitStructure; RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOE, ENABLE); // enable PB, PE port clock GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; //LED0--"PB.5 port configuration GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; // push-pull output GPIO_InitStructure.GPIO_Speed ​​= GPIO_Speed_50MHz; // IO port speed of 50MHz GPIO_Init (GPIOB, & GPIO_InitStructure); // set according to the initialization parameter GPIOB.5 GPIO_SetBits (GPIOB, GPIO_Pin_5); High output //PB.5 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; //LED1--"PE.5 port configuration, push-pull output GPIO_Init (GPIOE, & GPIO_InitStructure); // push-pull output, IO port speed of 50MHz GPIO_SetBits (GPIOE, GPIO_Pin_5); High output //PE.5 } The main function #include "stm32f10x.h" #include "delay.h" #include "led.h" int main (void) { delay_init (); LED_Init (); while (1) { PBout (5) = 1; // bit operation using pin PB.5 PEout (5) = 1; delay_ms (500); PBout (5) = 0; // bit operation using pin PB.5 PEout (5) = 0; delay_ms (500); } } Source; 21ic, Read more

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us