找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 10884|回復(fù): 6
打印 上一主題 下一主題
收起左側(cè)

關(guān)于MBI5026恒流芯片的用法

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:97854 發(fā)表于 2016-2-29 18:01 | 只看該作者 |只看大圖 回帖獎勵(lì) |倒序?yàn)g覽 |閱讀模式
[img]file:///C:/Documents%20and%20Settings/Administrator/Application%20Data/Tencent/Users/1464216403/QQ/WinTemp/RichOle/[FFDS~[ZUZ)%605G6RMQ[KL$7.png[/img]
求助!有哪位大神知道MBI5026芯片怎么驅(qū)動,我想用STC11F02E單片機(jī)做個(gè)程序通過MBI5026顯示99倒計(jì)時(shí),電路圖看附件

電路.jpg (331.81 KB, 下載次數(shù): 180)

電路.jpg
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

沙發(fā)
ID:64089 發(fā)表于 2016-3-1 09:11 | 只看該作者
程序?qū)懗鰜砹嗣?先參考時(shí)序圖寫寫貼出來大家給你參考
回復(fù)

使用道具 舉報(bào)

板凳
ID:97854 發(fā)表于 2016-3-1 13:38 | 只看該作者
nsj21n 發(fā)表于 2016-3-1 09:11
程序?qū)懗鰜砹嗣?先參考時(shí)序圖寫寫貼出來大家給你參考

#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit MBI_SDI=P3^4;
sbit MBI_CLK=P3^5;
sbit MBI_LE=P3^7;
uchar num;

//顯示段碼表
uchar code Tab[]=
{
0xdfc0,        //  0
0x03c0,        //  1
0xc620,        //  2
0x86a0,        //  3
0x12a0,        //  4
0x94a0,        //  5
0xd4a0,        //  6
0x0680,        //  7
0xd6a0,        //  8
0x96a0,        //  9
};


void delayms(uint xms)
{
   uint i,j;
        for(i=xms;i>0;i--)
          for(j=100;j>0;j--);
}


void main()
{
    MBI_CLK = 0;
    MBI_SDI = 0;
    while(1)
   {
     for(num=9;num>0;num--)
      {
       MBI_SDI=Tab[num];
       MBI_CLK=1;
       MBI_CLK=0;
       MBI_LE=1;
       delayms(1000);
       MBI_LE=0;
       }
      }
}

初學(xué),哪里錯(cuò)??
回復(fù)

使用道具 舉報(bào)

地板
ID:64089 發(fā)表于 2016-3-1 15:03 | 只看該作者
MBI是16位串行數(shù)據(jù),你這樣確定能把數(shù)據(jù)送出去?給你個(gè)參考發(fā)送16位數(shù)據(jù),其它依照時(shí)序圖補(bǔ)上:for(i=0;i<16;i++)
    {
        MBI_SDI=(dat & 0x8000)?1:0;          //串口移位的數(shù)據(jù)
        MBI_CLK=1;
        dat<<=1;
                delay(10);
        MBI_CLK=0;
        //        delay(500);
    }
回復(fù)

使用道具 舉報(bào)

5#
ID:97854 發(fā)表于 2016-3-2 15:56 | 只看該作者
nsj21n 發(fā)表于 2016-3-1 15:03
MBI是16位串行數(shù)據(jù),你這樣確定能把數(shù)據(jù)送出去?給你個(gè)參考發(fā)送16位數(shù)據(jù),其它依照時(shí)序圖補(bǔ)上:for(i=0;i

#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit MBI_SDIG=P3^4;
sbit MBI_SDIR=P3^2;
sbit MBI_CLK=P3^5;
sbit MBI_LE=P3^7;


//顯示段碼表
uchar code Tab[]=
{
0xdfc0,        //  0
0x03c0,        //  1
0xc620,        //  2
0x86a0,        //  3
0x12a0,        //  4
0x94a0,        //  5
0xd4a0,        //  6
0x0680,        //  7
0xd6a0,        //  8
0x96a0,        //  9
};


void delay(uint xms)
{
   uint i,j;
        for(i=xms;i>0;i--)
          for(j=100;j>0;j--);
}

   
void mbi5026(uchar dat)
{
    uchar k;
   for(k=0;k<16;k++)
    {
       MBI_SDIR=(dat &0x8000)?1:0;
       MBI_CLK=1;
       dat<<=1;
       MBI_CLK=0;
    }
    MBI_LE = 1;
    delay(100);
    MBI_LE = 0;
}
void main()
{
    uchar q;
    MBI_CLK=0;
    MBI_SDIR=0;
    MBI_SDIG=0;
         for(q=0;q<10;q++)
    {
       mbi5026(Tab[q]);
       delay(1000);
    }
}
求教,大神!
回復(fù)

使用道具 舉報(bào)

6#
ID:97854 發(fā)表于 2016-3-7 09:53 | 只看該作者
本帖最后由 liu_qing532 于 2016-3-12 15:55 編輯

終于可以顯示:
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit MBI_SDIG=P3^4;
sbit MBI_SDIR=P3^2;
sbit MBI_CLK=P3^5;
sbit MBI_LE=P3^7;


uint code Tab[]=
{
0xd680, //  0
0x5000, //  1
0xc620, //  2
0xd420, //  3
0x50a0, //  4
0x94a0, //  5
0x96a0, //  6
0xd000, //  7
0xd6a0, //  8
0xd4a0 //  9
};

void delay(uint xms)
{
   uint i,j;
        for(i=xms;i>0;i--)
          for(j=100;j>0;j--);
}

   
void mbi5026(uint dat)
{
    uint k;
   for(k=0;k<16;k++)
    {
       MBI_SDIR=(dat &0x8000)?1:0;
       MBI_CLK=1;
       dat<<=1;
       MBI_CLK=0;
    }
    MBI_LE = 1;
    delay(1000);
    MBI_LE = 0;
}
void main()
{
    uchar q;
    MBI_CLK=0;
    MBI_SDIR=0;
    MBI_SDIG=0;
         for(q=0;q<10;q++)
    {
       mbi5026(Tab[q]);
       delay(1000);
    }
}

只能顯示零星的字段,不能顯示完整數(shù)字,求大神告知是哪錯(cuò)了???數(shù)組編碼應(yīng)該不會錯(cuò),對了好幾遍了。
回復(fù)

使用道具 舉報(bào)

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表