This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432P401R外接MAX7219点阵屏模块

MSP432P401R外接MAX7219点阵屏模块点阵屏数据异常,希望可以找一下哪里可能存在问题,是配置存在问题还是硬件电路设计有问题,数字无法正确显示。

谢谢!点阵屏.zip

  • 楼主你好,你的点阵屏是共阳极还是共阴极?

    做电子设计,需要电路和程序匹配才可以正常驱动的

  • 看视频,基本的驱动没有问题,感觉你是取编码的过程中出现了计算错误,导致有的显示不全。
  • #include <reg52.h>
    #include <intrins.h>
    #define uchar unsigned char
    #define uint  unsigned int
    //����Max7219�˿�
    sbit Max7219_pinCLK = P2^2;
    sbit Max7219_pinCS  = P2^1;
    sbit Max7219_pinDIN = P2^0;
    uchar code disp1[38][8]={
    {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},//0
    {0x10,0x18,0x14,0x10,0x10,0x10,0x10,0x10},//1
    {0x7E,0x2,0x2,0x7E,0x40,0x40,0x40,0x7E},//2
    {0x3E,0x2,0x2,0x3E,0x2,0x2,0x3E,0x0},//3
    {0x8,0x18,0x28,0x48,0xFE,0x8,0x8,0x8},//4
    {0x3C,0x20,0x20,0x3C,0x4,0x4,0x3C,0x0},//5
    {0x3C,0x20,0x20,0x3C,0x24,0x24,0x3C,0x0},//6
    {0x3E,0x22,0x4,0x8,0x8,0x8,0x8,0x8},//7
    {0x0,0x3E,0x22,0x22,0x3E,0x22,0x22,0x3E},//8
    {0x3E,0x22,0x22,0x3E,0x2,0x2,0x2,0x3E},//9
    {0x8,0x14,0x22,0x3E,0x22,0x22,0x22,0x22},//A
    {0x3C,0x22,0x22,0x3E,0x22,0x22,0x3C,0x0},//B
    {0x3C,0x40,0x40,0x40,0x40,0x40,0x3C,0x0},//C
    {0x7C,0x42,0x42,0x42,0x42,0x42,0x7C,0x0},//D
    {0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x7C},//E
    {0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x40},//F
    {0x3C,0x40,0x40,0x40,0x40,0x44,0x44,0x3C},//G
    {0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44},//H
    {0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x7C},//I
    {0x3C,0x8,0x8,0x8,0x8,0x8,0x48,0x30},//J
    {0x0,0x24,0x28,0x30,0x20,0x30,0x28,0x24},//K
    {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C},//L
    {0x81,0xC3,0xA5,0x99,0x81,0x81,0x81,0x81},//M
    {0x0,0x42,0x62,0x52,0x4A,0x46,0x42,0x0},//N
    {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},//O
    {0x3C,0x22,0x22,0x22,0x3C,0x20,0x20,0x20},//P
    {0x1C,0x22,0x22,0x22,0x22,0x26,0x22,0x1D},//Q
    {0x3C,0x22,0x22,0x22,0x3C,0x24,0x22,0x21},//R
    {0x0,0x1E,0x20,0x20,0x3E,0x2,0x2,0x3C},//S
    {0x0,0x3E,0x8,0x8,0x8,0x8,0x8,0x8},//T
    {0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x1C},//U
    {0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18},//V
    {0x0,0x49,0x49,0x49,0x49,0x2A,0x1C,0x0},//W
    {0x0,0x41,0x22,0x14,0x8,0x14,0x22,0x41},//X
    {0x41,0x22,0x14,0x8,0x8,0x8,0x8,0x8},//Y
    {0x0,0x7F,0x2,0x4,0x8,0x10,0x20,0x7F},//Z
    {0x8,0x7F,0x49,0x49,0x7F,0x8,0x8,0x8},//��
    {0xFE,0xBA,0x92,0xBA,0x92,0x9A,0xBA,0xFE},//��
    };
    void Delay_xms(uint x)
    {
     uint i,j;
     for(i=0;i<x;i++)
      for(j=0;j<112;j++);
    }
    //--------------------------------------------
    //���ܣ���MAX7219(U3)д���ֽ�
    //��ڲ�����DATA 
    //���ڲ�������
    //˵����
    void Write_Max7219_byte(uchar DATA)         
    {
        	uchar i;    
    		Max7219_pinCS=0;		
    	    for(i=8;i>=1;i--)
              {		  
                Max7219_pinCLK=0;
                Max7219_pinDIN=DATA&0x80;
                DATA=DATA<<1;
                Max7219_pinCLK=1;
               }                                 
    }
    //-------------------------------------------
    //���ܣ���MAX7219д������
    //��ڲ�����address��dat
    //���ڲ�������
    //˵����
    void Write_Max7219(uchar address,uchar dat)
    { 
         Max7219_pinCS=0;
    	 Write_Max7219_byte(address);           //д���ַ��������ܱ��
         Write_Max7219_byte(dat);               //д�����ݣ����������ʾ���� 
    	 Max7219_pinCS=1;                        
    }
    
    void Init_MAX7219(void)
    {
     Write_Max7219(0x09, 0x00);       //���뷽ʽ��BCD��
     Write_Max7219(0x0a, 0x03);       //���� 
     Write_Max7219(0x0b, 0x07);       //ɨ����ޣ�8���������ʾ
     Write_Max7219(0x0c, 0x01);       //���ģʽ��0����ͨģʽ��1
     Write_Max7219(0x0f, 0x00);       //��ʾ���ԣ�1�����Խ�����������ʾ��0
    }
    void main(void)
    {
     uchar i,j;
     Delay_xms(50);
     Init_MAX7219();  
     while(1)
     {
      for(j=0;j<38;j++)
      {
       for(i=1;i<9;i++)
        Write_Max7219(i,disp1[j][i-1]);
       Delay_xms(1000);
      }  
     } 
    }
    
    不知道是哪里的问题,程序数据的发送形式是否有问题,原码是位操作,我这个是一次传输8位数据。发给你们51的源码

  • 不知为何,您附件内的doc文档我打不开

    您是否有参考

    e2e.ti.com/.../562579

    给出的代码

    建议您通过示波器抓取MSP432的SPI波形进行分析看是否正常