亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sci.txt

?? pic16F877A的串口功能C語言軟件
?? TXT
字號:
The sci functions and macros to implement asynchronous
communication on the Serial Communication Interface (SCI)
module.

CONTENTS
########

1 Setting Up
2 Asynchronous Function Definitions
3 Examples
4 Using Interrupts


1) Setting Up
#############

The file sci.h should be #included into your source
files. This file contains a macro which specifies
the Fosc frequency. This affects the baud rate
calculations and should be adjusted to suit your
application.


2) Asynchronous Function and Macro Definitions
##############################################

unsigned char
sci_Init(unsigned long int baud, unsigned char ninebits)
~~~~~~~~

This function is used to set up the appropriate registers
associated with the sci module. Specify the desired
baud rate. If this is possible using the current
value of Fosc, the value specified will be used - see
the PIC manual for details on baud rate selection.
If ninebits is true, 9-bit data values will be used for
both transmission and reception. The function returns
true if the desired baud rate could not be achieved;
false otherwise.

SCI_EIGHT and SCI_NINE
~~~~~~~~~     ~~~~~~~~~

These macros can beused with sci_Init() to indicate
eight- and nine-bit communication, respectively.

void
sci_PutByte(unsigned char byte)
~~~~~~~~~~~

This function is used to send an 8-bit quantity to
the SCI. The function first waits until TXIF is
set then loads the transmit register.

sci_PutNinth(bitnine)
~~~~~~~~~~~~

This macro is used to send the ninth bit to
the SCI when in nine-bit data mode. It should be
called before calling sci_PutByte().

unsigned char
sci_GetByte(void)
~~~~~~~~~~~

This function waits until the receive register is not
empty and returns the received 8-bit data.

unsigned char
sci_GetNinth(void)
~~~~~~~~~~~~

This function waits until the receive register is not
empty and returns the received ninth-bit when in nine-
bit mode. It should be called before calling
sci_GetByte()as the ninth bit is lost after calling
this function.

unsigned char
sci_GetFERR(void)
~~~~~~~~~~~

This function waits until the receive register is not
empty and returns the received frame error status bit.
It should be called before calling sci_GetByte() as
frame error information is lost after calling this
function.

unsigned char
sci_CheckOERR(void)
~~~~~~~~~~~~~

This function checks for an overrun error and resets the
receiver, by toggling the CREN bit, and returns true if
this has occured. The function returns false if no error
occured. If an overrun error occurs, the receiver is
completely disabled.


3) Examples
###########

// 8-bit mode at 9600 baud using polling

sci_Init(9600,SCI_EIGHT);
sci_PutByte(0xaa);	/* send 0xaa when device is ready */
data = sci_GetByte();	/* read data when device is ready */

// 9-bit mode at 19200 baud using polling

sci_Init(19200,SCI_NINE);
sci_PutNinth(0x00);	/* ninth bit is zero */
sci_PutByte(0xff);	/* and data is 0xff */

if(sci_getNinth())
	; /* bit nine was true */
data = sci_GetByte();	/* get 8-bit value */
if(sci_CheckOERR())
	; /* an overrun error occured */


4) Using Interrupts
###################

To use interrupts with the SCI, there are several things
which must be attended to.

Firstly there must be an interrupt service routine which
can process the interrupts when they occur. There can be
only one interrupt routine associated with the PIC
processor and so this routine must be able to service
any interrupt which occurs, not just those associated
with the SCI. The following example shows an ISR which
handles reception and transmission. The RCIF, TXIF,
RCIE and TXIE bits can be used to ascertain what caused
the interrupt. In the example, if the receive register
is full (RCIF), a character is read from the SCI and
echoed back to the source. If the transmitter is
empty and the transmitter interrupts are enabled then
another byte from a message is transmitted. If all
the message has been sent, the interrupts are disabled
to prevent further transmission. If any other interrupts
are enabled, the code to handle these will also have to
appear in this ISR.

unsigned char byte, i;

