GithubHelp home page GithubHelp logo

128x64-spi-oledscreen-migration-guidance's Introduction

Guidance of 128x64 SPI OLEDscreen migration based on stm32f4xx

128x64 OLED SPI 0.96" Display

_2023/5/27 from cyc _2024/4/22 from cyc


You can see three files:

oled.c oled.h oledfont.h

To use it properly you need to

Physicial wiring

Screen | label_name |  PCB_Silkscreen
  GND --> GND      --> GND
  VCC --> 3.3V     --> 3V3
  DO  --> SPI_SCK  --> SCL
  D1  --> SPI_MOSI --> SDA
  RES --> OLED_RES --> RES
  DC  --> OLED_DC  --> DC
  CS  --> OLED_CS  --> CS
* label_name is configuration in cubeMX
* PCB label is designed on extern board of f407 by zq

Pin configuration

  • In cubeMX you need to configure SPI1 as below

    Mode: Transmit only Master

    Confirm the default settings:

    Hardware Nss Signal: Disable
    Data Size: 8Bits
    First Bit: MSB First
    CPOL: Low
    CPHA: 1 Edge

  • For the extern board of f407 designed by zq, pin configuration is as below

    PB0: output,  label: OLED_DC
    PB1: output,  label: OLED_RES
    NA   output,  label: OLED_CS
    

    Silkscreen of CS is suspend, so you need an extra line to GPIO and configure it as CS

Program implantation

  • Add oled.c to your project in keil (Application / User / Core), Don't forget to check ok & close

  • Move these files to your project folder and add the path in Keil (Options for Target/ C/C++/Include Paths)

  • Add below code

    /* USER CODE BEGIN Includes */
    #include "oled.h"
    /* USER CODE END Includes */
  • Add below code to main.h file hspi1 is the SPI handler, number is up to your configuration

    /* USER CODE BEGIN Private defines */
    extern SPI_HandleTypeDef hspi1; 
    /* USER CODE END Private defines */
  • Initialization

    OLED_Init();
    OLED_Clear();
    OLED_DisPlay_On();
    your function
    
    OLED_Refresh();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.