当前位置:网站首页>STM32 expansion board digital tube display
STM32 expansion board digital tube display
2022-07-01 04:50:00 【Flowers bloom in half】
Let's look at the schematic first
Nixie tube is made of 74HC595 Driven .
14 foot :DS: Serial data input pin
13 foot :OE: Output enable control pin , Low level enable output , So grounding
12 foot :ST_CP(RCK): The memory stores the clock pin , On the rising edge , Data is transferred from shift register to storage register
11 foot :SH_CP(SCK): Shift register clock pin , On the rising edge , The data in the shift register is shifted back as a whole , And accept new data ( from DS Input )
10 foot :MR: Low level active , Clear the existing data in the shift register , Generally do not use , Connect to high level
9 foot :Q7’: Serial data output , Cascade output , Next 595 Of DS End ( When the data in the shift register is more than 8 position , Will put the existing bits “ Squeeze out ”)
1-7 foot ,15 foot : Parallel output pin
seg.c
#include "seg.h"
uint8_t seg_table[] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00};
void DisplayValue(uint8_t value1,uint8_t value2,uint8_t value3)
{
uint8_t i = 0;
uint8_t value = 0;
RCLK_L; //ST_CP
value = seg_table[value3];
for(i = 0; i < 8; i++)
{
SCK_L;//SH_CP
if(value & 0x80)
{
SER_H;//DS
}
else
{
SER_L;
}
value <<= 1;
SCK_H;
}
value = seg_table[value2];
for(i = 0; i < 8; i++)
{
SCK_L;
if(value & 0x80)
{
SER_H;
}
else
{
SER_L;
}
value <<= 1;
SCK_H;
}
value = seg_table[value1];
for(i = 0; i < 8; i++)
{
SCK_L;
if(value & 0x80)
{
SER_H;
}
else
{
SER_L;
}
value <<= 1;
SCK_H;
}
RCLK_H;
}
seg.h
#ifndef _SEG_H_
#define _SEG_H_
#include "main.h"
#define RCLK_PIN GPIO_PIN_2
#define RCLK_PORT GPIOA
#define SER_PIN GPIO_PIN_1
#define SER_PORT GPIOA
#define SCK_PIN GPIO_PIN_3
#define SCK_PORT GPIOA
#define RCLK_H HAL_GPIO_WritePin(RCLK_PORT,RCLK_PIN,GPIO_PIN_SET);
#define RCLK_L HAL_GPIO_WritePin(RCLK_PORT,RCLK_PIN,GPIO_PIN_RESET);
#define SER_H HAL_GPIO_WritePin(SER_PORT,SER_PIN,GPIO_PIN_SET);
#define SER_L HAL_GPIO_WritePin(SER_PORT,SER_PIN,GPIO_PIN_RESET);
#define SCK_H HAL_GPIO_WritePin(SCK_PORT,SCK_PIN,GPIO_PIN_SET);
#define SCK_L HAL_GPIO_WritePin(SCK_PORT,SCK_PIN,GPIO_PIN_RESET);
void DisplayValue(uint8_t value1,uint8_t value2,uint8_t value3);
#endif
边栏推荐
- Basic skeleton of neural network nn Use of moudle
- Pytest automated testing - compare robotframework framework
- 线程类的几大创建方法
- 解决:拖动xib控件到代码文件中,报错setValue:forUndefinedKey:this class is not key value coding-compliant for the key
- [FTP] the solution to "227 entering passive mode" during FTP connection
- Pytorch(二) —— 激活函数、损失函数及其梯度
- Leecode question brushing record 1310 subarray XOR query
- C - detailed explanation of operators and summary of use cases
- Dede collection plug-in does not need to write rules
- Thread safety issues
猜你喜欢
[hard ten treasures] - 1 [basic knowledge] classification of power supply
pytorch 卷积操作
STM32扩展板 温度传感器和温湿度传感器的使用
Pytoch (IV) -- visual tool visdom
VIM easy to use tutorial
STM32 photoresistor sensor & two channel AD acquisition
神经网络-最大池化的使用
Pytorch(三) —— 函数优化
Difficulties in the development of knowledge map & the importance of building industry knowledge map
RuntimeError: “max_pool2d“ not implemented for ‘Long‘
随机推荐
Buffer stream and transform stream
Pytorch(一) —— 基本语法
Introduction to JVM stack and heap
pytorch神经网络搭建 模板
分布式-总结列表
线程安全问题
Dede collection plug-in does not need to write rules
FileInputStream
Solve the problem that the external chain file of Qiankun sub application cannot be obtained
How do I sort a list of strings in dart- How can I sort a list of strings in Dart?
Pico Neo3手柄抓取物体
Talk about testdeploy
Use of dataloader
C read / write application configuration file app exe. Config and display it on the interface
【暑期每日一题】洛谷 P1629 邮递员送信(未完待续...)
FileOutPutStream
对象的序列化与反序列化
【硬十宝典目录】——转载自“硬件十万个为什么”(持续更新中~~)
Data loading and preprocessing
LeetCode522-最长特殊序列II-哈希表-字符串-双指针