Mm32f3277 microphoton experimental board design and software testing

Zhuo Qing 2021-11-25 11:02:00
mm32f3277 mm microphoton experimental board

Jane Medium : For as of (2021-11-08 21:13:44) From smart MicroPython stay MM32F3277 Test the consistent basic functions on . And give in addition MicroPython Of the relevant modules の Basic test call version .

key word MM32F3277,MicroPython

 

§01 set up Calculation requirements


stay Production test MM32F3277-MicroPython Minimum circuit board Tested based on MM32F3277 Of MicroPython Test board . You can also see that its clock does not need . The following design is suitable for the test of bread board MicroPython Test board .

One 、 Resource settings

1、MicroPython Support module

The following uses the module support category provided by smart Su Yong :

▲ chart 1.1.1 MM32F3277 Module in

▲ chart 1.1.1 MM32F3277 Module in

▲ chart 1.1.2 MM32F3277 Seven UART Corresponding pins

▲ chart 1.1.2 MM32F3277 Seven UART Corresponding pins

Two 、 Design circuit board

1、 Schematic diagram

▲ chart 1.2.1 Schematic diagram

▲ chart 1.2.1 Schematic diagram

2、PCB

▲ chart 1.2.2 Rapid plate making PCB The design

▲ chart 1.2.2 Rapid plate making PCB The design

3、 Revision

In the above design , For the analog power part (VDDA,VSSA) No one can supply power alone , This will affect ADC,DAC Signal performance . In the following version , take VDDA,VSSA Separate power supply .

AD\MM32\TestMM32\TestMM32MicroPythonPIN.SchDoc

▲ chart 1.2.3 take VDDA,VSSA use 0Ω Resistance for separate power supply

▲ chart 1.2.3 take VDDA,VSSA use 0Ω Resistance for separate power supply

▲ chart 1.2.4 Designed single side rapid plate making PCB chart

▲ chart 1.2.4 Designed single side rapid plate making PCB chart

The problem is :
In the above design , Remaining problems : It's just that there's no going to be VSSDA extraction , When an external signal is input , No signal bottom line .

3、 ... and 、 Welding and commissioning

Use One minute plate making method , Finish making the circuit board in five minutes , Welding and commissioning .

1、 Solder circuit board

Welding test circuit board , As shown in the figure below :

▲ chart 1.3.1 Test circuit board after welding

▲ chart 1.3.1 Test circuit board after welding

2、 Test circuit board

(1) Power on test

exert +5V Working voltage . Inside the measuring plate 3.3V The power supply voltage meets the requirements .

(2) download MicroPython

Come down from Su Yong MicroPython. This version requires an external crystal .

▲ chart 1.3.2 Use MM32-LINK download MicroPython

▲ chart 1.3.2 Use MM32-LINK download MicroPython

▲ chart 1.3.3 download MicroPython Then the clock signal is measured on the crystal

▲ chart 1.3.3 download MicroPython Then the clock signal is measured on the crystal

(3) test RX1

MicroPython After writing , After power on, it will send MicroPython Version information for . Can be in TX1 The waveform is measured on the .

▲ chart 1.3.4 Measure after power on TX1 The waveform on the screen

▲ chart 1.3.4 Measure after power on TX1 The waveform on the screen

(4) test REPL

Connect... On the beta REPL Interface (UART1) To the serial terminal of the computer , The version information can be read after the circuit board is powered on .

▲ chart 1.3.5 REPL Cue symbols

▲ chart 1.3.5 REPL Cue symbols

 

§02 test MicroPython


root According to Su Yong's feedback , Now this version MicroPython The following modules have been supported :Pin、ADC、UART、SDCard、utime. The use of modules follows MicroPython Official website The agreement given . Let's test the current version .

One 、 Basic information test

1、 Test code

from machine import Pin,ADC,UART,freq
import machine
import utime
dir(machine)
dir(utime)
freq()

2、 test result

