FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Single-chip programming and driver OLED12864 display test

     

    This time you have to test the drive OLED12864 display. The OLED12864 module uses IIC interface, SDA picks RF4 pin, SCL picks RF5 pin, power supply is 3.3V. IIC timing use software simulation, using forced read and write mode. 1.iic.h file #ifndef __iic_h #define __IIC_H #include #include "system_config.h" #define IIC_SCL (Status) if (status) PLIB_PORTS_PINSET (port_id_0, port_channel_f, ports_bit_pos_5); Else PLIB_PORTS_PINCLEAR (Ports_ID_0, Port_Channel_f, Ports_bit_pos_5) #define IIC_SDA_OUT (STATUS) IF (status) PLIB_PORTS_PINSET (port_id_0, port_channel_f, ports_bit_pos_4); Else PLIB_PORTS_PINCLEAR (Ports_ID_0, Port_Channel_f, Ports_bit_pos_4) #define delay_us ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP"); ASM ("NOP") Void IIC_INIT (VOID); Void IIC_Start (Void); Void Iic_stop (void); Void Iic_send_byte (uint8_t data); Void delayms (uint32_t msdelay); Void delayus (uint32_t usdelay); 2.iic.c file #include "Iic.h" Void IIC_Start (Void) // Generate start timing { IIC_SCL (0); Delayus (2); IIC_SDA_OUT (1); Delayus (2); IIC_SCL (1); Delayus (2); IIC_SDA_OUT (0); Delayus (2); IIC_SCL (0); Delayus (2); } Void IIC_STOP (Void) // Generate stop timing { IIC_SCL (0); Delayus (2); IIC_SDA_OUT (0); Delayus (2); IIC_SCL (1); Delayus (2); IIC_SDA_OUT (1); Delayus (2); } 3. OLED.C: OLED initialization and driver VOID OLED_WRITE_CMD (uint8_t oled_cmd) // Write Command Function { IIC_Start (); IIC_send_byte (0x78); // Module Address IIC_SCL (0); Delayus (2); IIC_SCL (1); Delayus (2); IIC_SCL (0); DELAYUS (2); // Skip the answering IIC_send_byte (0x00); // Write command IIC_SCL (0); Delayus (2); IIC_SCL (1); Delayus (2); IIC_SCL (0); DELAYUS (2); // Skip the answering IIC_send_byte (OLED_CMD); // Command Value IIC_STOP (); } 4.app.c: Display "1234". #include "app.h" #include "oled.h" #include "Iic.h" #include "bsp.h" App_data appdata; Void app_initialize (void) { AppData.State = app_state_init; } Void app_tasks (void) { Switch (appdata.state) { Case app_state_init: { Delayms (100); OLED_INIT (); OLED_CLEAR (); Appdata.State = App_State_Service_Tasks; Break; } Case app_State_Service_Tasks: { OLED_SHOW_CHAR0816 ((16 + 1), 0, 0); // "1" OLED_SHOW_CHAR0816 ((16 + 2), 0, 8); // "2" OLED_SHOW_CHAR0816 ((16 + 3), 0, 16); // "3" OLED_SHOW_CHAR0816 ((16 + 4), 0,24); // "4" DELAYMS (1000); Break; } } } 5. Show the effect, read the full story

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us