FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Proteus8.9 Simulation STM32407ZGT6 Series 010_PWM Multi-Variable Frequency Adjustable Delicate Delivery Output

     

    "I. open the file (you can download it with the text and open it in the document)( (as shown in Figure 1 below) Figure 1 2、 Adjust the virtual device and save the project file as( (as shown in Figure 2, 3 and 4 below) Figure 2 Figure 3 Figure 4 3、 Click the source code tab( (as shown in Figure 5 below) Figure 5 4、 Edit the codes of main. C, timer. C, timer. H, key. C, key. H, led. C and led. H, as shown in proteus8.9 simulation stm32407zgt6 Series 001 (as shown in Figure 6 below) Figure 6 5、 Main. C code: /* Main.c file generated by New Project wizard * Author: Ziegler Yin * Created: Thursday January 16 2020 * Processor: STM32F407ZGT6ZGT6 * Compiler: GCC for ARM */ #include ""mfuncs.h"" #include ""delay.h"" #include ""usart.h"" #include ""led.h"" #include ""key.h"" #include ""TImer.h"" #define RT(A , B) (A> 300)? ( B= 0): ( B=1) uint32_ t gt_ fig(u8 sts){ if(1== sts) return TIM_ GetCapture1(TIM4); if(2== sts) return TIM_ GetCapture2(TIM4); if(3== sts) return TIM_ GetCapture3(TIM4); if(4== sts) return TIM_ GetCapture4(TIM4); } void st_ fig(u8 sts, uint32_ t gt){ if(1== sts) TIM_ SetCompare1(TIM4, gt); if(2== sts) TIM_ SetCompare2(TIM4, gt); if(3== sts) TIM_ SetCompare3(TIM4, gt); if(4== sts) TIM_ SetCompare4(TIM4, gt); } void new_ Pwm(u16 *tmbuf, u16 * mdc) { Pwm_ Init(*(tmbuf+0), *(tmbuf+1)); TIM_ SetCompare1(TIM4, mdc[0]); TIM_ SetCompare2(TIM4, mdc[1]); TIM_ SetCompare3(TIM4, mdc[2]); Pwm_ Init3(*(tmbuf+2), *(tmbuf+3)); TIM_ SetCompare2(TIM3, mdc[1]); } int main(void) { u16 psc=840, per=600, idc[4]= {500, 200, 300, 400}; u16 umd, pwmval=0, tm43[2][2]= {840, 600, 1680, 1200}; u8 status= 0, dir= 1, chgFry[1]= {0, 0}; int gtln= 0; Char * WD, * WDS, * lnslt [7] = {"" unselected "", "" a line "", "" B line "", "" C line "", "" D line "", "" frequency conversion 1-A, B, C frequency multiplication or initial state "", "" frequency conversion 2-D frequency multiplication or initial state ""}; NVIC_ PriorityGroupConfig(NVIC_ PriorityGroup_ 2);// Set system interrupt priority group 2 delay_ init(168); // Initialization delay function uart_ init(9600);// The baud rate of initialization serial port is 115200 LED_ Init(); KEY_ Init(); Uprint ("" Hello everyone\ r\n""); Let's build a ventilator\ r\n""); gtln= nmtoa(wd, 10, psc); uprint(wd); uprint(""\r\n""); gtln= nmtoa(wd, 10, (psc+10000)); uprint(wd); uprint(""\r\n""); LED0= LED1= LED2= 1; chgFry[0]= 0; chgFry[1]= 4; new_ Pwm(tm43, idc); Uprint ("" control chip stm32f407zgt6_ 008_ PWM simulation begins\ r\n""); delay_ ms(100); while(1) { wd= lnslt[status]; ; Uprint ("" arm runtime... Duty cycle: \ R \ n ""); uprint(wd); Uprint ("line adjustable status: \ R \ n" "); if(1==ReadKey(GPIOC, 0x0080)) { status++; delay_ ms(20); if(status> 6) status= 0; wd= lnslt[status]; ; Uprint ("" line adjustment status... Duty cycle ""); uprint(wd); Uprint ("line adjustable status: \ R \ n" "); } if(1==ReadKey(GPIOC, 0x0010)) { LED0= 1; pwmval= gt_ fig(status); gtln= nmtoa(wds, 10, pwmval); if(status>0){ if(per< (pwmval+ 50)) { Uprint ("line adjustment, duty cycle reaches the highest value... \ R \ n" "); st_ fig(status, (per+ 1)); } else{ LED0= 1; pwmval= gt_ fig(status); gtln= nmtoa(wds, 10, pwmval); umd= pwmval +50; Uprint ("line adjustment, duty cycle from" "); uprint(wds); Uprint ("" increase by 50 to ""); uprint(numtoa(10, umd)); uprint("" ...\r\n ""); st_ fig(status, umd); } } } if(1==ReadKey(GPIOC, 0x0020)) { LED1= 1; if(status==5) { if(chgFry[0]==0) { chgFry[0]= 2; tm43[0][0]= 1680; new_ Pwm(tm43, idc); Uprint ("" adjust the frequency of line a, B and C to double... \ R \ n ""); delay_ ms(200); } else{ chgFry[0]= 0; tm43[0][0]= 840; new_ Pwm(tm43, idc); Uprint ("line a, B, C frequency adjusted to initial state... \ R \ n" "); delay_ ms(200); } } if(status==6) { if(chgFry[1]==0) { chgFry[1]= 4; tm43[1][0]= 1680; tm43[1][1]= 1200; new_ Pwm(tm43, idc); Uprint ("line D frequency adjusted to quadruple... \ R \ n" "); delay_ ms(200); } else{ chgFry[1]= 0; tm43[1][0]= 840; tm43[1][1]= 600; new_ Pwm(tm43, idc); Uprint ("adjust line D frequency to initial state... \ R \ n" "); delay_ ms(200); } } delay_ ms(20); pwmval= gt_ fig(status); gtln= nmtoa(wds, 10, pwmval); Uprint ("" arm runtime... Duty cycle ""); uprint(wd); Uprint ("line adjustment by" "); uprint(wds); Uprint ("" clear ""); uprint("" ...\r\n ""); st_ fig(status, 0); } if(1==ReadKey(GPIOC, 0x0040)) { LED2= 1; pwmval= gt_ fig(status); gtln= nmtoa(wds, 10, pwmval); if(pwmval> 50) { umd= pwmval -50; Uprint ("line adjustment, duty cycle from" "); uprint(wds); Uprint ("" reduced by 50 to ""); uprint(numtoa(10, umd)); uprint("" ...\r\n ""); st_ fig(status, umd); } else { umd= 1; Uprint ("line adjustment, duty cycle reaches the lowest value... \ R \ n" "); st_ fig(status, 1); } } LED0= LED1= LED2= 0; delay_ ms(100); } } The codes before key. C, key. H, led. C, led. H, time. C and time. H can be used for reference. They are not listed in multiple columns, and will not be listed one by one in the future. Only the. C,. H codes of main. C and related functions are listed. 6、 Click the build project button to compile the project( (as shown in Figure 7 below) Figure 7 7、 Click the simulation button at the bottom left of the window, the red, yellow and green lights will be on and off for a while, and the simulation will start. Press the select button, select "" frequency conversion 1-A, B, C frequency doubling or initial state "", "" frequency conversion 2-D frequency doubling or initial state "", and press key_ Zero button, frequency doubling, frequency quadrupling or initial state. For the commissioning of duty cycle, see the blogger's proteus8.9 simulation stm32407zgt6 series 009_ PWM multi-channel adjustable duty cycle output text. Virtual serial port, the oscilloscope will display the status change of on the screen( As shown in Figures 8, 9, 10 and 11 below) Figure 8 Figure 9 Figure 10 Figure 11 8、 Select release and click the build project button to compile the project to generate a hex file( (as shown in Figure 12 below) Figure 12 LW, read the full text“

     

     

     

     

    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