Shop OBEX P1 Docs P2 Docs Learn Events
Reset Hydra from code? — Parallax Forums

Reset Hydra from code?

KeeblerKeebler Posts: 58
edited 2007-06-02 07:55 in Propeller 1
What's the simplest way to reboot the Hydra from code?·· I'd like to add an option in HAM to reboot after upload.
I see something about the CLK register (bit 7), I also see something about restarting Cog 0.·

Does anyone have a code snippet to share ?· [noparse]:)[/noparse]

Thanks,
Rich

Comments

  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-05-29 10:42
    What code, where?

    From Spin:
    REBOOT

    From ASM (I would think but haven't tried):
    mov CLK #$80

    But do you mean from the PC end of the USB connection?
  • KeeblerKeebler Posts: 58
    edited 2007-05-29 17:54
    CardboardGuru said...
    What code, where?

    From Spin:
    REBOOT

    From ASM (I would think but haven't tried):
    mov CLK #$80

    But do you mean from the PC end of the USB connection?

    Cool, thanks. I just wanted to see what was the most reliable mechanism and which method people are using most in practice.
    That being said, it would be good to know how to do it over USB if it's even possible.

    Rich
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-29 17:56
    From the PC end of the USB connection, you can close and re-open the serial port. If you have access to controlling the DTR control line, you could just toggle that. The DTR line is used to generate a reset pulse for programming purposes.
  • KeeblerKeebler Posts: 58
    edited 2007-05-29 19:12
    Mike Green said...
    From the PC end of the USB connection, you can close and re-open the serial port. If you have access to controlling the DTR control line, you could just toggle that. The DTR line is used to generate a reset pulse for programming purposes.


    I tried toggling the DTR with Jasper's Booter API but that didn't cause the Hydra to reboot. Isn't that more of an indicator to the propellor that programming is starting?

    Thanks,
    Rich
  • AndreLAndreL Posts: 1,004
    edited 2007-05-30 06:38
    DTR is connected to the reset line on the propeller, so it will reset the propeller which will cause an entire chip restart.

    Andre'
  • KeeblerKeebler Posts: 58
    edited 2007-06-02 07:55
    AndreL said...
    DTR is connected to the reset line on the propeller, so it will reset the propeller which will cause an entire chip restart.

    Andre'
    I just figured it out.· Jasper's Booter API call, ResetPropellor()·doesn't open the serial port [noparse]:)[/noparse]··
    I modified his function and it works fine now.

    Now, I·have H.A.M.·auto rebooting after uploading to the·Hydra. ·[noparse]:)[/noparse]

    Rich
Sign In or Register to comment.