Reset MicroPython...
Wait for MicroPython comeback...
Download MicroPython : 9 lines/109 characters.
Begin to download programm...
-------------------------------------------------------------------------
['__name__', 'ADC', 'Pin', 'SDCard', 'UART', 'freq', 'mem16', 'mem32', 'mem8']
['__name__', 'sleep', 'sleep_ms', 'sleep_us', 'ticks_add', 'ticks_cpu', 'ticks_diff', 'ticks_ms', 'ticks_us']
96000000
>>>

You can see from above , Inside OSC The frequency of is 96MHz.

Two 、 test utime

1、 Test code

from machine import Pin,ADC,UART,freq
import utime
while True:
print('A')
utime.sleep_ms(100)

2、 test result

REPL Interface output ’A’, every other 100ms Output a number .

3、 ... and 、 test Pin

test GPIO I / O function of .

1、 Test output

According to Su Yong's feedback :

from machine import Pin
pin0 = Pin('PB2', mode=Pin.OUT_PUSHPULL)
pin0(1)
pin0.low()

test GPIO Corresponding output function .

(1) Test code

from machine import Pin,ADC,UART,freq
import utime
led = Pin('PB2', Pin.OUT_PUSHPULL)
while True:
led(1)
utime.sleep_ms(100)
led(0)
utime.sleep_ms(100)

(2) test result

▲ chart 2.3.1 flashing PB2 Corresponding LED

▲ chart 2.3.1 flashing PB2 Corresponding LED

2、 test IO Minimum operation time

Pass the test twice IO Changes in high and low levels of , To test in MicroPython Next for IO The minimum operation time of the port .

(1) Test code

from machine import Pin,ADC,UART,freq
import utime
led = Pin('PB2', Pin.OUT_PUSHPULL)
while True:
led(1)
led(0)

(2) test result

By measuring LED According to the change waveform of the port , Perform the initial GPIO The time required for operation is about :17 μ s \mu s μs.

▲ chart 2.3.2 adjacent GPIO High and low level operation

▲ chart 2.3.2 adjacent GPIO High and low level operation

3、 Test input function

(1) Test code

from machine import Pin
import utime
led = Pin('PB2', Pin.OUT_PUSHPULL)
btn = Pin('PB7', Pin.IN_PULLUP)
print("Test Pin input and output.")
while True:
if btn.value() > 0:
led.high()
else: led.low()

(2) test result

Use the DuPont line to PB7 Grounding , Can be observed LED(PB2) Extinguish .

▲ chart 2.3.3 take PB7 Grounding can be observed PB2(LED) Extinguish

▲ chart 2.3.3 take PB7 Grounding can be observed PB2(LED) Extinguish

Four 、 test DAC

▲ chart 2.3.4 test DAC The sample program

▲ chart 2.3.4 test DAC The sample program

1、 Set output

DAC port :
DAC0:PA4
DAC1:PA5

(1) Test code

from machine import Pin,ADC,DAC
dac0 = DAC(0)
dac1 = DAC(1)
print('Test DAC ...')
dac0.write_u16(0x800)
dac1.write_u16(0x400)

(2) test result

Measure with a digital multimeter :

DAC Output voltage :
DAC0(PA4):1.649V
DAC1(PA5): 0.825V

2、 Output voltage curve

(1) Test code

from machine import Pin,ADC,DAC
from math import *
dac0 = DAC(0)
dac1 = DAC(1)
print('Test DAC ...')
angle = [int((sin(i * pi * 2 / 100)+1.0)/2*0x600+0x200) for i in range(100)]
print(angle)
while True:
for a in angle:
dac0.write_u16(a)
dac1.write_u16(0xa00 - a)

(2) test result

Use an oscilloscope to measure DAC0,DAC1 Waveform of .

▲ chart 2.4.1 DAC0,DAC1 The output waveform of

▲ chart 2.4.1 DAC0,DAC1 The output waveform of

5、 ... and 、 test ADC

1、 test ADC0

from machine import Pin,ADC,DAC
import utime
adc0 = ADC(0, init=True)
while True:
print(adc0.read_u16())
utime.sleep_ms(200)

stay PA0, Input DC voltage , You can test the output 0x0 ~ 0xffff The number . The output data is right aligned .

Be careful : first ADC When initializing , Need to put init=True Parameters are substituted into .

2、ADC Corresponding port

ADC All in all 16 Channels , The corresponding external ports are :

ADC port :
CH0~7:PA0~PA7
CH8,CH9:PB0,PB1
CH10~CH13:PC0~PC3
CH14,CH15:NULL

6、 ... and 、 test UART

1、UART port

UART port (RX,TX):
UART1:PA10, PA9
UART2:PA3,PA2
UART3:PB11,PB10
UART4:PC11,PC10
UART5:PD2,PC12
UART6:PC7,.PC6
UART7:PE7,PE8
UART8:PD1,PD0

2、 test UART2

(1) Test send

from machine import Pin,UART
import utime
uart2 = UART(1, 115200)
print('Test UART.')
while True:
_ = uart2.write(b'U')
utime.sleep_ms(10)

stay PA2(TX2) Measure the output waveform .

▲ chart 2.6.1 PA2(TX2) The measured waveform

▲ chart 2.6.1 PA2(TX2) The measured waveform

(2) Test reception

Use a short circuiting device to RXD3 And RXD1 come together , Also is to REPL Receive port of RXD1 Connected to the UART3 Receive port of .

Ⅰ. Test code
from machine import Pin,UART
import utime
uart2 = UART(2, 115200)
print('Test UART.')
buf = bytes(0)
while True:
if uart2.any():
buf = buf + uart2.read(uart2.any())
if buf[-1] == 13:
print(int(buf))
buf = bytes(0)
utime.sleep_ms(10)
Ⅱ. test result
>> Reset MicroPython...
>> Wait for MicroPython coming back...
>> Download MicroPython : 33 lines/707 characters.
>> -------------------------------------------------------------------------
Test UART.
333
3333
123
Traceback (most recent call last):
File "<stdin>", line 22, in <module>
ValueError: invalid syntax for integer
>>>

 

§03 zong Combined test


One 、 test DAC Output curve

adopt UART3 Send in DAC Convert numbers , Measure with a digital multimeter DAC0 Output voltage , And draw the output curve .

1、 Test code

from headm import *
from tsmodule.tsstm32 import *
writedim = list(range(0, 0xfff, 40))
vdim = []
for w in writedim:
stm32cmd('SENDC%03d\r'%w)
time.sleep(1.5)
meter = meterval()
vdim.append(meter[0])
plt.plot(writedim, vdim)
plt.xlabel("Number")
plt.ylabel("Voltage(V)")
plt.grid(True)
plt.tight_layout()
plt.show()
printf('\a')

2、 test result

Here we get DAC The relationship between the conversion value and the output voltage . You can see that there is a very good relationship between them e linear relationship .

▲ chart 3.1.1 DAC Convert value to output voltage

▲ chart 3.1.1 DAC Convert value to output voltage

Two 、 test DAC,ADC

1、 Test code

(1)MicroPython Program

from machine import DAC,ADC
import utime
adc0 = ADC(0, init=True)
dac0 = DAC(0)
vdim = []
outdim = list(range(0, 0xfff, 10))
print("Test DAC,ADC...")
for o in outdim:
dac0.write_u16(o)
utime.sleep_ms(2)
vdim.append(adc0.read_u16())
print(vdim)

(2) Draw the result program

from headm import *
from tsmodule.tsstm32 import *
stm32cmd('COPY')
time.sleep(.1)
allstr = clipboard.paste()
startid = allstr.find('[')
endid = allstr.find(']')
if startid < 0 or endid < 0:
printf("No data.\a")
exit()
datastr = [int(s) for s in allstr[startid + 1 : endid].split(',')]
printf(datastr)
plt.plot(datastr)
plt.xlabel("Number")
plt.ylabel("Voltage(V)")
plt.grid(True)
plt.tight_layout()
plt.show()

2、 test result

▲ chart 3.2.1 test result

▲ chart 3.2.1 test result

 

measuring Try to summarize ※


Yes As of (2021-11-08 21:13:44) From smart MicroPython stay MM32F3277 Test the consistent basic functions on . And give in addition MicroPython Of the relevant modules の Basic test call version .


■ Links to related literature :

● Related chart Links :

版权声明
本文为[Zhuo Qing]所创,转载请带上原文链接,感谢
https://pythonmana.com/2021/11/20211109010513850O.html

  1. Python basic syntax -- Boolean operation, break, continue, pass
  2. Python basic syntax -- loop
  3. Python first experience - efficient office, data analysis, crawler
  4. Modulenotfounderror: no module named 'Django summernote details
  5. Key points for Django to make personal blog website
  6. Path setting of templates in Django settings
  7. Leetcode 1611. Minimum one bit operations to make integers Zero (Python)
  8. Directory C: \ users \ a \ desktop \ Django_ The blog master is registered as the GIT root, but no git repository details are found there
  9. Django. Core. Exceptions. Improveconfigured: application labels aren't unique, duplicates: admin
  10. How to verify that Django has created the project details correctly
  11. How to create a database when using Django to construct a website
  12. The solution of using Django framework to create project in Windows system
  13. Running Python virtual environment on win10 system to execute ll_ Env \ scripts \ activate: unable to load file elaboration scheme
  14. Detailed explanation of constructing virtual environment with Django in Python 3
  15. Python implementation of affine cipher
  16. RC4 Python implementation
  17. Simple: Python_ Automatic body temperature clock
  18. 用python把两个csv中的日期的列提出年,做出新的一列,再把两个csv表格按照新做出的日期这列和ID号合并为一个表。
  19. python中类实例化后,其对象无法被其他模块调用方法
  20. [JSON] - Python creates JSON file format
  21. Utilisez Python pour proposer l'année de la colonne de date dans les deux CSV, faire une nouvelle colonne, puis combiner les deux tableaux CSV en un seul tableau avec la colonne de date et le numéro d'identification.
  22. 关于#python#的问题,请各位专家解答!
  23. ***
  24. ***
  25. 關於#python#的問題,請各比特專家解答!
  26. S'il vous plaît répondre aux questions de Python!
  27. About the import of Python class
  28. Magic Python property decorator: 1 line of code makes Python methods become properties in seconds
  29. Python 音频调整音量(附代码) | Python工具
  30. Python programming ideas [series of articles]
  31. Python crawler programming idea (67): modify nodes using pyquery
  32. Python crawler programming idea (66): using pyquery to obtain node information
  33. Python crawler programming idea (65): find nodes using pyquery
  34. Python crawler programming idea (64): using CSS selectors in pyquery
  35. Python crawler programming idea (63): basic knowledge of pyquery
  36. Python crawler programming idea (62): project practice: capturing cool dog online red song list
  37. Python crawler programming idea (61): project practice: capturing rental information
  38. Python crawler programming idea (60): get CSS selector code through browser
  39. Python爬虫编程思想(85):在Python中使用非关系型数据库
  40. Volume de réglage audio Python (avec Code) | outils Python
  41. Python crawler programming idea (59): get attribute value and text with beautiful soup CSS selector
  42. Python crawler programming idea (58): nested selection nodes with beautiful soup CSS selectors
  43. Python crawler programming idea (57): basic usage of CSS selector in beautiful soup
  44. Python crawler programming idea (56): find method of beautiful soup method selector
  45. Python crawler programming idea (55): find of beautiful soup method selector_ All method
  46. Python crawler programming idea (54): use beautiful soup to select sibling nodes
  47. Python crawler programming idea (53): use beautiful soup to select the parent node
  48. Django3.0 solves the problem of error reporting in reverse parsing
  49. Precautions for Python crawler
  50. Python 3 crawler series (1) -- climbing blind date websites
  51. Python到底是什么?为什么要学Python?
  52. #yyds干货盘点#Pandas数据清洗实用指南
  53. Python打包exe文件无法运行
  54. Two common ways to save files in Python
  55. #yyds幹貨盤點#Pandas數據清洗實用指南
  56. Yyds Dry Inventory pandas Data Cleaning Practical Guide
  57. PYTHON用LSTM长短期记忆神经网络的参数优化方法预测时间序列洗发水销售数据
  58. Python集成学习:自己编写构建AdaBoost分类模型可视化决策边界及sklearn包调用比较
  59. Python 3 makes a search software
  60. Python 3 simulated microblog login