MSP430单片机综合实例(proteus)

/*转自本人新浪博中的记录,时间:2010-09-26 16:28:06

最近学了一段时间的msp430单片机,感觉这款低功耗的单片机很有意思,虽然还没有彻底弄明白它的具体操作,但是一些简单的程序已经能够实现了,下面是我写的一个MSP430比较综合一点的程序,和大家分享一下;

MSP430单片机综合实验

主程序:

#include<msp430x24x.h>
#include"liushui.h"
#include"juzhen.h"
#define uchar unsigned char
#define uint  unsigned int
#define rs_0  P6OUT&=~BIT4;
#define rs_1  P6OUT|=BIT4;
#define rw_0  P6OUT&=~BIT5;
#define rw_1  P6OUT|=BIT5;
#define e_0   P6OUT&=~BIT6
#define e_1   P6OUT|=BIT6;
#define wei1_0 P6OUT&=~BIT0;
#define wei1_1 P6OUT|=BIT0;
#define wei2_1 P6OUT|=BIT1;
#define wei3_0 P6OUT&=~BIT2;
#define wei3_1 P6OUT|=BIT2;
#define wei4_0 P6OUT&=~BIT3;
#define wei4_1 P6OUT|=BIT3;
uint j,t,count1,count2,count3,count4=99;
uchar temp1,temp2;
const uchar table1[]={" shizhong dabao "};
const uchar table2[]="0123456789";
const uchar table3[]="   15:45:00  ";
void delay2(uint x)
{
 uint y;
 while(x--)
  for(y=120;y>0;y--);
}
void w_com(uchar com)
{
    rs_0;
    P2OUT=com;
    delay2(1);
    e_1;
    e_0;
}
void w_dat(uchar dat)
{
    rs_1;
    P2OUT=dat;
    d

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值