Author Topic: EFM8 Development and Usage  (Read 1450 times)

0 Members and 4 Guests are viewing this topic.

Offline BrianfTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
EFM8 Development and Usage
« on: November 21, 2022, 10:50:03 am »
This is a question(s) for people with real-world experience of EFM8s.

1) Development Environment - It looks like, other than going command line assembler, it's SDCC or Simplicity Studio. What are they like to use?

2) The '51 core - the '51 series was the first uC I used so I'm very familiar with the core and it's instruction set. But what's it like when wrapped inside an EFM8?

3) Peripherals - what are the peripherals like? Some are obviously based on the original '51 peripherals but how about the new ones?
 

Offline globoy

  • Regular Contributor
  • *
  • Posts: 211
  • Country: us
Re: EFM8 Development and Usage
« Reply #1 on: November 21, 2022, 05:56:59 pm »
I've used 3 EFM8 parts (EFM8SB1X, EFM8SB2X and EFM8BB2X) and I used SDCC with the Nordic NRF24LE1 in commercially shipping products.  I used SDCC because I didn't want to shell out for the Keil compiler.  TL;DR; I like the parts because they have a decent feature set at a good price (although recently subject to availability issues) for the class of problems they fit (e.g. relatively simple or low-end embedded systems).

I think your questions are a little subjective but I can share my experience.

Quote
1) Development Environment - It looks like, other than going command line assembler, it's SDCC or Simplicity Studio. What are they like to use?

I use Simplicity Studio with the Silicon Labs parts.  It's ok.  A big, bloated IDE like so many others but it gets the job done.  The editor is reasonable.  The debugger is ok (I only say ok because it has problems with things like sleep).  They have some tools to help you characterize power.  They have a configuration tool that can generate start-up code and even handle things like generating code to help you transition between different states (e.g. Sleep and Run, etc).  Take care to really understand what it is generating though as it's pretty literal and you need to be explicit when you're trying to do things like absolutely minimize power consumption.  Also you have to explicitly set the memory model in the project setup and be aware of where your variables are going since the 8051 has three different memory models, each with different performance characteristics.  All my code is C.  I have never had to drop into assembly for anything with the Silicon Labs parts.

I really enjoyed using SDCC with the Nordic part.  I had a simple makefile-based build system and used different editors (vi and bbedit on Mac) for code editing.  I felt very close to the hardware (it helps that the Nordic chip is pretty simple).  There are some syntactical differences with the Keil-based compiler that you need to be aware of (they do a good job documenting those).  I did spend some time understanding what code the compiler would generate for optimization purposes.  In the end I felt I could generate really performant code in C using SDCC although I did a few parts of some code in assembly because I needed sub-microsecond control of IO.

Quote
2) The '51 core - the '51 series was the first uC I used so I'm very familiar with the core and it's instruction set. But what's it like when wrapped inside an EFM8?

I never used the original 8051 stuff but it looks like it's all pretty much there with additional timers, built-in extended memory and additional peripherals.  I guess the modern 8051 cores are much faster, executing instructions in 1, 2 or 3 cycles mostly (so you'll want to review that probably).

Documentation is pretty good.  You'll be reading both the part spec for things like electrical characteristics and the reference manual for part operation (and peripheral programming/configuration).  Be sure to read the errata.  They seem to fix many things in subsequent revs but they do let some big bugs remain (see below for my I2C issue).

Quote
3) Peripherals - what are the peripherals like? Some are obviously based on the original '51 peripherals but how about the new ones?

I think the peripherals are typical of 8-bit devices.  Mostly pretty simple register based control and controlled by code (as opposed to things like DMA engines).  The additional timers have more modes.  IIRC, I've used serial, I2C (master and slave), ADC, PWM, RTC, Flash programming, watchdog.

The I2C slave on the EFM8SB20 is busted.  It can stomp on other I2C transactions.  They document (and I use) a work-around that involves using one of the timers and that seems to work but it's ugly.  I've not been bit by any other hardware issues.

I tend to write my own drivers for simple peripherals like these.  Silicon Labs provides example code for each peripheral and maybe a library but I never found the library functions really what I wanted and it's simple enough to read the example code, the manual and write your own.


Overall I've had success with these parts.  I think like any family of parts there's a learning curve to climb.  I have had success in re-using code between projects which has made me more productive.  I've found, like a lot of developers, that once you climb that learning curve then you're more likely to use the same family for future products.  So it's always worth a bit of research as you're doing to decide on what family you want to spend your time.

Silicon Labs provides cheap dev boards if you want to get your feet wet.  Clearly they're subsidizing these boards because they come with complex supporting circuitry including power monitoring that can work at uA and mA levels so you can profile power usage in Simplicity Studio.
 

