当前位置:网站首页>Stm32mp1 cortex M4 development part 10: expansion board nixie tube control
Stm32mp1 cortex M4 development part 10: expansion board nixie tube control
2022-06-21 09:13:00 【Huaqing vision it open laboratory】
Write it at the front :
This article is 《ARM Cortex-M4 Bare metal development 》 One in a series ,, The total of the series 14 piece . The development platform used by the author is Huaqing vision FS-MP1A Development board (STM32MP157 Development board ),Cortex-M4 In addition to talking about bare metal development M4 Outside bare metal development , Will also explain through M4 Control various sensor actuator modules on the resource expansion board ( Including air temperature and humidity sensor 、LED The lamp 、 Nixie tube 、 Buzzer 、 Vibration motor 、 Key interrupt 、 Fans, etc ), This is M4 An article in the control resource expansion board .
The resource expansion board is FS-MP1A Expansion module of development board , Mainly consists of 10 More than one kind of auxiliary mainstream sensor 、 Executive device 、 Bus control device , Very convenient for project expansion . It can expand and develop smart families 、 Intelligent medical treatment 、 Intelligent security 、 Industrial control 、 Image recognition 、 Environmental detection, etc 10 About comprehensive projects , Huaqing vision development board will also provide supporting documentation for all projects 、 Experiment source code 、 Applications and other information .
in the light of FS-MP1A Development board , except Cortex-M4 Bare metal development , There are also many other series of tutorials , Include Cortex-A7 Development of article 、FreeRTOS piece 、Linux Foundation and application development 、Linux System transplantation 、Linux Driving development 、 Hardware design 、 Artificial intelligence machine vision 、Qt Application programming 、Qt Comprehensive project practice, etc . Welcome to your attention , more stm32mp157 Develop tutorials and videos , Technical exchange can be added Q Group 459754978, Thank you for attention .
FS-MP1A Development board details : TaoBao - Amoy ! I like
Catalog
1. Introduction to resource expansion board
1.2 Resource expansion board developable project
2. Expansion board nixie tube control
1. Introduction to resource expansion board
1.1 Hardware introduction

1.2 Resource expansion board developable project

2. Expansion board nixie tube control
2.1. Experimental principle
Open the schematic diagram of the expansion board. By comparing the expansion board, you can see the schematic diagram of the four digit nixie tube on the expansion board as follows :

From the figure, it can be determined that the digital tube is a common cathode digital tube ,DS_A、DS_B、DS_C、DS_D、DS_E、DS_F、DS_G、DS_DP Corresponding to each segment of the nixie tube , When the corresponding pin is high, the corresponding part will be charged , Because there is only one set of data signals , But there are four digital tubes , So we need to control DS_G1、DS_G2、DS_G3 and DS_G4 Select a certain nixie tube to display content , Then the four nixie tubes are displayed normally by polling and refreshing .


M74HC595 Is an in and out shift register , If there are multiple chips cascaded, the serial output can also control the next chip ,QA~QH For parallel output ,QH’ Serial output ; If this example has four LED The nixie tube consists of two M74HC595 control , The first level controls what the nixie tube displays , The second level controls which nixie tube displays .

According to the above description, the driver can be written through GPIO simulation 74HC595 Complete control of the clock , because 74H595 Timing sum SPI Timing compatibility , So you can also use SPI Controller control 74HC595.

74H595 Partial timing

SPI sequential (CPHA=0 CPOL=0)

Comparison diagram of interface between expansion board and backplane
Check out the chip manual , The corresponding relationship of pins is as follows :

2.2. The experiment purpose
understand M74HC595 shift register
Study SPI How to use the protocol , Master how to use STM32MP157A Chip controlled display nixie tube
2.3. Experimental environment
FS-MP1A Development platform
ST-Link Emulator
STM32CubeIDE Development software
PC machine XP、Window7/10 (32/64bit)
2.4. The experimental steps
open STM32CubeIDE, To configure CubeMX.
according to 21.1 section , It uses SPI Default pin , Respectively for PE11、PE12、PE13 and PE14 Configure to SPI_NSS、SPI_SCK、SPI_MISO and SPI_MOSI. Switch to SPI4 label , Check as “M4”,“Mode” choice “Full-Duplex-Master”, Use hardware chip selection , choice “Hardware NSS Output Signal”, Its configuration is shown in the figure below .

