sms

//danny
#include <STC12C5A60S2.H>

sbit S0 = P1^0;
sbit S1 = P1^1;
sbit S2 = P1^2;
sbit S3 = P1^3;

unsigned int RXnum = 0;	//数量
unsigned int TXnum = 0;	//数量
unsigned char code LedChar[] = {	//数码管显示字符转换表
    0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8,
    0x80, 0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E
};

unsigned char RxdByte; //串口接收到的字节

void UartInit(void);
//void sendData();
//void sendString();

/* 主函数 */
void main()
{
	EA = 1;		//允许出现中断
	ES = 1;		//允许串口中断
	UartInit();

	S0=S1=S2=S3=1;
	while(1){

		S3=0;
		P0 = LedChar[RXnum%10];
		S0=S1=S2=S3=1;P0=0XFF;
		S2=0;
		P0 = LedChar[RXnum/10%10];
		S0=S1=S2=S3=1;P0=0XFF;

		S1=0;
		P0 = LedChar[TXnum%10];
		S0=S1=S2=S3=1;P0=0XFF;
		S0=0;
		P0 = LedChar[TXnum/10%10];
		S0=S1=S2=S3=1;P0=0XFF;
	}
}

/* UART初始化 */
void UartInit(void)		//[email protected]
{
	PCON &= 0x7F;		//波特率不倍速
	SCON = 	0x50;		//8位数据,可变波特率
	AUXR |= 0x04;		//独立波特率发生器时钟为Fosc,即1T
	BRT = 	0xDC;		//设定独立波特率发生器重装值
	AUXR |= 0x01;		//串口1选择独立波特率发生器为波特率发生器
	AUXR |= 0x10;		//启动独立波特率发生器
}

/* UART 中断服务函数 */
void Uart_Isr() interrupt 4 using 1
{
	//接收
    if (RI){
		RI = 0;			//Clear receive interrupt flag
		RXnum++;
		RxdByte = SBUF;
		SBUF = RxdByte;
    }
	//发送
    if (TI){
        TI = 0;			//Clear transmit interrupt flag
		TXnum++;
    }
}
时间: 2024-08-13 21:40:16

sms的相关文章

SMS消息传递

<Button     android:id="@+id/send"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:text="Send SMS"     android:onClick="onClick"/> public void onClick(Vie

信息会话Thread_id异常处理(MMS草稿修改收件人,SMS新信息丢失thread数据)

1, sms收到信息,thread表没有create新数据.导致一直有一条未读信息数量显示,但在会话列表中却看不到. (偶现. 解决方法:查询未读信息时,过滤thread丢失的sms信息.先规避此Bug) 分析:Ril层接收新信息会通过Framework发通知——android.provider.Telephony.SMS_DELIVER com.android.mms.transaction.PrivilegedSmsReceiver接收广播,应用程序MMS开始处理 protected voi

Spring Boot 之注解@Component @ConfigurationProperties(prefix = &quot;sms&quot;)

从spring-boot开始,已经支持yml文件形式的配置,@ConfigurationProperties的大致作用就是通过它可以把properties或者yml配置直接转成对象 例如: 配置文件: sms.url=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX sms.appkey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX sms.secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX sms.signName=XXXXXXXXXXXXX

Java通过SMS短信平台实现发短信功能

在项目中使用过发短信的功能,但那个由于公司内部的限制很麻烦,今天在网上找到一个简单的,闲来无事就把它记录如下: 本程序是通过使用中国网建提供的SMS短信平台实现的(该平台目前为注册用户提供5条免费短信,3条免费彩信,这足够用于我们测试用了.在使用前需要注册,注册地址为http://sms.webchinese.cn/reg.shtml),下面是程序源码: /** * @Author dengsilinming * @Date 2012-9-18 * */ package com.dengsili

错误 java.lang.ClassCastException: com.ylpw.sms.YZZYSenderUtil cannot be cast to ResourceBundle

出现错误: java.lang.ClassCastException: com.ylpw.sms.YZZYSenderUtil cannot be cast to ResourceBundle 百度搜索错误,没有结果.谷歌搜索:http://stackoverflow.com/questions/5694017/specify-java-localization-file 解决方法,修改了一行代码 prop = ResourceBundle.getBundle(this.getClass().g

Content://sms

package com.example.sms; import android.app.Activity; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.ContentResolver; import android.content.ContentValues; import andr

GSM Sniffing入门之软件篇:GSMTAP抓取与SMS(Short Message Service)还原

重点介绍如何利用50元左右的设备,抓包并还原SMS短信内容: ps:研究GSM Sniffing纯属个人兴趣,能抓SMS报文只是捡了个明文传输的漏子,切勿用于非法用途.就像sylvain说的,osmocomBB并不是为抓包而实现的,如果没有足够的GSM相关知识,想实现还原语音通话内容根本就无从下手. ---------------------------------------------------------------------------------------------------

Tasker to stop Poweramp control for the headset while there is an incoming SMS - frozen

If you usually like to use Poweramp or any other media player to enjoy the music with headset plugged, once you check the option “respond to headset button”, Poweramp will take care of your headset line controller instead, and if you are in the middl

转载:SMS软件FESWMS模型使用体会

自学了SMS-FESWMS几个月,从其原理到具体应用都已经比较熟悉.感觉这个软件还是有许多不足,这也是需要进一步提高和改进的地方.下面谈谈自己的一些感受和体会. 首先,对一些比较简单的模型,软件的计算精度,特别是水流模拟的精度还是可以保证的,但前提是需要对一些关键影响参数进行合理设置,如糙率.涡粘系数(特别对于存在回流的情况)等.对于泥沙模拟,该模型仅能较好的考虑入口清水及平衡输沙(也即保证入口处不发生冲淤)的情况,另外,模型提供了多个平衡挟沙经验公式,如熟知的Meyer-Peter-Mulle

ContentProvider的自定义及SMS和CONTACTS的内容提供者

1.自定义内容提供者 首先创建extends ContentProvider的类 package com.txs.db; import android.content.ContentProvider; import android.content.ContentValues; import android.content.UriMatcher; import android.database.Cursor; import android.database.sqlite.SQLiteDatabas