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.

msp 430 用移位寄存实现数码显示

Other Parts Discussed in Thread: MSP430G2452

help help help

我用的是lunch pad ,msp430g2452的引脚太少,想用它实现显示多位数码管

我看书上用的是74hc169实现的,只用了两个引脚,我按他的程序仿真不出来,

按理说应该显示1234567的,怎么显示的都是88888啊

仿真时我用的是249,求指教啊,怎么修改程序,怎么修改仿真电路啊?

#include<msp430x24x.h>
#define charsize  8
#define datasize  8
#define uchar  unsigned char
uchar disbuff[8]={0,1,2,3,4,5,6,7};
uchar seg[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
void dis();

void main()
{

while(1)
  {

  uchar i,j;
  uchar temp;
  P1DIR=0X07;
  P1OUT|=0X05;
  for(i=0;i<datasize;i++)
     {
     temp=0x80;
     for(j=0;j<charsize;j++)
        {
          if((seg[disbuff[i]]&temp)!=0)
            {
          P1OUT|=0X02;
          P1OUT&=0XFE;
          P1OUT|=0X01;
            }
          else
            {P1OUT&=0XFD;
            P1OUT&=0XFE;
            P1OUT|=0X01;
          for(unsigned int i=0;i<5000;i++);  }
       temp/=2;
        }
     }
P1OUT&=0XFB;
    }

}