Stumped geezer on Stop3 power / QDn

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stumped geezer on Stop3 power / QDn

402 Views
CustomSarge
Contributor III

10+yrs in Freescale 908/9S08, but I'm stumped... Very simple ckt: 3 spst mom. sws, 1 IR LED. Using KBI on sws to exit Stop3, issue a pattern, reenter Stop3 . This all works fine. I know Stop works: STOPE(SOPT1)=0 gives an ILOP(illegal op code) reset.

 

Problem: power never <8.5-9.1mA in Stop. Tried 2 QD2s 1 QD4: same situ. Using default internal FEI clock, other clocking methods yield looping resets. Weird part: attached USB Multilink has power@ 8.5-9.1, target as standalone draws 14-16mA! This is by pulling USB off live, It won't run standalone from power cycle. Tried a different USB Intf: same situ.

 

Sure looks like I've got the clock wrong, but don't see where. Also, it consistantly starts running the code after a flash download, first time I've seen this. Is there a CW(6.3.1) patch for QDs' I'm missing?

 

Here's the sysreg inits (yes, I write asm)

_Startup:

        ldhx    #RAMEnd+1    
        txs
        lda     #$f2
        sta     SOPT1           ;enable STOP modes
        clra
        sta     SOPT2
        lda     #$00
        sta     ICSC1           ;internal ref clk
        lda     #$40
        sta     ICSC2           ;clk/2, FLL ena
        lda     #clktrm          ;=$7b
        sta     ICSTRM
        lda     #$00
        sta     SPMSC1          ;disable LVD
        lda     #$41
        sta     SPMSC2          ;LVD low trip, STOP3 mode

 

I don't understand the ICS module well, but defaults have historically been fine. What else could be wrong?

 Thanks in advance, Kevin Sargent

Labels (1)
0 Kudos
1 Reply

264 Views
bigmac
Specialist III

Hello Kevin,

 

Firstly, you appear to be attempting to enter Stop2 mode, rather than Stop3 mode.  This would require different wakeup handling, with the wakeup source limited to IRQ/Reset pin and the RTI module.  The KBI module is disabled.  However, this may not be the cause of your symptoms.


CustomSarge wrote:

Problem: power never <8.5-9.1mA in Stop. Tried 2 QD2s 1 QD4: same situ. Using default internal FEI clock, other clocking methods yield looping resets. Weird part: attached USB Multilink has power@ 8.5-9.1, target as standalone draws 14-16mA! This is by pulling USB off live, It won't run standalone from power cycle.


The FBI modes are likely of little use for your application, giving a bus frequency in the region of 16kHz.  An attempt ot use one of these modes could result in COP resets, if using the 1kHz source for the COP.  For the 'QD4, this leaves the FEI mode only.

 

You will need to elaborate on what you mean.  It is probable that you are not remaining in stop mode, perhaps due to an uncleared interrupt flag.  Maybe you could provide code showing how you enter stop mode (relative to the rest of the program), and also the stop mode exit process you are using.  Have you programmed the Reset and KBI vectors?

 

For stop3 mode only, the MCU will continue execution with the instruction immediately following the STOP instruction, after it has finished processing the KBI interrupt.

 

If your project requires an accurate bus frequency, you will need a calibrated trim value for each MCU.  With a POR trim setting of $80, the bus frequency will have unit-to-unit variation of about +/-25 percent.  Your fixed trim value would be subject to the same variation.  A non-volatile trim setting is programmed to a flash register, as part of the device programming procedure.  This value then needs to be loaded to ICSTRM register during MCU initialisation to achieve +/-2 percent calibration over voltage and temperature.

 

Regards,

Mac

 

0 Kudos