2013年12月8日 星期日

有線~無線楖論(2)

在前篇中 有線~無線楖論(1)中對於網路模式TCP/IP的介紹,

 

接下來是對於有線通訊在 embeddend system的

 

So Many Ways of Communicating,其中最重要的是where does the clock come from?

image

其中對於我所使用的embeddend system中,最重要的是前三層的(physical, data link and network)

簡單的話就是 。並以I2C為例

physical: 電氣特性, 其幾條線其工作電壓是多少

data link :而是CRC檢查及定義出多少bit資料為一個封包(frame)

networ: 定義IP, 即其裝置的位址,address.

 

其中physical

中可分為Serial 及parall and synchronous/asynchronous , half/full duxplex

serial 串列即指一個time slace只能傳一個單位的資料:

parall 並列即指其可傳多於1個單位的資料.

synchronous: 同步則指的是二端必須同時做傳送動作(同步),即使有一端是沒有資料也要傳。

                   suart(use-are) synchronous receiver/transmitter,常見的有SPI

asynchrouous: 即二端是不需要同步動作的,而是以各自講好的機制(bit rate) protcol動作。

asynchronous receiver/transmitter

half duxplex :而其線材, 若只有一條線做為transfer and recevice則為半雙工。像是I2C(SDA)

full duxplex :其recevice and transfer各有一個時,則為全雙工, SPI.(SOMI, SIMO), RS232

image

對於I2C而言:

1.clock generate:

    is generate from master, which is exlicit. and because clock generater by master so it is not precise.

2. it have 3 wires(scl,sda,gnd) ,and it connect all peripherals ,so it control complex.

3. it is asynchronous . the master and slave only one wire to transfer data.

4. half duplex , only one sda.

5. there  address. and to select the via chip.

6. 3.4M bits/sec

7.

 

data link:

一個傳送單位frame 或 檢查CRC。

NetWork :

IP , system address.

 

I2C drivers invariably include a state machine to deal with the complexity of switching
the direction of the bus between the master transmitting and the slave transmitting.
The master starts communication by sending a 7-bit address and whether it wants to
read from or write to the slave. The slave with that address then sends an acknowledgement (ACK). Next, the master sends a command to (or reads from) the slave and
the interaction proceeds. When the communication is complete, the master sends a
stop bit.

 

p.s: 上次有同事,因為datasheet沒寫明是I2C或SPI or other的通訊介面。自己認為是I2C 等porting後,才發現不會動。

可見這些的重要性。

沒有留言:

張貼留言