Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
49
Добавлен:
01.03.2016
Размер:
544.67 Кб
Скачать

UM0470

Single wire interface module (SWIM)

 

 

3.4SWIM communication protocol

When in ACTIVE mode, communication can be initiated by host or device. Each byte or command is preceded by a 1-bit header in order to arbitrate if both host and device initiate the communication at the same time.

The host header is ‘0’ in order to have the priority over the device in case of arbitration, due to open-drain capability. The host can start the transfer only if there is no transfer on-going.

Figure 8. Command format (Host -> Target)

 

Command

Data1

...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

b2

b1

b0

pb

ack

0

b7

b6

b5

b4

b3

b2

b1

b0

pb

ack

 

Italic: Bit sent by the Host

 

 

 

 

 

 

 

 

 

 

 

Bold: Bit sent by the device

 

 

 

 

 

 

 

 

 

 

 

Each command sent by the host is made of:

1 command (ROTF, WOTF or SWRST) made of

Header: 1 bit at ‘0’

b2-b0: 3-bit command

pb: parity bit: XOR between all b(i)

ack:acknowledge (1 bit at ‘1’). The receiver must send the not-acknowledge value if it has detected a parity error (NACK: not acknowledge = 1 bit at ‘0’), or it is not yet ready.

optionally several data packets (in case of WOTF) made of:

 

Header: 1 bit at ‘0’

 

 

 

 

 

 

 

b7-b0:

8-bit data

 

 

 

 

 

 

 

pb:

parity bit sent after data. XOR between all b(i)

 

ack:

acknowledge

 

 

 

 

 

 

Figure 9. Data format (Target -> Host)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

data n-1

 

 

 

 

data n

 

 

 

 

data n+1 ...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

b5

 

 

 

 

 

 

 

 

 

 

 

 

1

b7

b6

b4

b3

b2

b1

b0

pb

ack

 

 

Italic: Bit sent by the Host

 

 

 

 

 

 

 

Bold: Bit sent by the device

 

 

 

 

 

 

 

 

 

 

 

 

 

Each data frame is made of:

 

 

 

 

 

 

 

Header: 1 bit at ‘1’

 

 

 

 

 

 

 

b7-b0:

8-bit data

 

 

 

 

 

 

 

pb:

parity bit sent after data

 

 

 

 

 

 

 

ack:

acknowledge

 

 

 

 

 

 

Doc ID 14024 Rev 3

13/37

Соседние файлы в папке Минимум документации STM8