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)
{
}
}
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
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University Hall----Live Replay: TI takes you to experience the interconnected and efficient smart home solution
- Thank you all for your help. Thank you very much.
- Array sorting problem
- Robust Design of I2C Serial EEPROM Application System.pdf
- Original 100KWh Solar Photovoltaic Off-Grid Battery Management System
- What are some good ways to reverse check silk screen printing? Welcome to chat and share your experience
- Upgrade the embedded RISC-V compiler
- [HC32F460 Development Board Review] 02. Build the development environment, create a project, and implement the LED flashing function
- DCDC ripple experiment
- Ask everyone a question about 4G wireless data transmission