5035 views|5 replies

6818

Posts

11

Resources
The OP
 

[Qinheng RISC-V core CH582] I2C lights up the OLED screen [Copy link]

 

SSD1306 is an OLED driver chip with a maximum support of 128*64 pixels, and is widely used in driving small-size OLED displays. In particular, its low display power consumption makes it a good combination for wearable devices when combined with CH582M.

This time, analog I2C is used for driving. The SDA and SCL are configured as follows.

GPIOB_SetBits( GPIO_Pin_12 );
GPIOB_SetBits( GPIO_Pin_13 );
GPIOB_ModeCfg( GPIO_Pin_12, GPIO_ModeOut_PP_20mA ); //SDA
GPIOB_ModeCfg( GPIO_Pin_13, GPIO_ModeOut_PP_20mA ); //SLC

Then the driver is to modify my previous driver. In fact, there is a lot of information about SSD1306 on the Internet:

#define OLED_SCL_Clr() GPIOB_ResetBits(GPIO_Pin_13)//SCL
#define OLED_SCL_Set() GPIOB_SetBits(GPIO_Pin_13)

#define OLED_SDA_Clr() GPIOB_ResetBits(GPIO_Pin_12)//SDA
#define OLED_SDA_Set() GPIOB_SetBits(GPIO_Pin_12)

After modifying the above parameters, SSD1306 is successfully driven:

OLED_Init(); //Initialize OLED
OLED_ColorTurn(0);//0 normal display, 1 inverted color display
OLED_DisplayTurn(0);//0 normal display 1 screen flip display
OLED_Clear();
mDelaymS(800);
OLED_ShowString(8, 6, "Hello EEWORLD!", 16, 1);
OLED_ShowString(22, 26, "CH582M", 24, 1);
OLED_ShowNum(12, 52, 2022, 4, 12, 1);
OLED_ShowChinese(40,52,9,12,1);//12*12
OLED_ShowNum(54, 52, 2, 1, 12, 1);
OLED_ShowChinese(64,52,10,12,1);//12*12 Month
OLED_ShowNum(80, 52, 26, 2, 12, 1);
OLED_ShowChinese(94,52,2,12,1);//12*12 Day
OLED_Refresh();

The project files are uploaded as follows:

I2C-OLED.7z (168.22 KB, downloads: 114)


This post is from Domestic Chip Exchange

Latest reply

Now I want to display the value collected by ADC, but I haven't succeeded yet   Details Published on 2023-1-8 20:23
 
 

3

Posts

0

Resources
2
 
There seems to be a problem with the project file, and mrs compilation failed
This post is from Domestic Chip Exchange

Comments

You need to look at the reference path of the project and header files, etc. See what the error is and adjust it.  Details Published on 2023-1-8 18:12
 
 
 

6818

Posts

11

Resources
3
 
珏珲1 posted on 2023-1-8 16:56 There seems to be a problem with the project file, mrs compilation failed

You need to look at the reference path of the project and header files, etc. See what the error is and adjust it.

This post is from Domestic Chip Exchange
 
 
 

3

Posts

0

Resources
4
 
lugl4313820 posted on 2023-1-8 18:12 You need to check the reference path of the project and header files. Check the specific error and adjust it.

Solved, a few header files were missing, and the main file was replaced with other projects;

Also, it says that the definition of the function `TMR0_TimerInit' is not found, and CH58x_timer0.c is not compiled.

Refer to the big guy's post and right click to add it

This post is from Domestic Chip Exchange
 
 
 

3

Posts

0

Resources
5
 

Now I want to display the value collected by ADC, but I haven't succeeded yet

This post is from Domestic Chip Exchange

Comments

Come on, Qinheng’s products are very easy to use, affordable, and have good power consumption.  Details Published on 2023-1-9 08:37
 
 
 

6818

Posts

11

Resources
6
 
珏珲1 posted on 2023-1-8 20:23 Now I want to display the value collected by ADC, but it has not been successful

Come on, Qinheng’s products are very easy to use, affordable, and have good power consumption.

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list