I'm using Arduino MKR GSM 1400. I know this board uses Atmel SAMD21 and SAMD21 support half duplex (USART with full-duplex and single-wire half-duplex configuration). My question is, How Can I configure one of the SERCOMs to use it as Half-Duplex (Use one pin for rx and tx)?
Asked
Active
Viewed 350 times
1
-
what problem do you try to solve? – Juraj Jan 24 '20 at 18:38
-
@Juraj So what is http://asf.atmel.com/docs/latest/sam0.applications.samba_bootloader.samc21_xplained_pro/html/asfdoc_sam0_sercom_usart_mux_settings.html ? – user3866081 Jan 24 '20 at 19:17
-
@Juraj "When TX and RX are connected to the same pin, the USART will operate in half-duplex mode if both one transmitter and several receivers are enabled." – user3866081 Jan 24 '20 at 19:17
-
so try it. the Arduino wrapper classes don't have clock pin configuration so you can't configure USART only UART. so you must use registers or some other framework then Arduino – Juraj Jan 24 '20 at 19:33
1 Answers
1
Up to six Serial Communication Interfaces (SERCOM), each configurable to operate as either:
- USART with full-duplex and single-wire half-duplex configuration
- I2C up to 3.4 MHz
- SPI
- LIN slave
It is an error in the overview of the SAM D21 features in the datasheet. The SERCOM is half-duplex for I2C. USART can't be configured half-duplex.
see Application Note about SERCOM configuration
1 Introduction to Serial Communication Interfaces (USART, I2C, and SPI)
... The exchange of data can be half-duplex or fullduplex depending on the serial module specification. ...
1.1 USART
... It is full-duplex in operation. ...
1.2 I2C
... It is half-duplex in communication. ...
George Hawkins
- 103
- 2
Juraj
- 17,050
- 4
- 27
- 43
-
-
Is there any library like https://github.com/nickstedman/SoftwareSerialWithHalfDuplex for SAMD21? – user3866081 Jan 24 '20 at 18:36
-