I am using the c8051F583, a great chip with all the peripherals !! The new chips EFM8xxx have a feature, that I would need too. The inversion of the PWM Signal on the Port Pin. In the drawing in the datasheet (page 320) the inverted output /Q of the match flipflop is available. Is there a possiblility to route this output to the port pin ?
The latest updates to Windows 10 and Windows 7 have caused reported issues with Silicon Labs' Toolstick adapters, 8-bit debug adapters, and 32-bit debug adapters.
The reported behavior is that the debug adapters do not enumerate properly. Affected devices will not show up in the Windows Device Manager. Example bug reports are linked below.
If you are running into these issues you can try to roll back the above updates. However note that Microsoft places some restrictions on rolling back an update. For more information about rolling back a windows update and Microsoft's restrictions on uninstalling updates click the links below.
Hello guys! I recently started with EFM8UB20F64G-B-QFP48R microcontroller. It seems to be a very powerful little thing. I want to communicate with another microcontroller that i'am using right now, via MODBUS RTU. ( rs232 or 485 doesn't matter ) The EFM8UB2 will be a slave Modbus rs232 device. Its work is to be a some kind of I/O expander for my ESP32. To be achive this, i want to use its UART peripherial to be able to communicate with multiple chips from the esp32.
Right now i'am using Simplicity IDE for programming the EFM8UB2. The esp32 side programming is happaning with Visual Studio Code and with Arduino framework. So as you can see from that information, the C language is a bit tricky for me. What i wanted to know is, are there any example code for Modbus rtu implementation in C language for the EFM8UB2 chip, or some another 8051 controller example. I found an UART example in the Simplicity IDE for the EFM8UB2 controller. It is pretty straight forward. But don't know how to proceed further, especially for MODBUS RTU. ( I have seen a dozen of videos from the modbus protocol so in theory i know how it works )
Any help would be much appreciated. ( Where should i start, maybe an example c modbus rtu uart code )
Hi, I'm trying to use ADC autoscan (as per AN919) on a system where I've previously used non-autoscan conversions successfully. My basic requirement is to convert P1.2 through P1.5 every 2 msec (triggered by timer 4) with the best accuracy I can. The first problem I'm having is that I'm getting an ADC interrupt but my XDATA doesn't change. The ADC0 output SFR shows something, but nothing gets written to XDATA RAM. Where do I look?
My other specific questions are:
1. How do I force the alignment of my RAM array in XDATA to be word aligned? I tried __align(2) but the compiler chokes.
2. Does the ADRPT still work as I've been accumulating eight 12 bit conversions for lowest noise.
3. What do I set ADC0ASCT to? Is it 0 for 1 scan, 3 for 4 channels, 31 for 4 channels times 8 accumulations or something else?
Hi everyone, I would like to use the C8051F350 as part of a battery powered weigh scale. The problem is that a strain gage needs a lot of current so I would like to switch it off and disconnect it from the ADC as fast as possible. I know that, for example, with a SAR ADC a sensor can be disconnected from the input as soon as the sample and hold circuit has acquired the signal but I am not sure if this is the case with the C8051F350 which has a Sigma Delta ADC. So the question is, do I have to keep the strain gage connected to ADC input during the complete conversion cycle (in my case around 100mS) or can I disconnect it at some point after conversion start. Thanks in advance!
I'm using the SMBUS0 on a 8051F582 device, configured as master and using Timer1 for setting the SCL frequency.
If I want to generate a reset on the bus i.e. by pulling the SCL line low for >35 ms (that is what my slave specifies). What are my options?
1) Reconfigure the crossbar so I manually can set the SCL low? How do I do this without disturbing all my other interfaces (UART, CAN etc.)? What order do I need to set relevant register for a "glitch" free reconfiguration? My understanding is that it is always possible to read but not write to a pin if it is assigned by the crossbar to a resource.
2) The data sheet hints (page 246): "The SMBus interface is stalled while SI is set; thus SCL is held low, and the bus is stalled until software clears SI.". Perhaps I can manually set the SI bit in SMB0CN and with a separate "RESET" flag indicate that the ISR shall not clear the SI. Wait for 35 ms, clear the "RESET" flag and the SI bit. Any pitfalls in this logic?
I have a custom board equipped with a 8051F582-IM, the implemented circuit for the C2 and RST interface is attached.
With the weak pull-ups activated (XBR2 = 0x40) there are no issues with debugging over C2 using the USB Debug Adapter.
With the weak pull-ups disabled (XBR2 = 0xC0) I have the following behaviour:
- If I set a break-point before my main-loop it (almost every time) re-triggers the same break-point, or with multiple break-points it "jumps" backwards as if the device did a reset.
- If setting a break-point inside the main loop (or no break-point at all), everything works fine. As well pausing and continuing execution works. Have had a program running for 2-3 hours now without an issue.
- The debugger seems to have more communication faults as well. Forcing me to un-powered it, and restating Simplicity Studio in order to get the debugger up and running again.
The PCB track for the C2 interface is no more than 20-25 mm with the pull-up located on the far side when seen from the MCU. The debugger connects to the PCB using its ribbon cable (C2D, C2CK and ground connected).
The code that is executed before the main loop is the initialisation of the device registers for XBAR configuration, SPI, interrupts, and Timer0, plus setting a digital out to low (not being the RST pin). VDD reset is disable.
Iam using c8051f340 hid firmware template for making a hid device. I had modified my report descriptor values as per my requirement and even changed vid, pid values. But my device is not recognised by pc and showing me this message
"THE LAST USB DEVICE YOU CONNECTED TO THIS COMPUTER MALFUNCTIONED AND WINDOWS DOESNOT RECOGNISE IT" and "DEVICE DESCRIPTOR REQUEST FAILED".
At first I thought it was pc problem and tried various methods to solve it and tried a usb monitoring software to know where the problem exists...I found a packet in which the device sent IN packet with vid is 0000 and pid 0002. Iam doubting that it is problem in communication. I entered correct descriptor values and checked twice.how to know where I did mistake .Im not getting any idea what is the problem...anyone gone through this problem before
Forum
PWM inversion c8051F583
Good morning,
I am using the c8051F583, a great chip with all the peripherals !! The new chips EFM8xxx have a feature, that I would need too. The inversion of the PWM Signal on the Port Pin. In the drawing in the datasheet (page 320) the inverted output /Q of the match flipflop is available. Is there a possiblility to route this output to the port pin ?
best regards Karl
Connection Problem of USB Debug Adapter with Simplicity Studio
Hello,
When I connected a USB debug adapter to target and PC, I received an error message as below:
I used the version of Simplicity Studio is SV4.1.11.7. I paste it below:
The 8 bits MCU i used is C8051F563-A_IM. Can you let me know how to solve it?
Thanks,
Hao
Informational Thread: Toolstick and Debug Adapter Issues After Recent Win10 and Win7 Updates.
EDIT: See additional discussion in the Studio forum thread
https://www.silabs.com/community/software/simplicity-studio/forum.topic.html/informational_thread-kgyL
The latest updates to Windows 10 and Windows 7 have caused reported issues with Silicon Labs' Toolstick adapters, 8-bit debug adapters, and 32-bit debug adapters.
The updates in question are:
KB4487044 (Win10 ver 1809)
KB4487017 (Win10 ver 1803)
KB4486563 (Win7)
The reported behavior is that the debug adapters do not enumerate properly. Affected devices will not show up in the Windows Device Manager. Example bug reports are linked below.
1 2 3
If you are running into these issues you can try to roll back the above updates. However note that Microsoft places some restrictions on rolling back an update. For more information about rolling back a windows update and Microsoft's restrictions on uninstalling updates click the links below.
Windows Patching Information
Windows 10 Update FAQ
If you are able to roll back these updates but still experience issues, please submit a support ticket here.
Silicon Labs is in contact with Microsoft and we are working to resolve the issue. Updates will be posted here.
EFM8UB2 MODBUS example with UART.
I recently started with EFM8UB20F64G-B-QFP48R microcontroller. It seems to be a very powerful little thing.
I want to communicate with another microcontroller that i'am using right now, via MODBUS RTU. ( rs232 or 485 doesn't matter )
The EFM8UB2 will be a slave Modbus rs232 device. Its work is to be a some kind of I/O expander for my ESP32.
To be achive this, i want to use its UART peripherial to be able to communicate with multiple chips from the esp32.
Right now i'am using Simplicity IDE for programming the EFM8UB2. The esp32 side programming is happaning with Visual Studio Code and with Arduino framework.
So as you can see from that information, the C language is a bit tricky for me.
What i wanted to know is, are there any example code for Modbus rtu implementation in C language for the EFM8UB2 chip, or some another 8051 controller example.
I found an UART example in the Simplicity IDE for the EFM8UB2 controller. It is pretty straight forward.
But don't know how to proceed further, especially for MODBUS RTU. ( I have seen a dozen of videos from the modbus protocol so in theory i know how it works )
Any help would be much appreciated. ( Where should i start, maybe an example c modbus rtu uart code )
The datasheet for the EFM8UB20F64G-B-QFP48R controller is found here:
https://www.silabs.com/documents/public/data-sheets/efm8ub2-datasheet.pdf
Clock Stretching Between NACK and STOP Condition
I'm using EFM8LB12F32-B-QFN24
Slave : EFM8LB12F32-B-QFN24
Master : Raspberry Pi3
Clock : 400kHz
I know as NACK and Stop Condition are generated by MASTER Device.
Why does It occure the Clock Stretching between NACK and Stop Condition.
My ISR Code :
SI_INTERRUPT(SMBUS0_ISR, SMBUS0_IRQn)
{
static U8 SFRPAGE_save;
static U8 wr_check;
SFRPAGE_save = SFRPAGE;
SFRPAGE = 0x00;
if (SMB0CN0_ARBLOST == 0){
switch (SMB0CN0 & 0xF0){
case 0x20:
SMB0CN0_STA = 0;
i2c_ADD = SMB0DAT;
if(((i2c_ADD&0xFE) == 0xF0){
...... // if Read, Send Data
}else // NACK Recieved
{
SMB0CN0_ACK = 0;
SMB0CN0_SI = 0;
}
break;
...
EFM8LB laser bee ADC autoscan problems
Hi, I'm trying to use ADC autoscan (as per AN919) on a system where I've previously used non-autoscan conversions successfully. My basic requirement is to convert P1.2 through P1.5 every 2 msec (triggered by timer 4) with the best accuracy I can. The first problem I'm having is that I'm getting an ADC interrupt but my XDATA doesn't change. The ADC0 output SFR shows something, but nothing gets written to XDATA RAM. Where do I look?
My other specific questions are:
1. How do I force the alignment of my RAM array in XDATA to be word aligned? I tried __align(2) but the compiler chokes.
2. Does the ADRPT still work as I've been accumulating eight 12 bit conversions for lowest noise.
3. What do I set ADC0ASCT to? Is it 0 for 1 scan, 3 for 4 channels, 31 for 4 channels times 8 accumulations or something else?
Thanks in advance,
Oliver
Does the C8051F350 ADC have a sample and hold?
Hi everyone, I would like to use the C8051F350 as part of a battery powered weigh scale. The problem is that a strain gage needs a lot of current so I would like to switch it off and disconnect it from the ADC as fast as possible. I know that, for example, with a SAR ADC a sensor can be disconnected from the input as soon as the sample and hold circuit has acquired the signal but I am not sure if this is the case with the C8051F350 which has a Sigma Delta ADC. So the question is, do I have to keep the strain gage connected to ADC input during the complete conversion cycle (in my case around 100mS) or can I disconnect it at some point after conversion start. Thanks in advance!
SMBus reset options
Hello!
I'm using the SMBUS0 on a 8051F582 device, configured as master and using Timer1 for setting the SCL frequency.
If I want to generate a reset on the bus i.e. by pulling the SCL line low for >35 ms (that is what my slave specifies). What are my options?
1) Reconfigure the crossbar so I manually can set the SCL low? How do I do this without disturbing all my other interfaces (UART, CAN etc.)? What order do I need to set relevant register for a "glitch" free reconfiguration? My understanding is that it is always possible to read but not write to a pin if it is assigned by the crossbar to a resource.
2) The data sheet hints (page 246): "The SMBus interface is stalled while SI is set; thus SCL is held low, and the bus is stalled until software clears SI.". Perhaps I can manually set the SI bit in SMB0CN and with a separate "RESET" flag indicate that the ISR shall not clear the SI. Wait for 35 ms, clear the "RESET" flag and the SI bit. Any pitfalls in this logic?
3) Other ideas?
Thanks!
Issues with resets and/or debugger when disabling weak pull-ups (external pull-up implemented)
I have a custom board equipped with a 8051F582-IM, the implemented circuit for the C2 and RST interface is attached.
With the weak pull-ups activated (XBR2 = 0x40) there are no issues with debugging over C2 using the USB Debug Adapter.
With the weak pull-ups disabled (XBR2 = 0xC0) I have the following behaviour:
- If I set a break-point before my main-loop it (almost every time) re-triggers the same break-point, or with multiple break-points it "jumps" backwards as if the device did a reset.
- If setting a break-point inside the main loop (or no break-point at all), everything works fine. As well pausing and continuing execution works. Have had a program running for 2-3 hours now without an issue.
- The debugger seems to have more communication faults as well. Forcing me to un-powered it, and restating Simplicity Studio in order to get the debugger up and running again.
The PCB track for the C2 interface is no more than 20-25 mm with the pull-up located on the far side when seen from the MCU. The debugger connects to the PCB using its ribbon cable (C2D, C2CK and ground connected).
The code that is executed before the main loop is the initialisation of the device registers for XBAR configuration, SPI, interrupts, and Timer0, plus setting a digital out to low (not being the RST pin). VDD reset is disable.
Any ideas?
Edit: Corrected device type
Not able to receive data on uart1 c8051f020
Hi
I am trying to interface Uart1 in c8051f020. I am able to transmit data but not able to receive data. My configuration is as follows:
I am using external crystal of 22.1184 MHz for system clock.
USB HID device using c8051f340 having a problem in enumeration of device
Hi everyone,
Iam using c8051f340 hid firmware template for making a hid device. I had modified my report descriptor values as per my requirement and even changed vid, pid values. But my device is not recognised by pc and showing me this message
"THE LAST USB DEVICE YOU CONNECTED TO THIS COMPUTER MALFUNCTIONED AND WINDOWS DOESNOT RECOGNISE IT" and "DEVICE DESCRIPTOR REQUEST FAILED".
At first I thought it was pc problem and tried various methods to solve it and tried a usb monitoring software to know where the problem exists...I found a packet in which the device sent IN packet with vid is 0000 and pid 0002. Iam doubting that it is problem in communication. I entered correct descriptor values and checked twice.how to know where I did mistake .Im not getting any idea what is the problem...anyone gone through this problem before
Please help me
Development for EFM8SB with IAR Workbench
Dear Sir,
I am new to Simplicity Studio and do not have any experience with the development on Simplicity Studio.
Can I develop my code on IAR Workbench and port my 8051 hex Code output onto EFM8SB Developer kit, will it work.
I wish to quickly learn working on to Simplicity Studio, Please advice suitable help for the same.
Please advice.
Connection Problem of USB Debug Adapter with Simplicity Studio
Hello,
When I connected a USB debug adapter to target and PC, I received an error message as below:
I used the version of Simplicity Studio is SV4.1.11.7. I paste it below:
The 8 bits MCU i used is C8051F563-A_IM. Can you let me know how to solve it?
Thanks,
Hao
Interrupt in interrupt excecution
Hi all,
I'm using a C8051F124.
Is it possible to call an interrupt while an interrupt routine is already running?
I mean, my TMR2 is running with a low priority. When I excecute the TMR2 routine, the TMR0 flag, with an Higher priority, is fired.
Is the TMR2 routine skipped to excecute the TMR0 or the TMR0 ISR is only excecuted when the TMR2 ISR is finished?
Best Regards.
F930 RAM usage ?
My project is using UART and large data stream is coming in which needs to store for further processing. I need an array size of 1k to store all data.
Array should be located in Xdata space so the array is assigned as: unsigned char xdata myarray[1000];
I can compile it with no errors but program just halts immediately and does nothing at all.
I tried something like large memory model but no change. I use IDE from Silabs and Keil compiler.
How can i use the full RAM space of F930?
Im a weekend programmer and this might sound as a crazy question... :/
-J