Eugenio Mendez


Discussion created by Eugenio Mendez on Jan 3, 2008
Latest reply on Jan 4, 2008 by Eugenio Mendez
Í'm testing a 9S08QG8 by first time  with a 4MHz oscillator in FBE mode.
On Data sheet  and other freescale documents
fbus=(fext*1/BDIV)/2  = 1/tcyc    where tcyc is time machine cycle 
I used BDIV=1 ==> divide by 2
Then fbus=4MHz/4=1MHz ==> tcyc=1us      
I tryed to check this,  generating a square wave with
C code                                                                            Assembler code
for(;:smileywink:   {      PTBD_PTBD2=1;                                                     44:       PTBD_PTBD2=1;                                                                                       0014    1400    BSET  2,_PTBD          //2 cycles      _asm NOP                                                                45:       _asm NOP                                                                                       0016     9d       NOP                              //1 cycle      PTBD_PTBD2=0;                                                     46:       PTBD_PTBD2=0;                                                                                       0017    1500     BCLR  2,_PTBD          //2 cycles     _asm NOP                                                                 47:      _asm NOP                                                                                        0019    9d         NOP                            //1 cycle  
   __RESET_WATCHDOG(); // feeds the dog   } // loop forever 
If tcyc is  1 us I would have to obtain a 3 us period square wave but I obtain a 6 us period.
Maybe fext is fcrystal/2 and this information is not well documented or tcyc is not 1/fbus.
Maybe some of you with more experience have a response.
I regulary use 9S12,  GP32 and QT2 MCUs and I never had this discrepancy.
Best Regard