新闻中心

EEPW首页>嵌入式系统>设计应用> 用EM78P153S给同事写流水灯

用EM78P153S给同事写流水灯

作者: 时间:2016-11-29 来源:网络 收藏
基于EM78P153S流水灯
#include"EM78x153xx.h"#define DISI() _asm{disi}#define ENI() _asm{eni}#define SLEP() _asm{slep}#define NOP() _asm{nop}#define WDTC() _asm{wdtc}typedef unsigned char uchar;typedef unsigned int uint;typedef unsigned short ushort;#defineledl PORT5#define ledh PORT6void delay(void){uchar i,j;for(j=0;j<200;j++)for(i=0;i<200;i++)NOP();}const ushort rundata[16]={0xfffe,0xfffc,0xfff8,0xfff0,0xffe0,0xffc0,0xff80,0xff00,0xfe00,0xfc00,0xf800,0xf000,0xe000,0xc000,0x8000,0x0000};void main(void){uchar i,j,k;uint run;WDTC();//清看门狗DISI();//禁止中断STATUS=0X00;//清除状态标志位P5CR=0x00;//置P5为输出口P6CR=0x00;//置P6为输出口PDCR=0x00;//禁止P5,P6下拉ODCR=0x00;//禁止P6开漏PHCR=0x00;//禁止P6上拉for(;;)for(i=0,k=0;i<16;i++,k--){run=rundata[i];for(j=0;j
        
         >8);delay();}}}void _intcall
         interrupt(void) @ int {// Write your code (inline assembly or C) here//restore ACC,R3,R4_asm{
         reti//tell Compiler to recover common registers hereSWAP 0X1F ;restore ASWAPA 0X1F}}void _intcall interrupt_l(void) @ 0x08:low_int 0{_asm {//save A --> 0x1F MOV 0X1F,A ;backup A to 0x1F} }
        


关键词:EM78P153S流水

评论


技术专区

关闭