4387 views|7 replies

1452

Posts

1

Resources
The OP
 

[MM32 eMiniBoard Review] + Display driver for color OLED screen [Copy link]

 

We have introduced the display of dual-color OLED screen before. Can the MM32 eMiniBoard development board drive a color OLED screen?

The answer is yes, and the display effect is shown in Figures 1 and 2.

Figure 1 String and Chinese character display

Figure 2 Icon display

Different from the dual-color screen with I2C interface, the color screen uses SPI interface, so it occupies more I/O ports than the dual-color screen.

So which pins are used?

Here the connection relationship between the OLED screen and the MCU is:

SCK-PB13 CL

MISO--PB14 SDA

MOSI--PB15 RST

SS--PB12 DC

LD1--PA15 CS

LD2-PB3 BLK

I wanted to stick the light of the Arduino interface, but unfortunately, I don’t know when the OLED screens produced now all take GND as the boss!

They made a good Arduino interface, but they can't directly plug in the OLED screen for use. I really don't know why they have such ulterior motives!

There’s no way, the arm can’t twist the thigh!

It is better to use DuPont wire to exchange the line sequence.

The statements that define the high and low levels of the related pins are as follows:

#define OLED_SCLK_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_13) //CLK

#define OLED_SCLK_Set() GPIO_SetBits(GPIOB,GPIO_Pin_13)

#define OLED_SDIN_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_14) //DIN

#define OLED_SDIN_Set() GPIO_SetBits(GPIOB,GPIO_Pin_14)

#define OLED_RST_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_15) //RES

#define OLED_RST_Set() GPIO_SetBits(GPIOB,GPIO_Pin_15)

#define OLED_DC_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_12) //DC

#define OLED_DC_Set() GPIO_SetBits(GPIOB,GPIO_Pin_12)

#define OLED_CS_Clr() GPIO_ResetBits(GPIOA,GPIO_Pin_15) //CS

#define OLED_CS_Set() GPIO_SetBits(GPIOA,GPIO_Pin_15)

#define OLED_BLK_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_3) //BLK

#define OLED_BLK_Set() GPIO_SetBits(GPIOB,GPIO_Pin_3)

The function to configure the pin as output is:

void APP_OLED_Init(void)
{
 GPIO_InitTypeDef GPIO_InitStructure;
 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);
 GPIO_StructInit(&GPIO_InitStructure);
 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_14| GPIO_Pin_15| GPIO_Pin_12| GPIO_Pin_3;
 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
 GPIO_Init(GPIOB, &GPIO_InitStructure);
 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
  GPIO_StructInit(&GPIO_InitStructure);
 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
 GPIO_Init(GPIOA, &GPIO_InitStructure);
}

The function that completes the string display is:

void LCD_ShowString(u16 x,u16 y,const u8 *p,u16 color)
{
 while(*p!='\0')
 {
 if(x>LCD_W-16){x=0;y+=16;}
 if(y>LCD_H-16){y=x=0;LCD_Clear(RED);}
 LCD_ShowChar(x,y,*p,0,color);
 x+=8;
 p++;
 }
}

The function that realizes icon display is:

void LCD_ShowPicture(u16 x1,u16 y1,u16 x2,u16 y2)
{
  int i;
  LCD_Address_Set(x1,y1,x2,y2);
  for(i=0;i<1600;i++)
  {
 LCD_WR_DATA8(image[i*2+1]);
 LCD_WR_DATA8(image[i*2]);
  }
}

The main program to achieve the display effects of Figures 1 and 2 is:

s32 main(void)
{
       u8 i;
      LED_Init();
      DELAY_Init();
    APP_OLED_Init();
       OLED_BLK_Set();
  Lcd_Init();
      LCD_Clear(BLACK);
  BACK_COLOR=BLACK;
  LCD_ShowChinese(28,0,0,32,YELLOW);
  LCD_ShowChinese(60,0,1,32,YELLOW);
  LCD_ShowChinese(92,0,2,32,YELLOW);
  LCD_ShowChinese(20,40,0,16,YELLOW);
  LCD_ShowChinese(36,40,1,16,YELLOW);
  LCD_ShowChinese(52,40,2,16,YELLOW);
  LCD_ShowChinese(68,40,3,16,YELLOW);
  LCD_ShowChinese(84,40,4,16,YELLOW);
  LCD_ShowChinese(100,40,5,16,YELLOW);
  LCD_ShowChinese(116,40,6,16,YELLOW);
  LCD_ShowString(0,60,"0.96 TFT SPI",YELLOW);
     DELAY_Ms(1000);
       LCD_Clear(BLACK);
  LCD_ShowString(10,0,"LCD_W:",RED);
  LCD_ShowNum(70,0,LCD_W,3,RED);
  LCD_ShowString(10,20,"LCD_H:",RED);
  LCD_ShowNum(70,20,LCD_H,2,RED);
  for(i=0;i<4;i++)
  {
 LCD_ShowPicture(i*40,40,39+i*40,79);
  }
  while(1);
}

This post is from Domestic Chip Exchange

Latest reply

Thanks for sharing   Details Published on 2021-5-21 10:10
 
 

1942

Posts

2

Resources
2
 

How is the refresh rate? Is the tearing effect easily visible?

This post is from Domestic Chip Exchange

Comments

Fortunately, I don't want to flash a 2.2' TFT screen that has to unfold downwards section by section.  Details Published on 2020-11-17 13:42
 
 
 

1452

Posts

1

Resources
3
 
This post was last edited by jinglixixi on 2020-11-17 13:44
w494143467 Published on 2020-11-17 09:52 How is the screen refresh speed? Is the tearing effect easy to see?

Fortunately, I don't want to flash a 2.2' TFT screen that has to unfold downwards section by section.

I used PIC16F15324 to make a two-color OLED screen display, and it really displays in pieces!

This post is from Domestic Chip Exchange
 
 
 

7422

Posts

2

Resources
4
 

There are so many things to do, and Zhongjing Garden is such a familiar name.

This post is from Domestic Chip Exchange

Comments

There are so many things to play with, but the money in my pocket limits my purchasing power! In the future, the LED light master will probably give way to OLED (O yeah),   Details Published on 2020-11-18 00:06
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

1452

Posts

1

Resources
5
 
freebsder posted on 2020-11-17 21:30 There are so many things to play with, and Zhongjingyuan is a very familiar name.

There are so many things to play with, but the money in my pocket limits my purchasing power!

In the future, LED will probably give way to OLED (yeah).

This post is from Domestic Chip Exchange
 
 
 

1w

Posts

204

Resources
6
 

Smart MM32 eMiniBoard Development Board Review

Summary post: https://en.eeworld.com/bbs/thread-1146791-1-1.html

This post is from Domestic Chip Exchange
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

玩板看这里:

http://en.eeworld.com/bbs/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 
 

661

Posts

0

Resources
7
 

Thanks for sharing

This post is from Domestic Chip Exchange

Comments

Thanks for your support!  Details Published on 2021-5-21 20:40
 
 
 

1452

Posts

1

Resources
8
 

Thanks for your support!

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

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

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