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

RM0016

Universal asynchronous receiver transmitter (UART)

 

 

22.7.9Control register 5 (UART_CR5)

Address offset: 0x08

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

SCEN

NACK

HDSEL

IRLP

IREN

 

 

Reserved

 

 

 

 

 

Reserved

 

r

r

rw

rw

rw

 

 

 

 

 

 

 

 

 

 

 

Bits 7:6 Reserved, must be kept cleared.

Bit 5 SCEN: Smartcard mode enable.

This bit is used for enabling Smartcard mode.

0:Smartcard Mode disabled

1:Smartcard Mode enabled

Note: This bit is not available for UART3.

Bit 4 NACK: Smartcard NACK enable

0:NACK transmission in case of parity error is disabled

1:NACK transmission during parity error is enabled.

Note: This bit is not available for UART3.

Bit 3 HDSEL: Half-Duplex Selection

Selection of Single-wire Half-duplex mode

0:Half duplex mode is not selected

1:Half duplex mode is selected

Note: This bit is not available for UART2 and UART3.

Bit 2 IRLP: IrDA Low Power

This bit is used for selected between normal and Low power IrDA mode

0:Normal mode

1:Low power mode

Note: This bit is not available for UART3.

Bit 1 IREN: IrDA mode Enable

This bit is set and cleared by software.

0:IrDA disabled

1:IrDA enabled

Note: This bit is not available for UART3.

Bit 0 Reserved, must be kept cleared.

Doc ID 14587 Rev 9

357/454

Universal asynchronous receiver transmitter (UART)

RM0016

 

 

22.7.10Control register 6 (UART_CR6)

Address offset: 0x09

Reset value: 0x00

7

6

5

4

 

3

2

1

0

 

 

 

 

 

 

 

 

 

LDUM

 

LSLV

LASE

 

 

LHDIEN

LHDF

LSF

 

Reserved

 

 

 

Reserved

 

 

 

rw

rw

rw

 

rw

rc_w0

rc_w0

 

 

 

 

 

 

 

 

 

 

 

 

Note:

This register is not available for UART1.

 

 

 

 

Bit 7 LDUM: LIN Divider Update Method

0:LDIV is updated as soon as BRR1 is written (if no automatic resynchronization update occurs at the same time).

1:LDIV is updated at the next received character (when RXNE=1) after a write to the BRR1 register. LDIV is coded using the two register BRR1 and BRR2

This bit is reset by hardware once LDIV is updated with the measured baud rate at the end of the synch field.

Bit 6 Reserved

Bit 5 LSLV: LIN Slave Enable

0:LIN Master Mode

1:LIN Slave Mode

Bit 4 LASE: LIN automatic resynchronisation enable

0:LIN automatic resynchronization disabled

1:LIN automatic resynchronization enabled

Bit 3 Reserved

Bit 2 LHDIEN: LIN Header Detection Interrupt Enable.

Header interrupt mask.

0:LIN header detection interrupt disabled

1:LIN header detection interrupt enabled

Bit 1 LHDF: LIN Header Detection Flag.

This bit is set by hardware when a LIN header is detected in LIN slave mode and cleared by software writing 0.

0:LIN Header not detected

1:LIN Header detected (Break+Sync+Ident)

An interrupt is generated when LHDF=1 if LHDIEN=1

Bits 0 LSF: LIN Sync Field

This bit indicates that the LIN Synch Field is being analyzed. It is only used in LIN Slave mode. In automatic resynchronization mode (LASE bit=1), when the UART is in the LIN Synch Field State it waits or counts the falling edges on the RDI line.

It is set by hardware as soon as a LIN Break is detected and cleared by hardware when the LIN Synch Field analysis is finished. This bit can also be cleared by software writing 0 to exit LIN Synch State and return to idle mode.

0:The current character is not the LIN Synch Field

1:LIN Synch Field State (LIN Synch Field undergoing analysis)

358/454

Doc ID 14587 Rev 9

RM0016

Universal asynchronous receiver transmitter (UART)

 

 

22.7.11Guard time register (UART_GTR)

Address offset: 0x09 (UART1), 0x0A (UART2 and UART4)

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

GT[7:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 GT[7:0]: Guard time value.

This register gives the Guard time value in terms of number of baud clocks.

This is used in Smartcard mode.The Transmission Complete flag is set after this guard time value.

Note: These bits are not available for UART3.

Doc ID 14587 Rev 9

359/454

Universal asynchronous receiver transmitter (UART)

RM0016

 

 

22.7.12Prescaler register (UART_PSCR)

Address offset: 0x0A (UART1), 0x0B (UART2 and UART4)

Reset value: 0x00

Note:

Care must be taken to program this register with correct value, when both Smartcard and

 

IrDA interfaces are used in the application

 

 

 

 

7

6

5

4

 

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

PSC[7:0]

 

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 PSC[7:0]: Prescaler value.

In IrDA Low Power mode

PSC[7:0] = IrDA Low Power Baud Rate (1)

Used for programming the prescaler for dividing the system clock to achieve the low power frequency:

The source clock is divided by the value given in the register (8 significant bits): 0000 0000: Reserved - do not program this value

0000 0001: divides the source clock by 1

0000 0010: divides the source clock by 2

...

In Smartcard mode

PSC[4:0]: Prescaler value. (2) (3)

Used for programming the prescaler for dividing the system clock to provide the smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency:

0 0000: Reserved - do not program this value

0 0001: divides the source clock by 2

0 0010: divides the source clock by 4

0 0011: divides the source clock by 6

...

Note: These bits are not available for UART3.

1.This prescaler setting has no effect if IrDA mode is not enabled.

2.This prescaler setting has no effect if Smartcard mode is not enabled.

3.Bits [7:5] have no effect even if Smartcard mode is enabled.

360/454

Doc ID 14587 Rev 9

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