UART in half-duplex mode loads line even though not actively transmitting? (XMC 1100)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User17585
Level 1
Level 1
First like given Welcome! 5 replies posted
Hi,

In my application a single line for reception and transmission is used for the UART. System voltage is 3.3V.
My UART App in DAVE is setup like this:
Operation Mode: Half Duplex
...
Transmit mode: Direct
Receive mode: Interrupt

Enable transmit FIFO to Size: 16
Disable receive FIFO

Enable data input inversion
Enable data output inversion
...
End of receive callback: BlaBla_Rec_IRQHandler
...
Enable advanced pin characteristics
Transmit Mode: Push Pull

The UART uses channel 1 of the USIC in the XMC 1100.

The system I'm developing acts as a slave listening on the UART line.
If a special two byte message is received by my system where the second byte is the ID
of my system it answers with a sequence of bytes which are written to the FIFO
using UART_TransmitWord(...). After that the system again activates reception of
the next request by the master using UART_Receive(...)

My idea of "Half Duplex" using the Transmit Mode "Push Pull" is that the UART
automatically strongly drives '0's and '1's it sends out on the line beginning with the start bit,
but tristates the output buffer after the stop bit is transmitted.

Unfortunately this seems not to be the case. My oscilloscope shows that the
request messages sent onto the line by the master come in with high levels barely
rising to 2.1V (although the master uses 3.3V signaling levels).

When starting my system in the debugger at the beginning the high level sent by
the master reaches 3.3V. But as soon as the instruction DAVE_Init(); has executed
the high level is restricted to 2.1 V.

I also tried the Transmit Mode "Open Collector" which of course does not work in my system, because
there is no pull-up resistor. Even with this setting the 3.3V-to-2.1V high level downshift is there
right after DAVE_Init();

Since the master drives the UART line using a 74x1G126 (single gate tristate buffer) over a 50 Ohms
series resistor I suppose that the XMC UART seems to load the line using not only a pull-up or
pull-down, but actively holds the line on low level (inverted signaling is used).

If I switch
Enable data output inversion
off, the behavior is mirrored. The low level is shifted up to about 1.2V and the inactive level
is high now (although held to low via 20k pull-down at the master device).

Any idea on how to switch off the line driver when the UART is not actually transmitting?

Best Regards,
Markus
0 Likes
6 Replies
User17585
Level 1
Level 1
First like given Welcome! 5 replies posted
Changed my hardware setup now to use pin P1.0 (from USIC0CH0) which seems to be the only one in XMC1100 which provides Hardware Controlled I/O for USIC.

Port1 shall be controlled by USIC0/CH0:

// Set Port P1.0 as alternate output function 7
PORT1->IOCR0 &= ~PORT1_IOCR0_PC0_Msk;
PORT1->IOCR0 |= 0x17 << PORT1_IOCR0_PC0_Pos;

HW control by HWO1:

// Clear the HWSEL field
PORT1 -> HWSEL &= ~PORT1_HWSEL_HW0_Msk;
// Select hardware control path HW1 for Port P1.0
PORT1 -> HWSEL |= (2 << PORT1_HWSEL_HW0_Pos);

Although the reference manual says this setting is useful only for SSC modes
hardware control for DX0 and DOUT0 is enabled (otherwise the TX/RX pin will
always be driven to 0):

USIC0_CH0 -> CCR &= ~USIC_CH_CCR_HPCEN_Msk;
USIC0_CH0 -> CCR |= (1 << USIC_CH_CCR_HPCEN_Pos);

For this setting does not make a difference wether a 0 or 1 is written:

USIC0_CH0 -> TCSR &= ~USIC_CH_TCSR_HPCMD_Msk;
USIC0_CH0 -> TCSR |= (1 << USIC_CH_TCSR_HPCMD_Pos);

This settings will make the UART receive, but output will not be seen on the pin.

Infineon, is the half duplex mode really working for ASC in Push Pull configuration? I'd expect that the UART automatically
activates the output buffers of the Push Pull I/O pin and will deactivate when no longer transmitting.

After days spent reading the docs, the forum and trying so many different versions I'm simply running out of ideas.

An example using the USIC in ASC mode for half duplex communication using a single pin
would be highly appreciated!

Markus
0 Likes
User17585
Level 1
Level 1
First like given Welcome! 5 replies posted
Since there was no response up to now, let me condense the text above:

How to setup the DAVE UART App for Half Duplex operation on a single pin when using
PushPull drivers?

What that should do is to send using the PushPull driver using the combined Tx/Rx pin.
But when it does not send the pin should be an input pin (maybe with activated PullUp or PullDown).

Simply setting "Half Duplex" under the General Settings tab seems not to be enough. It looks
like "Hardware Control" of the Tx/Rx pin is not implemented when choosing this App setting
thus rendering it useless.

Help would be appreciated very much since I'm in the middle of a product development and
have used up the complete week on this tiny problem. At the moment it looks like
choosing the XMC was not such a good idea.
0 Likes
User17585
Level 1
Level 1
First like given Welcome! 5 replies posted
Since I was not able to make the UART control the GPIO pin in the way described above the following approach was used as a workaround:

- IOCR register is set for alternate function enabling the UART when the UART transmit function is called
- When the transmit IRQ calls its handler a last byte is still in transmission
- XMC_UART_CH_STATUS_FLAG_TRANSMITTER_FRAME_FINISHED is cleared
(problems arise if another IRQ handler with higher priority uses up enough time to send out the very last byte before this is called)
- That last byte will be waited on via polling of XMC_UART_CH_STATUS_FLAG_TRANSMITTER_FRAME_FINISHED.
- GPIO is set for input with pullup again

Still it would be much more elegant to have the UART switch the GPIO driver on and off automatically. Infineon?
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

The UART APP, when half duplex is selected, it is configuring the TXD pin as open drain and the passive level to high.

If you want to use push-pull configuration, you will need to enable/disable the driver as you have already done.

Regards,

Jesus
0 Likes
User17585
Level 1
Level 1
First like given Welcome! 5 replies posted
Hi Jesus,

thanks for your clarifying reply!

Still I think that this feature should be added to the USIC peripheral. Maybe you could forward it to the System Engineer responsible for the USIC specification.
This would be rather easy and straightforward to implement in the hardware peripheral, but it is not so funny hiding it in the IRQ jungle I had to make up.

Thanks,
Markus
0 Likes
Aarsh
Level 1
Level 1
First reply posted Welcome!

Hi @User17585, I am late to the party but, I am in the exact same boat. Were you able to use the RX interrupt as stated in the very first post? My platform is XMC1300 but am after the similar thing. 

 

Aarsh

0 Likes