qe32 - ics

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

qe32 - ics

跳至解决方案
1,610 次查看
roberto_m
Contributor III

hi, I'm setting up qe32 clock. It is very difficult.

I have an external crystal wit 32768 kHz.

I need a 39.85 MHz DCOoutput and f_bus about 20 MHz.

I also use rtc => 2 s. interrupt. ( RTCSC  = 0x65;  RTCMOD = 0x03:smileywink:

Actually I use this procedure to setup the ICS:

 

   /* ICSC1: CLKS=0,RDIV=0,IREFS=0,IRCLKEN=1,IREFSTEN=1 */
  setReg8(ICSC1, 0x03);                /* Initialization of the ICS control register 1 */
  /* ICSC2: BDIV=0,RANGE=0,HGO=0,LP=0,EREFS=1,ERCLKEN=1,EREFSTEN=0 */
  setReg8(ICSC2, 0x06);                /* Initialization of the ICS control register 2 */
  while(!ICSSC_OSCINIT) {              /* Wait until the initialization of the external crystal oscillator is completed */
  }
  /* ICSSC: DRST_DRS=1,DMX32=1 */
  clrSetReg8Bits(ICSSC, 0x80, 0x60);   /* Initialization of the ICS status and control */
  while((ICSSC & 0xC0) != 0x40) {      /* Wait until the FLL switches to Mid range DCO mode */
  } 

 

If i am connect with bdm and I go in stopmode3, after resume I have a correct clock. If I disconnect the bdm, clock changes. Why? Where I am wrong?

Thank you.

Roberto.

标签 (1)
0 项奖励
回复
1 解答
1,352 次查看
roberto_m
Contributor III

Solved.

I forget to set EREFSTEN = 1. If this option is set, crystal, keeps going on, after mcu enters in stop mode.

Thank you bigmac.

Roberto 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,352 次查看
bigmac
Specialist III

Hello Roberto,

 

How do you ascertain that the bus frequency has altered when you remove the Multilink?  The bus frequency cannot be determined from the RTC module, since this makes use of the internal reference source.

 

It would be expected that the internal reference frequency will differ between BDM and normal operating mode.  But this would not affect the bus frequency for FEE mode.  An excerpt from the Reference manual:

 

ICS Trim Register (ICSTRM)

Note: TRIM is loaded during reset from a factory programmed location when not in BDM mode. If in a BDM

mode, a default value of 0x80 is loaded.

 

Regards,

Mac

 

0 项奖励
回复
1,352 次查看
roberto_m
Contributor III

Hi Bigmac.

 

I'm using a TPM module, and tpm overflow to genrate a clock on a pin (bus clock is the clock source for tpm, in my case). I made some calculus and set an appropriate "modulo". When I am in bdm mode the clock works as I expected. If I am not in bdm mode it doesn't work as I expected.

Roberto

0 项奖励
回复
1,352 次查看
roberto_m
Contributor III

If I use an external crystal as reference, why I have to set up the trim?

Thank you.

0 项奖励
回复
1,353 次查看
roberto_m
Contributor III

Solved.

I forget to set EREFSTEN = 1. If this option is set, crystal, keeps going on, after mcu enters in stop mode.

Thank you bigmac.

Roberto 

0 项奖励
回复