2098 views|6 replies

1w

Posts

16

Resources
The OP
 

[AT-START-F403A Review] 5. Simulate the SPI screen and find a problem [Copy link]

 This post was last edited by ddllxxrr on 2020-10-6 19:26

I have a 1.3-inch SPI screen. If there is a routine, I put the OLED.c and font library in the routine as a subdirectory. All of them are tested in an AT routine.

I defined four lines:

PB12---------SCL

PB13----------SDA

PB14----------RES

PB15----------DC

Specifically, change the initialization:

RCC_APB2PeriphClockCmd(RCC_APB2PERIPH_GPIOB, ENABLE);	 //ê1üAúê±ó
	GPIO_InitStructure.GPIO_Pins = GPIO_Pins_12|GPIO_Pins_13|GPIO_Pins_14|GPIO_Pins_15;	 
 	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT_PP; 		 //ííìê3
	GPIO_InitStructure.GPIO_MaxSpeed = GPIO_MaxSpeed_50MHz;//ùè50MHz
 	GPIO_Init(GPIOB, &GPIO_InitStructure);	  //3êˉGPIOD3,6
 	GPIO_SetBits(GPIOB,GPIO_Pins_12|GPIO_Pins_13|GPIO_Pins_14|GPIO_Pins_15);	

In the header file:

#define OLED_SCLK_Clr() GPIO_ResetBits(GPIOB,GPIO_Pins_12)//CLK
#define OLED_SCLK_Set() GPIO_SetBits(GPIOB,GPIO_Pins_12)

#define OLED_SDIN_Clr() GPIO_ResetBits(GPIOB,GPIO_Pins_13)//DIN
#define OLED_SDIN_Set() GPIO_SetBits(GPIOB,GPIO_Pins_13)

#define OLED_RST_Clr() GPIO_ResetBits(GPIOB,GPIO_Pins_14)//RES
#define OLED_RST_Set() GPIO_SetBits(GPIOB,GPIO_Pins_14)

#define OLED_DC_Clr() GPIO_ResetBits(GPIOB,GPIO_Pins_15)//DC
#define OLED_DC_Set() GPIO_SetBits(GPIOB,GPIO_Pins_15)
 		     
#define OLED_BLK_Clr()  GPIO_ResetBits(GPIOA,GPIO_Pins_4)//CS
#define OLED_BLK_Set()  GPIO_SetBits(GPIOA,GPIO_Pins_4)

The background is useless, just connect it directly to 3.3V.

As for the chip select, I just selected it. After all, it's just one SPI.

Here are the results:

When I flashed to a blue screen, it means the driver was successful. I can also see a circle when I draw it, but I never expected that a character would not be displayed. It is just a black block. I think there is something wrong with the character display part of the SPI screen.

I don't want to think about it anymore. I'm so tired of thinking about it. To know what happens next, please read the next chapter!

I found a problem. The manual clearly said that all GPIO ports are in AHB, but why are they all APB2 during initialization? I don't understand.

RCC_APB2PeriphClockCmd(RCC_APB2PERIPH_GPIOB, ENABLE);	 

According to the manual, it should be: RCC_AHBPeriphClockCmd(RCC_AHBPERIPH_GPIOB, ENABLE);

This post is from Domestic Chip Exchange

Latest reply

Check with a logic analyzer   Details Published on 2020-10-13 22:13
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
 
 

9720

Posts

24

Resources
2
 

Is it normal to operate this screen in this way when using other microcontrollers before?

This post is from Domestic Chip Exchange

Comments

I remember it was normal! The screen has turned blue?  Details Published on 2020-10-7 14:25
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

1w

Posts

16

Resources
3
 
littleshrimp posted on 2020-10-6 20:08 Is it normal to operate this screen in this way with other microcontrollers before?

I remember it was normal! The screen has turned blue?

This post is from Domestic Chip Exchange
Personal signaturehttp://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
 
 
 

1w

Posts

204

Resources
4
 

Yatli AT-START-F403A Review Summary

https://bbs.eeworld.com.cn/thread-1143018-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

玩板看这里:

https://bbs.eeworld.com.cn/elecplay.html

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

 
 
 

1942

Posts

2

Resources
5
 

If the screen can be refreshed, then there must be no problem with the SPI driver. The only possible problem is the function of displaying characters. When debugging, check what the displayed characters are. It may be that all 0x000000 is written, resulting in a black display.

This post is from Domestic Chip Exchange
 
 
 

7462

Posts

2

Resources
6
 

Why do you like gpio simulation?

This post is from Domestic Chip Exchange
Personal signature

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

 
 
 

1366

Posts

6

Resources
7
 

Check with a logic analyzer

This post is from Domestic Chip Exchange
Personal signature

1084534438 欢迎交流  [加油,一切皆有可能]

 
 
 

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