当前位置:网站首页>【开源工程】STM32C8T6+ADC信号采集+OLED波形显示
【开源工程】STM32C8T6+ADC信号采集+OLED波形显示
2022-07-25 18:41:00 【perseverance52】
【开源工程】STM32C8T6+ADC信号采集+OLED波形显示
- 通过手指皮肤接触探测输入引脚:
PA7
PA8引脚上的方波输出
PB13引脚上的方波输出
PB13和PA8:互补型方波输出引脚
硬件搭建
- OLED屏幕:可以是0.96寸屏幕或者是1.3寸 IIC接口的OLED屏幕
STM32F103C8T6最新系统板一块- 若干导线
工程架构

接线说明
ADC检测引脚:PA7,相关定义在BSP_ADC.h
OLED IIC引脚定义:bsp_i2c_gpio.h
SDA --- PA3
SCL --- PA2
PWM方波输出引脚:BSP_ADVANCED_TIMER.h
PB13和PA8:互补型方波输出引脚,
PB12:低电平
0.96寸屏幕和1.3寸屏幕驱动细节差异说明
在
OLED_I2C.c文件中
- 清屏函数
void OLED_CLS(void)//清屏
{
uint8_t i,j;
for(i=0;i<8;i++)
{
WriteCmd(0xb0+i); //page0-page8
WriteCmd(0x02); //low column start address1.3寸屏幕发送地址是从0x02开始的,0.96屏幕是从0x00地址开始的特别注意个地方!!!!
WriteCmd(0x10); //high column start address
for(j=0;j<128;j++)
{
DataBuffer[i][j]=0x00;
}
}
Write_DataBuffer();
}
- 初始化函数
void OLED_Init(void)
{
i2c_CfgGpio(); /*I2C总线的GPIO初始化*/
Delay_ms(1000); // 1s,这里的延时很重要,上电后延时,没有错误的冗余设计
WriteCmd(0xAE); //display off
WriteCmd(0x20); //Set Memory Addressing Mode
WriteCmd(0x10); //00,Horizontal Addressing Mode;01,Vertical Addressing Mode;10,Page Addressing Mode (RESET);11,Invalid
WriteCmd(0xb0); //Set Page Start Address for Page Addressing Mode,0-7
WriteCmd(0xc8); //Set COM Output Scan Direction
WriteCmd(0x02); //---set low column address1.3寸屏幕发送地址是从0x02开始的,0.96屏幕是从0x00地址开始的
WriteCmd(0x10); //---set high column address
WriteCmd(0x40); //--set start line address
WriteCmd(0x81); //--set contrast control register
WriteCmd(0xff); //亮度调节 0x00~0xff
WriteCmd(0xa1); //--set segment re-map 0 to 127
WriteCmd(0xa6); //--set normal display
WriteCmd(0xa8); //--set multiplex ratio(1 to 64)
WriteCmd(0x3F); //
WriteCmd(0xa4); //0xa4,Output follows RAM content;0xa5,Output ignores RAM content
WriteCmd(0xd3); //-set display offset
WriteCmd(0x00); //-not offset
WriteCmd(0xd5); //--set display clock divide ratio/oscillator frequency
WriteCmd(0xf0); //--set divide ratio
WriteCmd(0xd9); //--set pre-charge period
WriteCmd(0x22); //
WriteCmd(0xda); //--set com pins hardware configuration
WriteCmd(0x12);
WriteCmd(0xdb); //--set vcomh
WriteCmd(0x20); //0x20,0.77xVcc
WriteCmd(0x8d); //--set DC-DC enable
WriteCmd(0x14); //
WriteCmd(0xaf); //--turn on oled panel
}
本代码默认采用的是1.3寸的屏幕驱动显示
资源链接
0C币,0积分,无套路!,0C币,0积分,无套路!,0C币,0积分,无套路!,重要的事情说三遍。
- 带引脚说明注释版
链接:https://pan.baidu.com/s/1uGAJVJs7Z1E4Mb2FSrRGFw
提取码:mrdp
边栏推荐
- TypeError: Unrecognized value type: <class ‘str‘> ParserError: Unknown string format
- Tensor to img & imge to tensor (tensor conversion of pytorch)
- 7. 依赖注入
- Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
- Practice of RTC performance automation tool in memory optimization scenario
- Common file operations
- [QNX Hypervisor 2.2用户手册]9.4 dryrun
- 【帮助中心】为您的客户提供自助服务的核心选项
- [translation] logstash, fluent, fluent bit, or vector? How to choose the right open source log collector
- 11.1-cm24 nearest common ancestor
猜你喜欢

Tang's little helper

GAN的详细介绍及其应用(全面且完整)

电流探头在ECU、电气系统电流测量的应用

SQL things
![[web page performance optimization] what about the slow loading speed of the first screen of SPA (single page application)?](/img/e2/9b62dd9bd0f2bc8dcbb6d9c851254d.png)
[web page performance optimization] what about the slow loading speed of the first screen of SPA (single page application)?

C language -- 25 minesweeping game

韩国AI团队抄袭震动学界!1个导师带51个学生,还是抄袭惯犯

优秀的测试/开发程序员突破,不忘初心,方得始终......

JVM基础和问题分析入门笔记

How to add EXE file to boot
随机推荐
浏览器内核有几种,浏览器版本过低怎么升级
Design practice of Netease strictly selecting inventory center
VC/PE正跑向青岛
【华为机试真题】字符串匹配
【帮助中心】为您的客户提供自助服务的核心选项
Dachang cloud business adjustment, a new round of war turn
Practice of RTC performance automation tool in memory optimization scenario
黄鹤楼超震撼视角,这样的VR全景你绝对没见过!
Combined with GHS multi, use Reza E1 simulator to realize the simulation and debugging of Reza rh850 single chip microcomputer
What is the difference between GB and gib disk space units?
进程通信(SystemV通信方式:共享内存,消息队列,信号量)
推特收购舆论战,被马斯克变成了小孩吵架
Tensor to img && imge to tensor (pytorch的tensor转换)
8 年产品经验,我总结了这些持续高效研发实践经验 · 研发篇
JVM基础和问题分析入门笔记
曾拿2亿融资,昔日网红书店如今全国闭店,60家店仅剩3家
GAN的详细介绍及其应用(全面且完整)
[Huawei machine test real question] string matching
Osmosis通过与Axelar和Moonbeam的集成将跨链足迹扩展至波卡
Optimistic lock resolution