Operating the UART using the starter kit SLSTK2001A (EFM8UB20F64G-QFP48)
11/306/2020 | 07:26 PM
I' working on an application that has to communicated with the EFM8UB2-micro with the UART (baud-rate of 115200)
Using the starter kit SLSTK2001A (that is based on EFM8UB20F64G-QFP48).
I'm trying to operate the UART through the extension header - P701 (Pins 2 & 4 Txd and Rxd). The communication must be directly UART, without converting it to USB.
I set P0.0 to "1", I also tried to clear it to "0" but with no success. I don't receive any thing. I also tried to use (instead of P701) the expansion port J102 (Pins 14 & 16 - P0.4 & P0.5). I got, with this port the receive bytes but it seems that the baud-rate is not good enough. (since the data was disrupted)
It seems that I miss something in the starter kit configuration.
I also tried the UART example S/W that is supported by Silicon LABS - but I got the same results.
Please help me to operate right the SLSTK2001A -EFM8UB20F64G-QFP48 starter kit to work through the header P701 with other CPU- UART
Discussion Forums
8-bit MCUs
Unanswered
Hi Amos,
The connections on port 701 go to the board controller (the debugger chip) not the EFM8UB2. In order to connect the UART of the UB2 to a port, use the pins on P100, J101, or J102.
Can you provide more detail about what is going wrong when running our example software? Are you able to send data from the part? If not, what do you see if you look at the UART TX pin with a scope?
Regards,
Joe
0
The SLSTK2001A/EFM8UB2 STK schematic is a bit confusing.
As Joe has said, the easiest method to communicate with an external MCU via UART is to use the pin in expansion header.
I am wondering why you prefer to use the P701. I have not try this, you may try:
1. set the STK mode as IN.
2. Enable the EFM_BC_EN (pin p0.0 of EFM8UB2) in your firmware for EFM8UB2.
3. the firmware for EFM8UB2 enable the UART (P0.4,P0.5).
0
Thanks a lot for your fast response.
I tried to do the things that you have suggested but I got the following: (Unfortunately I don't have a Scope)
1. When I changed the mode from "DEBUG_MCU" to "IN" I couldn't debug through the J-Link USB connector any more.
2. I connected the JTAG connector (J103) to the Silicon LAB - "USB Debug Adapter", working with "IN" mode and connect connector J102 (Pins 14 & 16 - P0.4 & P0.5). I also enabled EFM_BC_EN (pin p0.0 of EFM8UB2) in my firmware by setting it to "1" logic.
In this situation I didn't get any response! (I added break point inside the UART interrupt and there wasn't any interrupt).
3. In the same configuration (of the above 1 & 2 sections) I changed EFM_BC_EN (pin p0.0 of EFM8UB2) to logic level "0". When I this change, I got the UART interrupt I got wrong data. (it looks like the baud-rate is wrong).
4. I got the same using the UART example S/W that is supported by Silicon LABS.
5. Working with other board (One that I designed with the EFM8UB20F32G), it works perfectly.
0
1. I guess you mean you could not debug the EFM8UB2 device on the STK.
This is expected. I suggest setting to IN mode to test only the UART function.
2.
I connected the JTAG connector (J103) to the Silicon LAB - "USB Debug Adapter",
As far as I know UDA (USB Debug Adapter) don't have VCOM/UART function.
This is very strange, please elaborate how you connect the UDA to STK (J103). I suppose you should not do like that.
3. Please elaborate your test setup as detailed as possible.
How your external MCU was tied to STK. how you power the STK. Have you set the STK debug mode as 'IN'.
If possible, please also capture the and upload the UART signal with a scope.
4. --
5. you need tell us how you setup the test. the EFM8UB UART was suppose to work fine.
Unfortunately if you need to communicate with the EFM8UB2 on the STK board, you may need spend some time to know how this works.
There is a lot of mux/switch to make the VCOM work, the IN/OUT/MCU/OFF made this more complicated.
0
1. My current configuration (after changing the STK mode from "DEBUG_MCU" to "IN") is:
1.1 Supporting the power from the J-Link connector that is connected to my PC - USB connector (Currently it is only power).
1.2 The STK switch is at the left side (AEM position).
1.3 Connect the Silicon LAB - "USB Debug Adapter" to the JTAG through J103 to my PC and configure the debugging option in the "Simlicity Studio" to download, run and debug the MCU in the STK through the Silicon LAB - "USB Debug Adapter". (It used only for downloading, running and debugging the Firmware not for UART communicating).
1.4 THE UART, using the connector J102 (Pins 14 & 16 - P0.4 & P0.5) of the STK is connect to UART of other device for simulating a complete UART communication between the MCU in the STK and other micro (it is now connected to another PC that is communicating with my STK through the UART only. NOT through the USB debug Adapter nor the J-Link).
2. I went other the schematics and didn't find any issue that explain this.
3. Pay attention to that: If I set P0.0 to "1" - the UART is not working (there isn't any UART interrupt) - BUT if I clear P0.0 to "0" the UART is work - there is UART interrupt for each sending byte but the data I get from the other PC is not correct.
0
1.
1. 1 fine.
1. 2 fine
1. 3 fine
1. 4 fine
1. 5. How about the result of your test?
I could try similar test tomorrow and get back to you.
2.
3. Do you mean you got this result with 1. 1~1. 4 setup.
a. Do you mean the external MCU could receive (transmit from UB2)?
b. But UB2 couldn't receive from external MCU?
0
Hi again,
I have measured today the UART Rx and Tx signal that I see at J102 (Pins 14 & 16 - P0.4 & P0.5). The picture I took from the Scope is attached.
It can be seen that they both (Tx and Rx) are working - baud-rate of 115,200. but the data is not corrected (not Rx nor the Tx).
Can you provide more information about how the data from the other device is not correct?
- Do you receive the number of bytes you expect, or do you get more or less than you expect?
- Is each byte correct, or are there bit errors? Is there a pattern to them? For example, are they shifted, 0s where 1s are expected, 1s where 0s are expected?
- Are there errors sending and receiving, or only one way?
- Does changing the baud rate (for example, to a slower baud rate) improve any of this?
Regards,
Joe
0
Yes, I received the number of bytes I expected to get.
The problem is that each byte is not the byte I expect to get.
For instance: instead of the number (decimal) 60 I get 24 and so on.
The same issue I see in the sending and in the receiving.
I didn't noticed a pattern that I can identify, (It could be).
I tried to do a little changes in baud rate with no success.
Did you try to connect the STK and test it yourself?
Operating the UART using the starter kit SLSTK2001A (EFM8UB20F64G-QFP48)
I' working on an application that has to communicated with the EFM8UB2-micro with the UART (baud-rate of 115200)
Using the starter kit SLSTK2001A (that is based on EFM8UB20F64G-QFP48).
I'm trying to operate the UART through the extension header - P701 (Pins 2 & 4 Txd and Rxd). The communication must be directly UART, without converting it to USB.
I set P0.0 to "1", I also tried to clear it to "0" but with no success. I don't receive any thing. I also tried to use (instead of P701) the expansion port J102 (Pins 14 & 16 - P0.4 & P0.5). I got, with this port the receive bytes but it seems that the baud-rate is not good enough. (since the data was disrupted)
It seems that I miss something in the starter kit configuration.
I also tried the UART example S/W that is supported by Silicon LABS - but I got the same results.
Please help me to operate right the SLSTK2001A -EFM8UB20F64G-QFP48 starter kit to work through the header P701 with other CPU- UART
Hi Amos,
The connections on port 701 go to the board controller (the debugger chip) not the EFM8UB2. In order to connect the UART of the UB2 to a port, use the pins on P100, J101, or J102.
Can you provide more detail about what is going wrong when running our example software? Are you able to send data from the part? If not, what do you see if you look at the UART TX pin with a scope?
Regards,
Joe
The SLSTK2001A/EFM8UB2 STK schematic is a bit confusing.
As Joe has said, the easiest method to communicate with an external MCU via UART is to use the pin in expansion header.
I am wondering why you prefer to use the P701. I have not try this, you may try:
1. set the STK mode as IN.
2. Enable the EFM_BC_EN (pin p0.0 of EFM8UB2) in your firmware for EFM8UB2.
3. the firmware for EFM8UB2 enable the UART (P0.4,P0.5).
Thanks a lot for your fast response.
I tried to do the things that you have suggested but I got the following: (Unfortunately I don't have a Scope)
1. When I changed the mode from "DEBUG_MCU" to "IN" I couldn't debug through the J-Link USB connector any more.
2. I connected the JTAG connector (J103) to the Silicon LAB - "USB Debug Adapter", working with "IN" mode and connect connector J102 (Pins 14 & 16 - P0.4 & P0.5). I also enabled EFM_BC_EN (pin p0.0 of EFM8UB2) in my firmware by setting it to "1" logic.
In this situation I didn't get any response! (I added break point inside the UART interrupt and there wasn't any interrupt).
3. In the same configuration (of the above 1 & 2 sections) I changed EFM_BC_EN (pin p0.0 of EFM8UB2) to logic level "0". When I this change, I got the UART interrupt I got wrong data. (it looks like the baud-rate is wrong).
4. I got the same using the UART example S/W that is supported by Silicon LABS.
5. Working with other board (One that I designed with the EFM8UB20F32G), it works perfectly.
1. I guess you mean you could not debug the EFM8UB2 device on the STK.
This is expected. I suggest setting to IN mode to test only the UART function.
2.
As far as I know UDA (USB Debug Adapter) don't have VCOM/UART function.
https://www.silabs.com/community/interface/knowledge-base.entry.html/2011/11/30/usb_debug_adapterpi-oDwQ
This is very strange, please elaborate how you connect the UDA to STK (J103). I suppose you should not do like that.
3. Please elaborate your test setup as detailed as possible.
How your external MCU was tied to STK. how you power the STK. Have you set the STK debug mode as 'IN'.
If possible, please also capture the and upload the UART signal with a scope.
4. --
5. you need tell us how you setup the test. the EFM8UB UART was suppose to work fine.
Unfortunately if you need to communicate with the EFM8UB2 on the STK board, you may need spend some time to know how this works.
There is a lot of mux/switch to make the VCOM work, the IN/OUT/MCU/OFF made this more complicated.
1. My current configuration (after changing the STK mode from "DEBUG_MCU" to "IN") is:
1.1 Supporting the power from the J-Link connector that is connected to my PC - USB connector (Currently it is only power).
1.2 The STK switch is at the left side (AEM position).
1.3 Connect the Silicon LAB - "USB Debug Adapter" to the JTAG through J103 to my PC and configure the debugging option in the "Simlicity Studio" to download, run and debug the MCU in the STK through the Silicon LAB - "USB Debug Adapter". (It used only for downloading, running and debugging the Firmware not for UART communicating).
1.4 THE UART, using the connector J102 (Pins 14 & 16 - P0.4 & P0.5) of the STK is connect to UART of other device for simulating a complete UART communication between the MCU in the STK and other micro (it is now connected to another PC that is communicating with my STK through the UART only. NOT through the USB debug Adapter nor the J-Link).
2. I went other the schematics and didn't find any issue that explain this.
3. Pay attention to that: If I set P0.0 to "1" - the UART is not working (there isn't any UART interrupt) - BUT if I clear P0.0 to "0" the UART is work - there is UART interrupt for each sending byte but the data I get from the other PC is not correct.
1.
1. 1 fine.
1. 2 fine
1. 3 fine
1. 4 fine
1. 5. How about the result of your test?
I could try similar test tomorrow and get back to you.
2.
3. Do you mean you got this result with 1. 1~1. 4 setup.
a. Do you mean the external MCU could receive (transmit from UB2)?
b. But UB2 couldn't receive from external MCU?
Hi again,
I have measured today the UART Rx and Tx signal that I see at J102 (Pins 14 & 16 - P0.4 & P0.5). The picture I took from the Scope is attached.
It can be seen that they both (Tx and Rx) are working - baud-rate of 115,200. but the data is not corrected (not Rx nor the Tx).
I appreciate your help,
Amos
Can you provide more information about how the data from the other device is not correct?
- Do you receive the number of bytes you expect, or do you get more or less than you expect?
- Is each byte correct, or are there bit errors? Is there a pattern to them? For example, are they shifted, 0s where 1s are expected, 1s where 0s are expected?
- Are there errors sending and receiving, or only one way?
- Does changing the baud rate (for example, to a slower baud rate) improve any of this?
Regards,
Joe
Yes, I received the number of bytes I expected to get.
The problem is that each byte is not the byte I expect to get.
For instance: instead of the number (decimal) 60 I get 24 and so on.
The same issue I see in the sending and in the receiving.
I didn't noticed a pattern that I can identify, (It could be).
I tried to do a little changes in baud rate with no success.
Did you try to connect the STK and test it yourself?
Thanks