ATXmega Software Reset

Gast #2290758
Lesenswert?

Habe den Beitrag gefunden da ich das gleiche Problem hatte. Ja ich weiß, 
dass der Beitrag nicht aktuell ist. Trotzdem möchte ich für nachfolgende 
Sucher die Lösung (für mich) geben:

Manual (8077H- AVR-12/09) S. 109 sagt:

>>When this bit is set, a Software reset will occur. The bit is cleared when a 
reset is issued. This bit
is protected by the Configuration Change Protection, for details refer 
to Section 3.12 ”Configuration
Change Protection” on page 12.<<

manual S. 12: lest selbst! ;-)

C-Code für den Software-Reset:

    // ::::::::::::::::::::::::::::::::::::::::::::::::
    // CCP: Configuration Change Protection
    // ::::::::::::::::::::::::::::::::::::::::::::::::
    //for general: ref manual p. 12 (3.12)
    //ref manual p. 13 (3.14.1)
    //CCP - Configuration Change Protection Register
    //IOREG: Protected IO register
    //
    //enabling to write into protectet area
    CCP = CCP_IOREG_gc;
    //All interrupts are ignored during the next 4 CPU
    //instruction cycles from now


    //CTRL bit is protected by Configuration Change Protection
    //Software-Reset ausführen (bit0 setzen)
    //see manual p. 109 (9.5.2: CTRL - Reset Control Register)
    RST.CTRL =  RST_SWRST_bm;

Viel Erfolg!

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren