368 views|2 replies

1452

Posts

1

Resources
The OP
 

[Yichuang ET6001 Review] Serial digital tube display driver [Copy link]

 

I originally planned to use the GPIO port to implement an I2C interface OLED screen display, but after several unsuccessful debugging attempts, I had to give up this option.

Therefore, the serial digital tube display module was selected as a breakthrough, and its display effect was good after testing.

The display module uses MAX7219 as the main control chip, can display 8-bit values, and supports cascading. In addition to the power supply, it only needs 3 GPIO ports, so it saves pin resources.

Figure 1 Serial digital tube display module

The connection relationship between the display module and the development board is:

SCL---GPIO2_2

SDA---GPIO2_3

CS---GPIO2_4

In order to provide high and low level outputs to the serial digital tube display module, the defined statements are:

#define CLK_SetLow GPIO_WritePin(GPIO2, GPIO_PIN_02, RESET)

#define CLK_SetHigh GPIO_WritePin(GPIO2, GPIO_PIN_02, SET)

#define DIN_SetLow GPIO_WritePin(GPIO2, GPIO_PIN_03, RESET)

#define DIN_SetHigh GPIO_WritePin(GPIO2, GPIO_PIN_03, SET)

#define CS_SetLow GPIO_WritePin(GPIO2, GPIO_PIN_04, RESET)

#define CS_SetHigh GPIO_WritePin(GPIO2, GPIO_PIN_04, SET)

Since the key chip used in the serial digital tube display module is MAX7219, a function for serially sending byte data is configured for it, and its content is:

static void Write_Max7219_byte(char DATA)
{
  char i;
  CS_SetLow;
  delay(10);
  for(i=8;i>=1;i--)
  {
      CLK_SetLow;
      if(DATA&0x80)
         DIN_SetHigh;
      else
         DIN_SetLow;
      delay(10);
      DATA=(char)(DATA<<1);
      CLK_SetHigh;
      delay(10);
  }
}

Based on the function Write_Max7219_byte(), the function that sends data to the specified address is:

static void Write_Max7219(char address,char dat)
{
  CS_SetLow;
  Write_Max7219_byte(address);
  Write_Max7219_byte(dat);
  CS_SetHigh;
}

For the serial digital tube display module, its initialization function is:

static void Init_MAX7219(void)
{
   Write_Max7219(0x09, 0xff);
   Write_Max7219(0x0a, 0x02);
   Write_Max7219(0x0b, 0x07);
   Write_Max7219(0x0c, 0x01);
   Write_Max7219(0x0f, 0x00);
}

To test the serial digital tube display module, the corresponding main program is:

int main(void)
{
    EVB_LEDInit();
    Init_MAX7219();
    Write_Max7219(1,1);
    Write_Max7219(2,2);
    Write_Max7219(3,3);
    Write_Max7219(4,4);
    Write_Max7219(5,5);
    Write_Max7219(6,6);
    Write_Max7219(7,7);
    Write_Max7219(8,8);
    while (1)
    {
        GPIO_TogglePin(GPIO_LED_PORT, GPIO_LED_PIN);
        __Delay(0x5FFFFF);
}
}

After the program is compiled and run, the effect is shown in Figure 2.

Figure 2 Display effect diagram

In this way, the display driver of the serial digital tube module is realized, and it can be used to complete the numerical display later.

This post is from Domestic Chip Exchange

Latest reply

What about the analog IIC interface? Different hardware chips have different problems   Details Published on 2024-10-27 12:25
 
 

5998

Posts

6

Resources
2
 

What about the analog IIC interface? Different hardware chips have different problems

This post is from Domestic Chip Exchange

Comments

Simulated, so it is more convenient to transplant and use.  Details Published on 2024-10-27 12:51
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 
 
 

1452

Posts

1

Resources
3
 
Qintianqintian0303 posted on 2024-10-27 12:25 How about simulating IIC interface? Different hardware chips have different problems

Simulated, so it is more convenient to transplant and use.

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list