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

📄 sci.c

📁 contain many examples code for I2c,UART,string ,digital convert, read/write to EEprom in microchip P
💻 C
字号:
//#include <pic.h>
#include "sci.h"

/* Routines for initialisation and use of the SCI
 * for the PIC processor.
 */

/* other options:
 * frame errors
 */
#if 0
void
sci_Init(void)
{
	
	BRGH = 1;	/* high baud rate */
	SPBRG = 51;	/* set the baud rate */
	RCSTA=0x90;
	//RCSTA=0x80;
	TXSTA =0x24;
	//SYNC=1;
	
}
#endif

void
sci_PutByte(unsigned char byte)
{
	while(!TXIF)	/* set when register is empty */
		continue;
	TXREG = byte;
 	asm("clrwdt");
	return;
}


void putst(register const char *str)
{
	while((*str)!=0)	{
		sci_PutByte(*str);
	    	if (*str==13) sci_PutByte(10); 
    		if (*str==10) sci_PutByte(13);
		str++;		
	}
}



⌨️ 快捷键说明

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