FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Play Micropython on Nucleo_h743

     

    "With the release of version 1.9.4 of python, the stm32h7 microcontroller is officially supported by python. Stm32h7, as the highest performance series of STM32 Cortex-M series controllers, how does microprython perform on it? What are the advantages over other models? Here we are at nucelo_ On the h743 development board, take a look at the performance of micro python. Starting from version 1.9.4, micropython has added the nucleus-h743zi development board to the supported development board. However, the binary firmware file of the development board is not available on the official website. To run micropython, you need to compile the source code yourself. If you have installed the micro Python compilation environment, just enter the following command in the micro Python directory to compile: make -C ports/stm32 BOARD=NUCLEO_ H743ZI If you do not have a compilation environment installed, you can refer to another article "compiling micropython under the Ubuntu subsystem of win10". You can install the compilation environment according to the method in this article. This method can also be used for other virtual machines or Ubuntu systems. If you feel that the installation and compilation environment is too troublesome or the network speed is too slow to install, you can directly download the firmware I compiled, download the firmware to the chip through the on-board stlink, and then you can run it. Before use, we need to prepare two microusb data cables (data cable of Android mobile phone) and serial port terminal software, such as putty, Kitty, mobaxterm, etc. Note that software such as serial assistant cannot be used because they do not support terminal mode. Why do you need two data lines? Because st link needs to use a data cable, the USB of stm32h743 on the development board can be connected to another USB. After writing the firmware, first power off once, then connect st link, and then connect the user USB on the other side. If all the operation steps are normal, a pybflash disk will be displayed. We can write files to this disk and run the written program. By default, it will run from the main.py file, so we can put the written program into main.py and let it run automatically. If it is win10 or MacOS or Linux system, you do not need to install any driver. If it is win7 system, you also need to install a serial driver. The driver is in this pybflash disk. After installation, we can see that there are two serial ports, one is the st link serial port, and the other is the micro Python serial port. Run a terminal software, the serial port can be set to any of the above two serial ports, and the baud rate is 115200. Select none for flow control. Taking Kitty software as an example, the use of other software is similar: After setting the parameters, click open Button, you can open the terminal. Press enter. If the > > > prompt appears, it means that the operation is successful. At this time, press ctrl-b to see the version prompt. As usual, we start with lighting the lights. In micro python, led types are defined by default. We can control them through pyb.led, such as: pyb.LED(1).on()pyb.LED(1).off() Because nucleo_ There are three LEDs on the h743 development board, so we can also use them to make a running light: while 1: for i in range(1, 4): pyb.LED(i).toggle() pyb.delay(500) pyb.LED(i).toggle() pyb.delay(500) The use of keys is also very easy. There is a built-in switch class in micro python that can be used to read keys. The following procedure controls the status of LED1 by pressing keys: sw=pyb.Switch()sw()while 1: if sw(): pyb.LED(1).on() else: pyb.LED(1).off() Timer is also one of the most commonly used functions in programming. In the following program, LED1 and LED3 are controlled in the callback functions of timer 6 and timer 7 respectively, and flash at different frequencies. TM = PyB. Timer (6, freq = 2) TM. Callback (lambda T: PyB. LED (1). Toggle()) TM2 = PyB. Timer (7, freq = 5) TM2. Callback (lambda T: PyB. LED (3). Toggle()) although stm32h743 has 22 timers, micropython currently only supports timer 14. Timers exceeding 14 can be defined, but will crash once used. PWM is also a very common function. It is realized by GPIO controlled by timer. It is a special working mode of timer. The following is the method of using PWM in micropthon. The following program controls LED1 (pb0) through CH3 of timer 3 and realizes a breathing lamp by changing the duty cycle periodically. tm = pyb.TImer(3, freq=1000)pwm = tm.channel(3, mode=pyb.TImer.PWM, pin=pyb.Pin('B0'))pwm.pulse_ width_ percent(20)while 1: for i in range(100): pwm.pulse_ width_ percent(i) pyb.delay(20) Stm32h743 has two DACs, PA4 and Pa5. Through the DAC, we can output analog voltage and generate various waveforms. As follows, 8-bit (default) and 12 bit modes are used to control the output of DAC respectively: d1 = pyb.DAC(1)d1.write(100)d1 = pyb.DAC(1, 12)d1.write(3000) In addition to directly outputting analog voltage, different waveforms can also be output: Triangular wave d1.triangle(2048) white noise d1.noise(1000) Predefined user waveforms can also be output. Using this characteristic and the high-speed characteristic of stm32h7, it can be used as a simple waveform generator. There are many other functions of micropathon, which will not be introduced here. You can run it yourself and experience the convenience brought by micrpathon. Finally, in order to test the performance of micropathon on stm32h743, we did a comparative test of computing performance, calculated addition, multiplication, division and PI on different hardware platforms, and recorded the calculation time. By comparing the computing time of different hardware, you can intuitively compare the performance (this may be the most comprehensive micro Python computing performance comparison test at present, including all the common hardware at present). Complete test procedure from microbit import running_ TImedef pi(places=100): # 3 + 3*(1/24) + 3*(1/24)*(9/80) + 3*(1/24)*(9/80)*(25/168) # The numerators 1, 9, 25, ... are given by (2x + 1) ^ 2 # The denominators 24, 80, 168 are given by (16x^2 -24x + 8) extra = 8 one = 10 ** (places+extra) t, c, n, na, d, da = 3*one, 3*one, 1, 0, 0, 24 while t > 1: n, na, d, da = n+na, na+8, d+da, da+32 t = t * n // d c += t return c // (10 ** extra)def pi_ test(n=5000): t1=running_ time() t=pi(n) t2=running_ time() print('Pi test: ', (t2-t1)/1000, 's')def add_ test(n=1000000, a = 1234, b = 5678): t1=running_ time() sum = 0 for i in range(n): sum = a + b t2=running_ time() print('Add test: ', (t2-t1)/1000, 's')def mul_ test(n=1000000, a = 1234, b = 5678): t1=running_ time() sum = 0 for i in range(n): sum = a * b t2=running_ time() print('Mul test: ', (t2-t1)/1000, 's')def div_ test(n=1000000, a = 1234, b = 5678): t1=running_ time() sum = 0 for i in range(n): sum = a / b t2=running_ time() print('Div test: ', (t2-t1)/1000, 's')print('Speed test starting...')add_ test()add_ test()mul_ test()mul_ test()div_ test()div_ test()pi_ test()pi_ test() test result MCU Dominant frequency Integer addition multiplication division PI microbit nRF51822 16M sixty-one point eight eight eight seventy-four point zero seven five one hundred and three point nine three five Nucleo_ F091 STM32F091 48M nineteen point eight eight two twenty-five point eight nine fifty-one point seven eight eighty-two point eight five one PYBNano STM32F401 84M six point nine five nine seven point two two two twelve point five two four eighteen point two three six Nucleo_ F411 STM32F411 96M five point eight five eight six point zero seven six ten point four seven eight sixteen point four six seven PYBV10 STM32F405 168M three point four three six three point five six three six point zero six seven ten point one eight STM32L476DISC STM32L476 80M eight point five eight six eight point nine eight nine fourteen point nine one three eighteen point nine three two STM32F7DISC STM32F746 192M one point nine four six two point three zero four three point six eight four point five seven nine Nucleo_ H743 STM32H743 400M zero point eight five six zero point nine four two one point five three four two point eight three five ESP8266 ESP8266 80M fifteen point five four six eighteen point three zero two nineteen point seven zero six forty-one point nine two six ESP32 ESP32 240M two point six zero seven two point seven nine four three point eight three nine seven point seven two nine ESP32_ psRAM ESP32 240M three point three six five three point five five three eighteen point nine zero two fifteen point zero one two ESP32_ LoBo ESP32 240M three point three nine six three point four nine nine thirteen point zero two nine point six zero seven ESP32_ psRAM_ LoBo ESP32 240M four point two two eight four point one five eighteen point nine zero two eighteen point seven five seven The unit of calculation result is seconds All firmware are updated to the latest version. Except for microbit and esp32 lobo, the firmware version is 1.9.4-479., 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