void interrupt isr(void)
{
	if(RCIF)
	{
		byte = sci_GetByte();
		sci_PutByte(byte);	/* echo char */
	}
	if(TXIF && TXIE)
	{
		sci_PutByte(message[i]);
		if(message[++i] == '\0')
			TXIE = 0;	/* finished */
	}
}

The interrupts can be enabled by setting the appropriate
bits in the INTCON register. To use the SCI, enable the
PEIE bit. If other interrupts are to be used, set the
bits corresponding to these interrupts in this register.
The global interrupt enable bit must also be set. The
TXIE and RCIE bits can then be used to mask and unmask
the interrupts at various points in your code.

sci_Init(9600, SCI_EIGHT);

PIR1 = 0;	/* clear any pending interrupts */
PEIE = 1;	/* enable perhipheral interrupts */
GIE  = 1;	/* global interrupts enabled */

/* perform other setup */

RCIE = 1;	/* unmask receiver interrupts... */

/* an interrupt could now come from the SCI receiver
at any time. */

/* process data read in, if any */

RCIE = 0;	/* mask receive interrupts */

/* no more interrupts can come from the receiver */

See the PIC appropriate manual for further details
on the use of PIC interrupts.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲香肠在线观看| 精品久久久久av影院| 欧美日韩一区二区三区视频| 欧美日韩国产一级| 精品国精品自拍自在线| 亚洲国产电影在线观看| 亚洲午夜激情av| 久久精品国产亚洲aⅴ| 成人高清免费观看| 欧美日本在线一区| 欧美激情在线一区二区| 亚洲黄色小视频| 日韩avvvv在线播放| 国产美女精品在线| 91麻豆.com| 日韩欧美高清在线| 日韩一区有码在线| 久久丁香综合五月国产三级网站| 成人综合在线视频| 欧美久久久久久久久| 欧美国产在线观看| 亚洲mv在线观看| 国产99久久久国产精品| 欧美另类变人与禽xxxxx| 国产色产综合色产在线视频| 亚洲一区二区三区激情| 国产精品1区2区| 欧美性大战久久久| 国产精品美女久久久久av爽李琼| 亚洲成人777| 波多野洁衣一区| 日韩一卡二卡三卡国产欧美| 日韩毛片高清在线播放| 激情五月激情综合网| 日本精品一级二级| 国产欧美精品一区二区色综合| 亚洲高清在线视频| thepron国产精品| 精品国一区二区三区| 无码av免费一区二区三区试看 | 国产福利不卡视频| 欧美日韩中文另类| 一区在线播放视频| 国产馆精品极品| 日韩精品综合一本久道在线视频| 亚洲免费观看视频| 丰满少妇在线播放bd日韩电影| 欧美一卡2卡3卡4卡| 亚洲自拍偷拍九九九| 成人精品小蝌蚪| 久久天堂av综合合色蜜桃网| 午夜av一区二区| 色综合久久中文综合久久牛| 国产欧美中文在线| 国内精品在线播放| 欧美一级片在线| 日韩制服丝袜先锋影音| 在线观看日韩国产| 亚洲婷婷综合色高清在线| 国产福利一区二区三区视频在线 | 亚洲一区二区三区在线看| 成人性生交大片免费看中文| 精品免费国产一区二区三区四区| 婷婷成人激情在线网| 欧美日韩在线播放一区| 亚洲一二三区在线观看| 色老头久久综合| 亚洲欧洲三级电影| av福利精品导航| 亚洲欧洲韩国日本视频| 成+人+亚洲+综合天堂| 国产三级久久久| 国产成人免费在线视频| 国产欧美一区二区三区网站| 国产真实乱偷精品视频免| 亚洲精品一区二区三区精华液| 免费成人在线观看| 欧美电影免费提供在线观看| 日本中文一区二区三区| 欧美精品tushy高清| 五月天中文字幕一区二区| 欧美日韩卡一卡二| 日韩精品欧美精品| 欧美大尺度电影在线| 麻豆精品视频在线观看| 欧美一区二区女人| 国内精品写真在线观看| 久久婷婷国产综合精品青草| 国产精品99久久久久久久vr| 亚洲国产精品av| 99久久er热在这里只有精品66| 中文字幕亚洲成人| 欧洲视频一区二区| 天堂一区二区在线| 精品国产乱码久久久久久久久 | 欧美日韩精品一区二区三区蜜桃 | 91精品欧美福利在线观看| 青青青爽久久午夜综合久久午夜| 欧美一级高清大全免费观看| 久久精品国产亚洲高清剧情介绍| ww亚洲ww在线观看国产| 国产 日韩 欧美大片| 亚洲婷婷综合色高清在线| 欧美怡红院视频| 久久成人18免费观看| 国产网站一区二区| 91久久久免费一区二区| 日韩高清在线观看| 国产喷白浆一区二区三区| 色先锋aa成人| 免费国产亚洲视频| 国产精品麻豆视频| 欧美色手机在线观看| 欧美一级在线视频| 国产成人精品免费看| 亚洲在线成人精品| 欧美电影免费观看高清完整版在线 | 国产精品成人一区二区三区夜夜夜| 色婷婷综合久久久| 青青草97国产精品免费观看 | 免费高清在线一区| 中文字幕av一区二区三区| 在线观看成人小视频| 麻豆成人在线观看| 最新国产成人在线观看| 欧美探花视频资源| 国产主播一区二区三区| 专区另类欧美日韩| 日韩一区二区视频| 99久久免费精品| 久久综合综合久久综合| 综合久久给合久久狠狠狠97色| 777午夜精品免费视频| 成人免费视频视频在线观看免费| 午夜电影一区二区| 国产精品二区一区二区aⅴ污介绍| 欧美偷拍一区二区| 国产精品综合av一区二区国产馆| 一区二区三区精密机械公司| 精品久久久久久久久久久院品网 | 日韩精品一区二区三区四区视频 | 亚洲一二三四在线| 日本一区二区三区高清不卡| 欧美日韩在线播| www.激情成人| 黄色日韩三级电影| 午夜电影一区二区| 亚洲免费在线视频一区 二区| 欧美白人最猛性xxxxx69交| 色婷婷亚洲精品| 成人免费黄色大片| 精品一区二区成人精品| 亚洲一卡二卡三卡四卡五卡| 国产精品不卡视频| 久久久国产综合精品女国产盗摄| 欧美日韩精品欧美日韩精品一 | 欧美巨大另类极品videosbest | 日韩欧美不卡一区| 欧美日高清视频| 在线中文字幕不卡| 99久久久久久| 国产乱码精品一区二区三区五月婷| 亚洲成人午夜影院| 亚洲另类色综合网站| 中文字幕一区二| 国产欧美日产一区| 日本不卡一二三区黄网| 香蕉成人伊视频在线观看| 亚洲欧美日韩系列| 国产精品天天看| 国产清纯美女被跳蛋高潮一区二区久久w| 91精品国产综合久久久蜜臀粉嫩| 91高清视频免费看| 91免费版pro下载短视频| 懂色中文一区二区在线播放| 国内精品国产三级国产a久久| 蜜臀av国产精品久久久久| 日韩国产成人精品| 手机精品视频在线观看| 天堂成人免费av电影一区| 亚洲午夜激情av| 亚洲成人tv网| 日韩中文欧美在线| 蜜臀精品一区二区三区在线观看 | 欧美一区二区免费| 91精品国产欧美日韩| 欧美一区中文字幕| 欧美一级午夜免费电影| 欧美一区二区三区精品| 欧美一区二区三区免费视频| 日韩一级高清毛片| 日韩精品中文字幕在线一区| 欧美大尺度电影在线| 久久综合久久综合久久| 久久伊人中文字幕| 国产视频一区在线播放| 国产精品不卡在线| 一区二区三区在线播放| 香蕉成人伊视频在线观看| 午夜精品久久久久久久蜜桃app|