Stopping the DSTwo CPU?

Discussion in 'Supercard SDK' started by spinal_cord, Jan 7, 2011.

  1. spinal_cord
    OP

    spinal_cord Knows his stuff

    Member
    3,010
    580
    Jul 21, 2007
    somewhere
    Is it possible to stop/start the DSTwo CPU at all? I was thinking it would be useful in certain circumstances when there is nothing happening, like in a text reader of image viewer, so that less power is being used.
     
  2. Schicksalsheld

    Schicksalsheld GBAtemp Regular

    Member
    118
    1
    Aug 29, 2009
    Gambia, The
    So far as i know, the CPU must run ever, you could underclock it or use the lowest Mode.
     
  3. DSman59

    DSman59 Member

    Newcomer
    42
    1
    Aug 8, 2009
    Riga
    I guess if the CPU was stopped when using DSTwo plug-ins, then they would hang up so it must work all the time.
     
  4. Pate

    Pate GBAtemp Regular

    Member
    108
    22
    Dec 23, 2010
    Finland
    Well, you could experiment what happens with the MIPS32 "WAIT" opcode, but it is likely that the DSTwo interface hangs if you do that.

    I plan to test this at some point, but feel free to try yourself first. :-)

    Pate
     
  5. loby

    loby Newbie

    Newcomer
    9
    2
    Dec 17, 2010
    Switzerland
  6. Pate

    Pate GBAtemp Regular

    Member
    108
    22
    Dec 23, 2010
    Finland
    Ok, thanks! I'm just wondering why do they have to make things so difficult, couldn't they just have shown a small source snippet that would do that?

    I dumped the library and tried to decipher it, this is what I came up with:

    CODE00000000 :
    ÂÂ 0:ÂÂÂÂ3c05b000 ÂÂÂÂluiÂÂÂÂa1,0xb000
    ÂÂ 4:ÂÂÂÂ3c04b301 ÂÂÂÂluiÂÂÂÂa0,0xb301
    ÂÂ 8:ÂÂÂÂ34a60010 ÂÂÂÂoriÂÂÂÂa2,a1,0x10
    ÂÂ c:ÂÂÂÂ34840080 ÂÂÂÂoriÂÂÂÂa0,a0,0x80
    ÂÂ10:ÂÂÂÂ8cc70000 ÂÂÂÂlwÂÂÂÂa3,0(a2)ÂÂÂÂÂÂÂÂorig_CPM_CPPCR = CPM_CPPCR; (Power Control Register?)
    ÂÂ14:ÂÂÂÂ8c880000 ÂÂÂÂlwÂÂÂÂt0,0(a0)ÂÂÂÂÂÂÂÂorig_EMC_DMCR = EMC_DMCR; (DRAM Control Register)
    ÂÂ18:ÂÂÂÂ3c020200 ÂÂÂÂluiÂÂÂÂv0,0x200
    ÂÂ1c:ÂÂÂÂ01021025 ÂÂÂÂorÂÂÂÂv0,t0,v0
    ÂÂ20:ÂÂÂÂac820000 ÂÂÂÂswÂÂÂÂv0,0(a0)ÂÂÂÂÂÂÂÂEMC_DMCR = orig_EMC_DMCR | 0x02000000;
    ÂÂ24:ÂÂÂÂ34a50004 ÂÂÂÂoriÂÂÂÂa1,a1,0x4
    ÂÂ28:ÂÂÂÂ24020004 ÂÂÂÂliÂÂÂÂv0,4
    ÂÂ2c:ÂÂÂÂ34e30200 ÂÂÂÂoriÂÂÂÂv1,a3,0x200
    ÂÂ30:ÂÂÂÂacc30000 ÂÂÂÂswÂÂÂÂv1,0(a2)ÂÂÂÂÂÂÂÂCPM_CPPCR = orig_CPM_CPPCR | 0x0200;
    ÂÂ34:ÂÂÂÂaca20000 ÂÂÂÂswÂÂÂÂv0,0(a1)ÂÂÂÂÂÂÂÂCPM_LCR = 4;
    ÂÂ38:ÂÂÂÂacc70000 ÂÂÂÂswÂÂÂÂa3,0(a2)ÂÂÂÂÂÂÂÂCPM_CPPCR = orig_CPM_CPPR;
    ÂÂ3c:ÂÂÂÂac880000 ÂÂÂÂswÂÂÂÂt0,0(a0)ÂÂÂÂÂÂÂÂEMC_DMCR = orig_EMC_DMCR;
    ÂÂ40:ÂÂÂÂ03e00008 ÂÂÂÂjrÂÂÂÂra
    ÂÂ44:ÂÂÂÂ00000000 ÂÂÂÂnop

    The register names are from JZ4740.h, I haven't looked at the data sheets to see what exactly those registers do.

    Pate
     
  7. spinal_cord
    OP

    spinal_cord Knows his stuff

    Member
    3,010
    580
    Jul 21, 2007
    somewhere
    according to the note in tcm.h it seems that it only idles until the next second. does that mean that the DStwo would be continuously ramping between 0 and [enter current clock setting here] and back again, I always thought doing that sort of thing used up more power than just leaving it switched on?