Reply
Posts: 48
Registered: ‎11-07-2015

EFR32ZG chip behavior when USART(SPI) RX/TX pin is muddled

Theoretical question about chip's behavior when connection by SPI to slave module has muddled RX/TX wires - what will be with the chip in this case from the point of view of MCU architecture?

 

In my case of wrong connection STK3400 defines by Windows normally but after reconnect STK3400 can be stay in power down mode. I can define this situation only by double check of connection.

 

_____________________
Best regards,
Danil Borchevkin,
Owner Lab409.ru
Posts: 563
Registered: ‎09-18-2015

Re: EFR32ZG chip behavior when USART(SPI) RX/TX pin is muddled

Hi @DanilBorchevkin,

 

What part are you working with?

 

STK3400 is for Happy Gecko.

 

Also, what do you mean by "muddled RXTX wires"?

 

John

Posts: 48
Registered: ‎11-07-2015

Re: EFR32ZG chip behavior when USART(SPI) RX/TX pin is muddled

@JohnB sorry - SLSTK3400A Happy Gecko Starter Kit.

 

Also, what do you mean by "muddled RXTX wires"?

 

I mean what I connect on USART_TX(MOSI) of STK which operate as master a MISO pin of slave device and vice versa.  (I don't know a verb used for it situation). 

_____________________
Best regards,
Danil Borchevkin,
Owner Lab409.ru
Posts: 230
Registered: ‎08-19-2015

Re: EFR32ZG chip behavior when USART(SPI) RX/TX pin is muddled

Hi @DanilBorchevkin,

 

To be clear, what you are saying about the connection is that you have the master Tx pin (MOSI) connected to the slave Tx pin (MISO) and the master Rx pin (MISO) connected to the slave Rx pin (MOSI), as in this diagram:

 

SPI_connection.png

This connection will not result in any successful communications.  On the Rx pin for both devices, I would expect undefined results due to the connection of two input pins together with undefined states on that signal line.

 

As for the TX pins being connected together, this may present more of a direct problem, as these pins will be output pins on both master and slave device, and there is a possibility of contention on these pins if one device is driving the line high and the other is trying to drive the line low.  This will also produce undefined behavior, and could damage one or both of the devices.  

 

In any case, connecting the SPI/USART module in this way will not work properly and is not recommended.  You should connect the devices as shown in this image (Master Tx (MOSI) to slave Rx (MOSI) and Master Rx (MISO) to Slave Tx (MISO)):

 

SPI_connection_correct.png

 

I hope this helps.

 

Regards,

Mitch

Posts: 48
Registered: ‎11-07-2015

Re: EFR32ZG chip behavior when USART(SPI) RX/TX pin is muddled

@MitchC thanks for explorations!

 

I understood this but I'm trying to realize why in this case the STK doesn't start (doesn't working) - it's quastion more about acrhitecture features.

_____________________
Best regards,
Danil Borchevkin,
Owner Lab409.ru
Posts: 230
Registered: ‎08-19-2015

Re: EFR32ZG chip behavior when USART(SPI) RX/TX pin is muddled

Hi @DanilBorchevkin,

 

1) Can you provide more information about the STK behavior? 

 

2) Does it work properly when the SPI is unconnected or connected as properly shown in the second diagram above? 

 

3) Are you saying it doesn't work when you connect it incorrectly as described in my first diagram above?

 

4) How are you determining that the EFM32HG MCU on the STK is or is not executing code?

 

5) What firmware are you running when you conduct this test?

 

Thank you,

Mitch

Posts: 48
Registered: ‎11-07-2015

Re: EFR32ZG chip behavior when USART(SPI) RX/TX pin is muddled

@MitchC

 

1) Can you provide more information about the STK behavior? 

 

In case incorrectly connection data is transfer by SPI correctly but there are several scenarios of incorrect work:

1. STK may be shutdown during code execution (LCD off, STK doesn't recognize by operational system and simplicity studio).

2. If I disconnect the STK from USB and connect again the STK may not start and doesn't recognize by system. After several reconnect operation the STK again works.

 

2) Does it work properly when the SPI is unconnected or connected as properly shown in the second diagram above? 

 

Yes in this case STK works properly but can be shutdown and disconnect from USB and doesn't detect by Windows and Simplicity Studio. I verify data transfer by logic analyzer.

 

3) Are you saying it doesn't work when you connect it incorrectly as described in my first diagram above?

STK works in this case but there are situation desribed in 1 statement.

 

4) How are you determining that the EFM32HG MCU on the STK is or is not executing code?

 

If STK starts works determine by logic analyzer and heartbeat led.

 

5) What firmware are you running when you conduct this test?

 

Test firmware based on AN0008

 

_____________________
Best regards,
Danil Borchevkin,
Owner Lab409.ru