找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 9833|回复: 6
打印 上一主题 下一主题
收起左侧

关于MBI5026恒流芯片的用法

[复制链接]
跳转到指定楼层
楼主
[img]file:///C:/Documents%20and%20Settings/Administrator/Application%20Data/Tencent/Users/1464216403/QQ/WinTemp/RichOle/[FFDS~[ZUZ)%605G6RMQ[KL$7.png[/img]
求助!有哪位大神知道MBI5026芯片怎么驱动,我想用STC11F02E单片机做个程序通过MBI5026显示99倒计时,电路图看附件

电路.jpg (331.81 KB, 下载次数: 155)

电路.jpg
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:64089 发表于 2016-3-1 09:11 | 只看该作者
程序写出来了么?先参考时序图写写贴出来大家给你参考
回复

使用道具 举报

板凳
ID:97854 发表于 2016-3-1 13:38 | 只看该作者
nsj21n 发表于 2016-3-1 09:11
程序写出来了么?先参考时序图写写贴出来大家给你参考

#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;
       }
      }
}

初学,哪里错??
回复

使用道具 举报

地板
ID:64089 发表于 2016-3-1 15:03 | 只看该作者
MBI是16位串行数据,你这样确定能把数据送出去?给你个参考发送16位数据,其它依照时序图补上:for(i=0;i<16;i++)
    {
        MBI_SDI=(dat & 0x8000)?1:0;          //串口移位的数据
        MBI_CLK=1;
        dat<<=1;
                delay(10);
        MBI_CLK=0;
        //        delay(500);
    }
回复

使用道具 举报

5#
ID:97854 发表于 2016-3-2 15:56 | 只看该作者
nsj21n 发表于 2016-3-1 15:03
MBI是16位串行数据,你这样确定能把数据送出去?给你个参考发送16位数据,其它依照时序图补上: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);
    }
}
求教,大神!!
回复

使用道具 举报

6#
ID:97854 发表于 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);
    }
}

只能显示零星的字段,不能显示完整数字,求大神告知是哪错了???数组编码应该不会错,对了好几遍了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表