Jane Medium ： This paper tests the results based on MM32F3277 Under the MicroPython Circuit board design . It includes SD Card interface , Common peripheral interfaces, etc . Verified the current transplant MicroPython The basic operation functions of files .
key word： MM32F3277,MicroPython,SD card
utilize MicroPython Developing embedded systems , It increases the flexibility of development at the expense of certain performance .MicroPython Explain the execution code , The hardware differences of the embedded bottom layer can be shielded .
stay Production test MM32F3277-MicroPython Minimum circuit board Designed based on MM32F3277 Of MicroPython It's a test board . From smart （MindMotion） Of MM32F3277 With rich resources . After testing two different MicroPython Migration version of , Can run well .
The above two MicroPython Version of , All need the help of external SD Card to store the final execution MicroPython Program ：
main.py. There is no external SD In the case of cards , They can only pass through REPL (
Read Evaluate Print Loop) Debug the program . This article will be in MM32F3277 Experiment board Add... To that SD Card interface part .
according to pyBoard v1.1-CN STM32F405RG MCU development board MicroPython Programming Configuration on board , It has been used. MICRO SD cassette Mini short TF cassette Memory card slot with detection pin 8P high H2.6/3.0MM . This kind of SD The card pack is available in three sizes ：
▲ chart 1.2.1 Short body H2.6MM Size of card holder
according to OneOS（ From SeekFree） On the evaluation board SD Card interface design , To design based on MM32F3277 Of SD Card interface .
Because of the... On this motherboard SD The card is already The previous two versions MicroPython The verification obtained in .
▲ chart 1.2.2 SD Card interface definition
According to the definition of card slot above , You can know SD The pin definition sequence of the card is shown in the following figure ：
▲ chart 1.2.3 SD Pin sequence definition of card and card slot
according to MM32F3277 User's Manual Definition of pins in , You can see ,SD The interface of the card uses MCU Of SDIO（ Secure digital I / O interface ）, compatible SD/SDIO/MMC Device controller , As an external control SD/SDIO/MMC Cartoon letter interface .
▲ chart 1.2.4 MM32F3277 Port function definition
According to the above SD Card slot data , stay AltumDesign Check the corresponding component library in . according to MICRO SD cassette Basic geometric parameters given on the web page , Design AD Component library in . The size of the fixed pad of the metal shell on both sides is unknown , Measure the specific size of each part through the picture .
▲ chart 1.3.1 Measure the geometric position on the drawing
PCB Package name ：SD-H26MM
▲ chart 1.3.2 Component packaging
Schematic device name ：MINI-SD
▲ chart 1.3.3 Schematic device definition
stay MM32F3277 MicroPython Experimental board design and software testing On the basis of , increase SD Card seat circuit , Design test circuit .
▲ chart 2.1.1 The circuit principle diagram
In order to fit A minute Plate making , The following designs are suitable for the production of single panel PCB.
▲ chart 2.1.2 Design fast plate making PCB
Here is a one minute plate making , Solder to form a test circuit board .
▲ chart 2.1.3 After one minute plate making , Solder to form a test circuit board
exert +5V Work point , Measure the... On the circuit board 3.3V Regulated output 3.3V. The static power consumption is about ：6mA about .
Use MM32-LINK It will come from Su Yong MicroPython（2021-11-5 edition ） Download to MM32F3277 in .
▲ chart 2.2.1 download MicroPython The process
From Su Yong MicroPython Use an external crystal clock , So it should be possible to measure on the external crystal 8MHz Crystal oscillation signal .
▲ chart 2.2.2 Oscillation signal on external crystal
because MicroPython After the start , Will be in REPL Port output version information , Therefore, it should be able to UART1 Of TX Measure the output signal .
▲ chart 2.2.3 After power on UART1 Of TX Measured output signal
Use STM32-Bootloader Connect to REPL port , test REPL Mutual operation .
▲ chart 2.2.4 stay STM32-BOOLOADER The received REPL Prompt
stay SD Pre stored in the card “test1.py” text file . And then in MicroPython To read .
The following is Su Yong's demonstration of the sample process of reading and writing files .
▲ chart 2.3.1 Demonstration example program given by Su Yong
from machine import Pin import utime with open('test.txt', 'w') as f: f.write('Hello SD file.') with open('test.txt', 'r') as f: print(f.read())
Program download and execution process ,REPL The interface is as follows ：
Reset MicroPython... Wait for MicroPython come back... Download MicroPython : 24 lines/576 characters. Begin to download program... ------------------------------------------------------------------------- 14 Hello SD file. >>>
Write... Is shown above SD file： 14 Bytes , Corresponding test.txt The length is 14. Then read the content and display it .
Use SD Reader writer , You can see SD There are just MicroPython Written file .
▲ chart 2.3.2 Windows Check out SD What's inside the card
Use another one only 512MB Of SD card , Test in MicroPython Whether you can read the contents of the card .
▲ chart 2.3.3 Test one 512M Of SD card
Use the same procedure ,MicroPython Display the following information ：
Reset MicroPython... Wait for MicroPython come back... Download MicroPython : 24 lines/576 characters. Begin to download program... ------------------------------------------------------------------------- Traceback (most recent call last): File "<stdin>", line 13, in <module> OSError: 19 >>>
stay SD Storage main.py,MicroPython After power on, first execute main.py Program .
Here is main.py The content of the test ：
from machine import Pin import utime for _ in range(10): print(_) utime.sleep_ms(100)
write in SD Kanazhong . take SD Card insertion test MicroPython Microplate ：
▲ chart 2.3.4 stay SD The card stores main.py
After power on , Program output ：
[Y] sdcard ready. [Y] file system on sdcard ready. [Y] run the main.py on disk ... 0 1 2 3 4 5 6 7 8 9 [Y] done. 1 MicroPython v1.16 on 2021-11-05; MB_F3270 with MM32F3277G7P >>>
Ben This paper tests the results based on MM32F3277 Under the MicroPython Circuit board design . It includes SD Card interface , Common peripheral interfaces, etc . Verified the current transplant MicroPython The basic operation functions of files .
■ Links to related literature :
● Related chart Links :
Xiao Chen wants to get a master's degree： Ask no questions , Smart cars this year 32 Are you going to omnidirectional beacon
G·RID er·Skye. D： How about the performance , What basically landed is still c and cpp Well , A little chicken ribs , But be an introduction , Or do an algorithm verification , If you pursue performance , Or write honestly c Well
Poan： I've seen Mr. Zhuo make plates in one minute , I still remember . It is suggested that Mr. Zhuo make a video about one minute plate making / article
Yuanjie：micropy It's really friendly for novices , Maybe it's a new creative direction , A sound platform is needed for the platform BSP Support , Otherwise, you need to connect yourself c-module 了 , It's not very friendly to novices .
Hi： In pursuit of performance, you should write assembly directly
： Today's game rules , Let's start the video game slowly
MOS.2SC3306： In pursuit of performance, you should write machine code directly
Power： What kind of product to use mcro Python Development ？
To the drizzly evening rain： So will there be rules tomorrow ？
forward： It is suggested to expand CH32V103 Application scope of
Roll baked cakes, roll steamed bread, roll everything： Zhuo Da Which will be used for wireless charging this year MCU ah
Roll baked cakes, roll steamed bread, roll everything： And four wheelsets These two groups MCU Are you sure
Thousands of handrails：python Development is very good , But without the embedded soul ,python Language is also unfavorable to the cultivation of programming norms , If you want to stay in this business , I can't use it python
Amateur： Mr. Zhuo ,micropython and arduino What is the difference in development , Can you tell me something ？
dust： Will there be rules for the 17th session today
dust： I still want to cooperate with more than four people
GH： Mr. Zhuo , When will the drone go out
Chen Shaochang： Teacher Su Gongyu has been demonstrating , Today, I will learn more about Mr. Zhuo's official account. , Will also take my students about to do so . Development is becoming more and more convenient , I feel the progress of the times and the convenience of technology . Think back to the last century 80 In the s, compile the underlying program , Single task single environment , Not much memory is arranged by ourselves , a pile EPROM For debugging ,……, Professor Tong Shibai's inspirational class , Mr. Hu Dongcheng, who wears high myopia glasses, still remembers the first lesson of modeling electricity , be visible before the eyes ,… While lamenting the rapid development of technology , At the same time, I am constantly thinking , As a teacher of today's electronic technology course , What is unchangeable ？ What should I teach the children ？
L Jianhao A kind of YH： The next one will do this , I really want to play . use c No layman can understand the language , use python It can also be loaded, and the program is more flexible .
Ye guanyong： First , Bare chips generally refer to cut die, You are using finished plastic packaging devices , Will this title cause misunderstanding , And then this PCB The design is really unspeakable
In the spring： Zhuo dada , There will be three cars this year
In the spring： Can there be five people in those three cars
HHW： Zhuo dada , There's still omnidirectional this year
West East .：mp The development method is absolutely the most friendly . It can be developed quickly , You don't need to know the bottom . Debug is convenient . It can quickly realize project functions . Although some performance is sacrificed , But the benefits outweigh the losses . At present, the library file is not as good as arduino Sufficient , Hope is growing
Mu Er Lei Zi： Is Infineon still used for the fourth round this year
Great Xia long： The key to this thing is to have a library , Otherwise, you can't meet your special needs
Red： My personal feeling , There's no need to separate it now C Language and microPython Which is better or worse? , Both sides have their own strengths , It will take time to test who is the one with more great vitality . Like I prefer to explore the principle ,C Closer to the underlying logic , It's easy to use , But there are also some people who pay more attention to results , Hope to use mpy Quick start , It's OK, too . But to tell you the truth, , As long as the structure and principle of computer composition have not made a major breakthrough , I don't think a better packaged language can fundamentally change .
Galaxy： Zhuo Da , I'd like to ask one 12V When the power supply supplies power to a switching power supply chip and a motor drive chip at the same time , How to determine the input capacitance here , Because both chips said to add their own specified capacitance
Boguan appointment： It is suggested to expand CH32V103 Application scope of