Offline globoy

  • Regular Contributor
  • *
  • Posts: 211
  • Country: us
Re: EFM8 Development and Usage
« Reply #2 on: November 21, 2022, 06:01:15 pm »
Also the EFM8 parts have this IO matrix that is used to map peripherals to GPIO and although you can directly program it, the configurator tool makes that easier (and deals with the limitations in the matrix for you so you don't have to think about them).
 

Online voltsandjolts

  • Supporter
  • ****
  • Posts: 2358
  • Country: gb
Re: EFM8 Development and Usage
« Reply #3 on: November 21, 2022, 06:29:22 pm »
From the website:

FREE KeilĀ® PK51 Developer's Kit Available for Silicon Labs' 8-bit MCUs and Studio.

Silicon Labs now offers a free version of the Keil PK51 Professional Developer's Kit, including the compiler/linker/assembler for use with Silicon Labs' 8-bit microcontrollers and Studio. This free tool comes without a time or code size limit!

https://pages.silabs.com/lp-keil-pk51.html
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1691
  • Country: au
Re: EFM8 Development and Usage
« Reply #4 on: November 22, 2022, 05:37:46 am »
This is a question(s) for people with real-world experience of EFM8s.

1) Development Environment - It looks like, other than going command line assembler, it's SDCC or Simplicity Studio. What are they like to use?
HEX and OMF51 files can be generated by any C51 toolchain.
Simplicity Studio naturally focuses on their inbuilt Keil C, as that's what SiLabs test with, but you can manually point the Debug/Download to any OMF51 file
You can download either HEX or OMF51, but probably want to use OMF51 as that has the filenames and line numbers and symbol info.


2) The '51 core - the '51 series was the first uC I used so I'm very familiar with the core and it's instruction set. But what's it like when wrapped inside an EFM8?
The opcodes are identical, but the MHz and timings differ from classic C51.

Parts like EFM8BB52 run up to 50MHz and execute pretty much at 1 Sysclk per byte, provided code runs 'in a straight line'.
Jumps complicate things a bit, as does code alignment and prefetch/wait settings.
If ns precision timing matters, you may want to experiment with ASM and ALIGN statements..


3) Peripherals - what are the peripherals like? Some are obviously based on the original '51 peripherals but how about the new ones?
Mostly, they are supersets.

The UART has a better BAUD design, supporting SysCLK/2/N and FIFOs
 

Offline BrianfTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
Re: EFM8 Development and Usage
« Reply #5 on: November 22, 2022, 09:24:52 am »
Thanks for all the replies, I'll have a good careful read.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4245
  • Country: us
Re: EFM8 Development and Usage
« Reply #6 on: November 22, 2022, 09:43:28 am »
Do the modern 8051s with all sorts of added peripherals manage to fit all the SFRs into the 128bytes allocated in the original 8051 architecture (that must be fun!), or do they use some sort of other scheme for accessing more registers?
 

Online wraper

  • Supporter
  • ****
  • Posts: 17350
  • Country: lv
Re: EFM8 Development and Usage
« Reply #7 on: November 22, 2022, 09:58:35 am »
I used SDCC because I didn't want to shell out for the Keil compiler.
Silabs gave free license since at least 2015 when I started using silabs MCUs.
 

Offline BrianfTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
Re: EFM8 Development and Usage
« Reply #8 on: November 22, 2022, 04:31:20 pm »
Do the modern 8051s with all sorts of added peripherals manage to fit all the SFRs into the 128bytes allocated in the original 8051 architecture (that must be fun!), or do they use some sort of other scheme for accessing more registers?

It looks like they use a paging scheme to swap in different sets of peripheral registers into the upper 128 bytes, with some registers appearing in multiple pages.
 

Offline globoy

  • Regular Contributor
  • *
  • Posts: 211
  • Country: us
Re: EFM8 Development and Usage
« Reply #9 on: November 22, 2022, 05:37:41 pm »
I used SDCC because I didn't want to shell out for the Keil compiler.
Silabs gave free license since at least 2015 when I started using silabs MCUs.

I must not have been clear enough.  This was years ago when I wanted to program the Nordic chip.  They didn't give away the Keil compiler for free.  The silicon labs parts have a free compiler (as I've been using it for years...)
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1691
  • Country: au
Re: EFM8 Development and Usage
« Reply #10 on: November 22, 2022, 07:40:02 pm »
Do the modern 8051s with all sorts of added peripherals manage to fit all the SFRs into the 128bytes allocated in the original 8051 architecture (that must be fun!), or do they use some sort of other scheme for accessing more registers?

Good point.
SiLabs use SFR paging, but they do have an option where the interrupts select the right page for that interrupts peripherals.
'Wrong page' bugs are common.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf