⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 MC68HC单片机原理及C语言
💻 C
字号:
#include <hidef.h> /* for EnableInterrupts macro */
#include <MC68HC908SR12.h> /* include peripheral declarations */
void delay(unsigned int count)
{
	unsigned int i;
	for(i=1;i<count;i++);
}

void main(void) {
  /* include your code here */
  unsigned char temp;
  temp=0; 
  CONFIG1=0x39;
  CONFIG2=0x00;	//sci clock source:CGMXCLK=9.8MHz
 
  SCBR=0x04;//baud rate 9600 9.8M/(64*16)=9600
  SCC1=0x40;
  SCC2=0x08;
  SCC3=0x00;
  //EnableInterrupts; /* enable interrupts */
  while(1)
  {
  	delay(50000);
  	delay(50000);
  	while(SCS1_SCTE==0);
  	temp=SCS1;
  	SCDR=0x55;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -