Play with LED dot matrix 1: 16X64 single red dot matrix static display

Publisher:大头玩家Latest update time:2015-07-02 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
//MCU: STC89C52

//Crystal: 22.1184M
//Display: HUB08 interface 16X64 single red dot matrix
//Display mode: static 16X16 Chinese characters
//Author: huqin
//QQ: 1766135164
//Website: http://www.51hei.com
//Time: 2013-05-13
#include
#include"zimo.h"
sbit SDAR1=P0^4; //Red data 1
sbit SDAR2=P3^3; //Red data 2
sbit SDAG1=P3^4; //Green data 1
sbit SDAG2=P3^5; //Green data 2
sbit CLK=P0^7;    //74HC595 clock
sbit STB=P0^6;    //Output latch
sbit OE=P0^5;     //74HC138 enable

 //74HC595串行数据输入
void SendDate(unsigned char DataR1,unsigned char DataG1,unsigned char DataR2,unsigned char DataG2)
{
 unsigned char i;
 for(i = 0; i < 8; i++)
 {
  SDAR1=DataR1 & 0x01;
  SDAG1=DataG1 & 0x01;
  SDAR2=DataR2 & 0x01;
  SDAG2=DataG2 & 0x01;
  CLK = 0;
  CLK = 1;
  DataR1 >>= 1;
  DataG1 >>= 1;
  DataR2 >>= 1;
  DataG2 >>= 1;
 }
}

//Main function entry
void main()
{
 unsigned int num;
 SDAR1=0;
 SDAR2=0;
 SDAG1=0;
 SDAG2=0;

 while(1)
 
  for(num=0;num<16;num++)
  {
   SendDate(~Table[num*2+0],~0X00,~0x00,~0X00);
   SendDate(~Table[num*2+1],~0X00,~0x00,~0X00);
   SendDate(~Table[num*2+0+32],~0X00,~0x00,~0X00);
   SendDate(~Table[num*2+1+32],~0X00,~0x00,~0X00);
   
   SendDate(~Table[num*2+0+64],~0X00,~0x00,~0X00);
   SendDate(~Table[num*2+1+64],~0X00,~0x00,~0X00);
   SendDate(~Table[num*2+0+96],~0X00,~0x00,~0X00);
   SendDate(~Table[num*2+1+96],~0X00,~0x00,~0X00);
   OE=1;    
   STB=1;     //输出锁存
   STB=0;
   P0=num;    //16位行选
   OE=0;
  }
 }

zimo.h

unsigned char code Table[]={ //Modulo Songti
0x08,0x00,
0xC8,0x7F,
0x48,0x00,
0x7F,0x00,
0x48,0x3F,
0x68,0x00,
0xD8,0x7F,
0x48,0x03,
0x4C,0x25,
0x4B,0x65,
0x48,0x19,
0x48,0x11,
0x28,0x11,
0x28,0x65,
0x1A,0x23,
0x04,0x01,

0xFC,0x1F,
0x00,0x0C,
0x60,0x03,
0x80,0x00,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0x84,0x10,
0x84,0x14,
0x04,0x08,

0x80,0x00,
0x80,0x00,
0x80,0x00,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0x84,0x10,
0xFC,0x1F,
0x84,0x10,
0x80,0x40,
0x80,0x40,
0x00,0x7F,
0x00,0x00,

0x00,0x00,
0xFC,0x0F,
0x00,0x04,
0x00,0x02,
0x00,0x01,
0x80,0x00,
0x80,0x00,
0x80,0x20,
0xFF,0x7F,
0x80,0x00,
0x80,0x00,
0x80,0x00,
0x80,0x00,
0x80,0x00,
0xA0,0x00,
0x40,0x00,
};

 

actual effect:

Reference address:Play with LED dot matrix 1: 16X64 single red dot matrix static display

Previous article:8-bit common cathode digital tube dynamic driver
Next article:51 MCU + 315M wireless RF module receiving program

Recommended ReadingLatest update time:2024-11-15 16:01

Realizing 8*8 LED heartbeat effect based on STC89c52 microcontroller
#include "reg51.h" //This file defines some special function registers of the microcontroller #include "intrins.h" typedef unsigned int u16; //declare and define the data type typedef unsigned char u8; sbit SRCLK=P3^6; //Use hc595 chip sbit RCLK=P3^5; //Use hc595 chip sbit SER=P3^4; //Use hc595 chip u8 leddua
[Microcontroller]
51 MCU STC89C52 lights up an LED (IO port bit operation)
Program source code /*-----------------------Include header file area-------------------------*/ #include reg52.h   //MCU header file  /*-----------------------Port/Pin Definition Area----------------------*/ sbit LED=P2^0;  //bit definition P2.0 pin name is LED /*-----------------------Main function area---------
[Microcontroller]
51 MCU STC89C52 lights up an LED (IO port bit operation)
[51 microcontroller STC89C52] IO port simulates PWM control of SG90 servo
1. PWM PWM, the English name is Pulse Width Modulation, is the abbreviation of pulse width modulation. It modulates the width of a series of pulses to equivalently produce the required waveform (including shape and amplitude), and digitally encodes the analog signal level. That is to say, the changes in signals, ener
[Microcontroller]
[51 microcontroller STC89C52] IO port simulates PWM control of SG90 servo
Design of temperature acquisition system based on STC89C52 microcontroller and DS18B20 temperature sensor
With the rapid development of modern information technology, data collection technology is also constantly developing and plays an important role in information technology. Whether data is collected timely and accurately and how the data is collected have become the focus of attention. With the continuous development
[Microcontroller]
Design of temperature acquisition system based on STC89C52 microcontroller and DS18B20 temperature sensor
A matrix keyboard program under the stc89c52 microcontroller
    The following is a matrix keyboard program for the stc89c52 microcontroller. The keyboard is connected to port P0 and displayed on port P2.      #include reg52.h  #define uchar unsigned char  #define uint unsigned int  sbit key1=P3^2;  sbit key2=P3^3; uchar code tab ={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,
[Microcontroller]
STC89C52 microcontroller matrix keyboard
Matrix keyboard identification method The matrix keyboard consists of 4 rows and 4 columns with a total of 16 keys. Column scanning and row scanning can be used to determine which key on the matrix keyboard is pressed. When scanning a column, first pull all IO ports connected to the column high, and set all IO ports
[Microcontroller]
STC89C52 microcontroller matrix keyboard
Frequency and duty cycle adjustable program based on STC89C52RC microcontroller
Note: The microcontroller must be 52rc and cannot be 60s2 */ #include "main.h" #include "peizhi.h" #include "smg.h" #include "eeprom.h" sfr WDT_CONTR=0XE1; unsigned char HighRH = 0; //high byte of high level reload value unsigned char HighRL = 0; //low byte of high level reload value unsigned char LowRH = 0; //hi
[Microcontroller]
UART serial communication design of STC89C52 microcontroller
For microcontrollers, communication is closely integrated with technologies such as sensors, memory chips, and peripheral control chips, becoming the "nerve center" of the entire microcontroller system. 1. Initial understanding It is sent out one by one, and it takes 8 times to send one byte. STC89C52 has two pins
[Microcontroller]
UART serial communication design of STC89C52 microcontroller
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号