problem with internal oscillator

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

problem with internal oscillator

1,683 次查看
Daxx
Contributor I
Hi everybody!
 
I have a problem with the internal oscilator, I've tried to change the value of the bus frecuency using the value of the OSCTRIM register, but nothing happened. Here is some code:
 
 
 MOV   #1,CONFIG1
            MOV   #-1,OSCTRIM
            LDA   #-1
herei:   DBNZA here
 
The delay is for wait establishment of the internal oscillator.
 
am I doing something wrong?
 
do you really think that I can trust in the internal oscillator?
 
I'm using Code Warrior V 5 and a microcontroller of Q family.
 
标签 (1)
0 项奖励
回复
3 回复数

669 次查看
bigmac
Specialist III
Hello Daxx,
 
For the QT/QY series, the trim value to be written to the OSCTRIM register will be found at the flash location $FFC0, unless it has been erased (a value of $FF).  You appear to be writing a constant value of $FF (= -1) to the register, which would be an extremity of the adjustment range.  The centre value of the adjustment range is $80.
 
The following code snippet would be more typical of the trim adjustment process, usually done during initialisation, where
TRIMVAL   EQU    $FFC0
 
 
         LDA    TRIMVAL
         CMP    #$FF           ; Test for unprogrammed value
         BNE    ST2            ; Branch if programmed
         LDA    #$80           ; Nominal default trim value
ST2:     STA    OSCTRIM
 
On power-up the MCU will default to the internal oscillator, so there is no need for any stabilization delay.
 
Regards,
Mac
 
0 项奖励
回复

669 次查看
Daxx
Contributor I
hi bigmac, thanks for answer to my cuestion.
 
0 项奖励
回复

669 次查看
Daxx
Contributor I
Sorry, the "i" in label "herei", does not suppose to be there
0 项奖励
回复