51 single chip microcomputer displays any Chinese characters and characters on OLED

Publisher:平凡幸福Latest update time:2020-01-06 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The microcontroller model is STC8A8K64S4A12, the font chip is W25Q128 (the font is written into w25q128 using the Atomic Battleship board), and the OLED is a 0.96-inch SPI interface.


The program was modified based on atomic OLED experiments and Chinese character display experiments, and can display 12, 16, 24 characters and Chinese characters.
oled wiring:
sbit OLED_CS = P0^3;
sbit OLED_RS = P0^4;
sbit OLED_RST = P0^5;         
sbit OLED_SDIN = P0^6;
sbit OLED_SCLK = P0^7;

W25Q128 wiring:
cs to P2^2
mosi to P2^3
miso to P2^4
clk to P2^5

 





#include "stc8.h"
#include "oled.h"
#include "bmp.h"
#include "spi.h"
#include "flash.h"

u8 buffer[19]; ​​//receive array
int main(void)
{                                           
        u8 t=0;                    
  SP=0X80; //adjust the stack pointer manual page 286 detailed explanation
    Init_SPI(); //SPI initialization
        OLED_Init(); //initialize OLED
        OLED_Display_Off();
        OLED_Display_On();
        OLED_Fill(0,0,1,1,1);

          OLED_ShowString(0,0,"ABCDEFGH",24);  
        OLED_Refresh_Gram(); //Update the display to OLED
        OLED_ShowString(0,24, "0.96' OLED TEST",16);  
        SPI_Flash_Read(buffer,100,16); //Read the string at address 100 and store it in the buffer array
        OLED_ShowString(0,40,buffer,12);  
        OLED_ShowString(0,52,"ASCII:",12);  
        OLED_ShowString(64,52,"CODE:",12);  
        OLED_Clear();
        Show_Str(0,0,128,16,"Battleship STM32F Development Board",12,0);
        Show_Str(0,18,128,16,"Primary Maintenance Electrician",16,0);                
        Show_Str(0,36,128,24,"Zhongjingyuan Electronics",24,0);        
        OLED_Refresh_Gram(); //Update display to OLED         
        t=' ';  
        while(1) 
        {                
        
        }        
}

Reference address:51 single chip microcomputer displays any Chinese characters and characters on OLED

Previous article:Comprehensive course design of electronic password lock based on 51 single chip microcomputer
Next article:Proteus simulation program design of 51 single-chip microcomputer product quantity automatic measurement system

Recommended ReadingLatest update time:2024-11-16 12:00

51 MCU OLED+dht11 display temperature
I have been learning 51 MCU for more than a month. I stayed up all night to participate in a competition and wrote the OLED+DHT11 program. The MCU source program is as follows: #include "REG51.h" #include "oled.h" #include intrins.h typedef unsigned char BYTE; typedef unsigned int WORD; #define uint unsigned int  #
[Microcontroller]
BOE exclusively supplies realme GT5 Pro to create the highlight moment of the flexible OLED flagship screen
On December 7, realme launched the high-end flagship product Realme GT5 Pro at a press conference. This product is equipped with a high-definition flexible OLED screen exclusively provided by BOE, with powerful performance and excellent technical upgrades, bringing users a new experience of a high-definition eye-prote
[Mobile phone portable]
Chip shortage: Xiaomi, OV, and Apple compete for Samsung's OLED orders
      IT Home reported on April 16 that it is well known that Samsung Display's screens are among the top products in the global industrial chain, with stable and high-quality supply capabilities.   According to Jiwei.com, supply chain sources revealed that Samsung Display OLED panels are being snapped up, and Xiaom
[Mobile phone portable]
iPhone 12 mini sales are not good, Apple will compensate by purchasing Samsung OLED displays
      Foreign media MacRumors reported that according to the Korea Herald, due to lower-than-expected demand for the iPhone 12 mini model, Apple is likely to compensate Samsung Display for insufficient OLED panel orders.   According to Omdia market data, Samsung's global small-size OLED shipments fell 9% month-on-mont
[Mobile phone portable]
OLED display implementation method based on single chip microcomputer
    1 Introduction      Organic electroluminescent display, also known as organic light emitting diode (OrganICLightEMIttingDiode, OLED) or organic light emitting display OrganicLightEmittingDisplay (OLED), has obvious advantages over the popular liquid crystal display (LCD) on the market, mainly manifested in: self-l
[Microcontroller]
OLED display implementation method based on single chip microcomputer
See-through OLED display with eye-interaction capabilities
  Organic light-emitting diode (OLED)-based microdisplays have achieved high optical performance, with excellent contrast and large dynamic range, and low power consumption. They use a direct light-emitting mechanism and do not require an additional backlight, so they can be made very small and lightweight, making t
[Power Management]
See-through OLED display with eye-interaction capabilities
$9.8 billion, Apple will be the world's largest buyer of OLED panels this year
According to foreign media reports, analysts and research institutions generally expect that Apple, which failed to launch a 5G iPhone last year, will launch four iPhone 12 models that support 5G network connections in the second half of this year.                                                  In addition to suppo
[Mobile phone portable]
$9.8 billion, Apple will be the world's largest buyer of OLED panels this year
Manufacturers around the world are developing inkjet printing OLED technology, and Japan may be the first to commercialize it
Recently, according to industry insiders, many flat panel manufacturers in Japan, South Korea, Taiwan and mainland China are developing inkjet printing OLED technology, and Japan's JOLED may be the first company to launch commercial products in 2020.   Among them, Chinese companies including BOE Technology, China Star
[Embedded]
Manufacturers around the world are developing inkjet printing OLED technology, and Japan may be the first to commercialize it
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号