Stopping the DSTwo CPU?

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

Jan 7, 2011

Stopping the DSTwo CPU? by spinal_cord at 3:50 PM (4,389 Views / 0 Likes) 6 replies

  1. spinal_cord
    OP

    Member spinal_cord Knows his stuff

    Joined:
    Jul 21, 2007
    Messages:
    2,871
    Location:
    somewhere
    Country:
    United Kingdom
    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

    Member Schicksalsheld GBAtemp Regular

    Joined:
    Aug 29, 2009
    Messages:
    118
    Country:
    Germany
    So far as i know, the CPU must run ever, you could underclock it or use the lowest Mode.
     
  3. DSman59

    Newcomer DSman59 Member

    Joined:
    Aug 8, 2009
    Messages:
    42
    Location:
    Riga
    Country:
    Latvia
    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

    Member Pate GBAtemp Regular

    Joined:
    Dec 23, 2010
    Messages:
    108
    Country:
    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

    Newcomer loby Newbie

    Joined:
    Dec 17, 2010
    Messages:
    9
    Country:
    China
  6. Pate

    Member Pate GBAtemp Regular

    Joined:
    Dec 23, 2010
    Messages:
    108
    Country:
    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

    Member spinal_cord Knows his stuff

    Joined:
    Jul 21, 2007
    Messages:
    2,871
    Location:
    somewhere
    Country:
    United Kingdom
    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?
     

Share This Page