当前位置:网站首页>【开源工程】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
边栏推荐
- [noi2015] package manager
- 7/24 训练日志
- Detailed introduction and application of GaN (comprehensive and complete)
- Nc78 reverse linked list
- Typescript反射对象Reflect使用
- What is national debt reverse repurchase? Is it safe?
- Software testing -- common testing tools
- 8 年产品经验,我总结了这些持续高效研发实践经验 · 研发篇
- 想要做好软件测试,可以先了解AST、SCA和渗透测试
- Northeast people know sexiness best
猜你喜欢

Care for front-line epidemic prevention workers, Haocheng JIAYE and Gaomidian sub district office jointly build the great wall of public welfare
![[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)?

黄鹤楼超震撼视角,这样的VR全景你绝对没见过!

rust多线程安全计数

How to add EXE file to boot

Practice of RTC performance automation tool in memory optimization scenario

分享六个实用的小程序插件

终极套娃 2.0 | 云原生交付的封装

Trust multithread security count

这是一张机器&深度学习代码速查表
随机推荐
What is 3DE experience platform
3DE reply
拍卖行作VC,第一次出手就投了个Web3
8 年产品经验,我总结了这些持续高效研发实践经验 · 研发篇
Northeast people know sexiness best
Vc/pe is running towards Qingdao
中信证券低佣金开户免5是真的吗,安全吗
[noi2015] package manager
Tang's little helper
Project: serial port receiving RAM storage TFT display (complete design)
Detailed explanation of super full mavan label
终极套娃 2.0 | 云原生交付的封装
Is it true that CITIC Securities' low commission account opening is free of 5? Is it safe
Jz71 jump step expansion problem
How to create an effective help document?
关爱一线防疫工作者,浩城嘉业携手高米店街道办事处共筑公益长城
Practice of RTC performance automation tool in memory optimization scenario
11.2-hj86 find the maximum number of continuous bits
MySQL index optimization introduction
[HAOI2015]树上操作