Reply
Posts: 2
Registered: ‎08-31-2017
Accepted Solution

EFM8BB3 oscillator initialisation problems

Hi,

I have a custom design, connected with USB-C2D at Silabs IDE, part number of the cpu is EFM8BB31F64G. I cannot initialize and switch to 49mhz clock.

My code after reset contains initialisation of SFRPAGE, SP and disable WDT:

First try was with:

 

MOV CLKSEL,#000H ;use hfosc0, divided by 1
BTLD_WFDIVRDY1: MOV A,CLKSEL  ;wait clock to propagate
JNB ACC.7,BTLD_WFDIVRDY1


MOV CLKSEL,#003H ; switch to hfosc1 div 1. When I execute step by step, after this instruction, the debugger hangs and the IDE becomes unresponsive, eventually it gives a disconnect message
BTLD_WFDIVRDY2: MOV A,CLKSEL ;wait for clock to propatate
JNB ACC.7,BTLD_WFDIVRDY2

 

I also tried to manually start both oscillators and leave them a delay to stabilize, before switching

the clock:

MOV SFRPAGE,#PG2_PAGE //(0x10)
MOV HFOCN,#088H

MOV SFRPAGE,#LEGACY_PAGE //(0x00)
CALL BTLD_DELAY100US

 

Other code sequences works fine with clock on hfosc0.

Am I doing something wrong? Thank you.

Posts: 2
Registered: ‎08-31-2017

Re: EFM8BB3 oscillator initialisation problems

Problem solved, the PFE0CN must be set to sysclk<50mhz before changing clock.

Posts: 339
Registered: ‎09-22-2009

Re: EFM8BB3 oscillator initialisation problems

Good job! I'm marking your replace as the solution to this problem.