The above is the configuration process of new projects , May refer to 12.3.2 Chapter to import the existing project , Project storage path 【 Huaqing vision -FS-MP1A Development of information \02- Program source code \ARM Architecture and interface technology \Cortex-M4\9_EX_SPI_NUMBER】
Code design
The hardware used this time SPI, You don't need to write your own program to realize SPI sequential , All you need to do is call HAL Provided SPI Hardware operation function , among , call “HAL_SPI_Transmit” Function to send data from the master to the slave , establish driver_sm74hc.c file , In the document to achieve the control code of the nixie tube is as follows .
void M74HC595_ReadDataTest(void)
{
rw_595_Register(0X02,0X66);
HAL_Delay(1);
rw_595_Register(0X04,0X07);
HAL_Delay(1);
}
uint8_t rw_595_Register(uint8_t reg,uint8_t data)
{
uint8_t txdata[2] = {reg, data};
if(HAL_SPI_Transmit(&hspi4, txdata ,2,300) != HAL_OK)
{
Error_Handler();
}
return 0;
}
among , Parameters “reg” Indicates the number of nixie tube displays , Parameters “data” Indicates the contents displayed by the nixie tube .
Loop through the main function “rw_595_Register” Function to display specific content on the nixie tube , The experimental results are shown in the figure .

Hardware platform : Huaqing vision FS-MP1A Development board (STM32MP157)
Download some development tutorials : Add QQ Group 459754978, There are in the group file .
Watch some video courses : Personal space of Huaqing vision R & D Center _ Bili, Bili _Bilibili
Taobao purchase link : Huaqing vision stm32mp157 linux Development board stm32 Single chip microcomputer arm Develop embedded learning board
Mobile Taobao sharing code : Copy the text of this line and open hand Amoy ₤T4FPXn3YYJ2₤
边栏推荐
- How to generate QR code
- Common shortcut keys for idea
- nodejs的post请求json类型及表单类型
- Gql+nodejs+mysql database
- Abstractqueuedsynchronizer (AQS) source code detailed analysis - condition queue process analysis
- Doc common syntax, updating
- 【MGT】代码解读之model-MGT
- R language uses as The character function converts date vector data to string (character) vector data
- R language through rprofile Site file, user-defined configuration of R language development environment startup parameters, shutdown parameters, user-defined specified cran local image source download
- R language list data object, create list data object, index list data with [[], list data practice
猜你喜欢

ADO. Net - invalid size for size property, 0 - ado NET - The Size property has an invalid size of 0

【MGT】代码解读之model-MGT

Detailed analysis of ThreadPoolExecutor source code of thread pool

Unity 5 自帶的Mono也可以支持C# 6

Abstractqueuedsynchronizer (AQS) source code analysis - cyclicbarrier source code analysis

《网络是怎么样连接的》读书笔记 - FTTH

It is said that this year gold three silver four has become gold one silver two.

STL教程3-类型转换static_cast、dynamic_cast、const_cast、reinterpret_cast方法

【实战】STM32 FreeRTOS移植系列教程7:FreeRTOS 事件标志组

【实战】STM32 FreeRTOS移植系列教程2:FreeRTOS 互斥信号量
随机推荐
【JUC系列】Executor框架之CompletionService
Post-Process初级使用笔记(重要的几项)
R language uses as The date function converts a single character variable to date data and specifies the format of the data format conversion
android 数据库升级
The most authoritative Lei niukesi in history --- embedded Ai Road line [yyds]
Quick sort_ sort
Understanding and use of advanced pointer
Mono fourni avec l'unit é 5 peut également supporter C # 6
Topic34——31. 下一个排列
Unmanned, automation technology affects the world
R language uses the names function to modify the name of the data column variable, modify the name of the specified data column, and maintain the original data column name for the unmodified data colu
Figure out how MySQL works
AQS source code exploration_ 01 handwriting a simplified reentrantlock reentrant lock
如何使用 adb shell 查询进程流量情况
sql查看数据库/表磁盘占用情况,杀死进程终止tidb中的连接
Job hopping is better than promotion
[early knowledge of activities] list of recent activities of livevideostack
微信小程序
Ali has been working for 8 years. This learning note is left when he reaches P8. He has helped his friends get 10 offers
Alibaba cloud OSS uploading and intelligent image recognition garbage recognition