Shop OBEX P1 Docs P2 Docs Learn Events
Reset in assembly — Parallax Forums

Reset in assembly

steprogsteprog Posts: 227
edited 2010-07-26 10:34 in Propeller 1
Hi Guys,
I was looking for a reset command in assembly and much to my surprise I didn't find one.· Isn't there a way to reset the processor with a command?
Thanks,
Greg

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2010-07-26 08:21
    Write a value to the clock register with bit 7 set, e.g.
    long    $0C7C0080 | $ << 9    'clkset  $, src set to $80
    
  • steprogsteprog Posts: 227
    edited 2010-07-26 09:13
    Hi kutonrko,
    Interesting if not a bit cryptic. It looks like a long definition instead of an assembly instruction but I will give it a try
    Thanks,
    Greg
  • kuronekokuroneko Posts: 3,623
    edited 2010-07-26 09:19
    steprog said...
    It looks like a long definition instead of an assembly instruction ...
    What's the difference? [noparse]:)[/noparse]
  • steprogsteprog Posts: 227
    edited 2010-07-26 09:23
    I guess I don't understand. I tried it as an instruction and it rejected it. I'm afraid I'm not that sharp at this yet.
    Greg
  • heaterheater Posts: 3,370
    edited 2010-07-26 09:48
    I have never tried this but I think you need to use the CLKSET instruction froom PASM

    DAT
            .
            .
            .
            clkset mode
            .
            .
    mode long $80
    
    



    This takes two longs because you need one for the instruction and one for the location the destination field in the instruction addresses to get the mode field.

    From the manual:

    CLKSET Mode
    • Mode (d-field) is the register containing the 8-bit pattern to write to the CLK register.

    So we see kuroneko is now trying squeeze this to one long by using the clkset instruction itself as it's own destination register with the reset bit (bit 7) set in the source field of the instruction.

    Compiles OK for me using the BST Propeller tool.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.

    Post Edited (heater) : 7/26/2010 9:53:13 AM GMT
  • steprogsteprog Posts: 227
    edited 2010-07-26 10:34
    Thanks for that I will give it a try tomorrow.
    Greg
Sign In or Register to comment.