SAM3x8E periodical reset

Discussion in 'UDOO QUAD' started by mihai.pop1993, May 19, 2016.

  1. mihai.pop1993

    mihai.pop1993 New Member

    Joined:
    May 12, 2016
    Messages:
    2
    Likes Received:
    0
    Hello,

    I am currently programming the SAM3x8E from an external PC using Atmel Studio. From unknown reasons, at every ~18 seconds, the microcontroller resets.

    The code(reduced to the minimum for test purposes) is this:
    Code:
    #define F_CPU 84000000L
    #include "sam.h"
    static void pinInit(){
        // Set pin 11[D7] as output for test LED
        PIOD -> PIO_PER |= PIO_PD7; // PIO_PER = PIO enable register
        PIOD -> PIO_OER |= PIO_PD7; // PIO_OER = Output Enable Register
        PIOD -> PIO_PUDR |= PIO_PD7; // Enable pull-up on pin D7
    }
    int main(void)
    {
        /* Initialize the SAM system */
        SystemInit();
        pinInit();
     
        PIOD->PIO_SODR = PIO_PD7;
        while (1)
        {
          
        }
    }
    
    Does anybody have an idea about what is happening?
     

    Attached Files:

    Last edited by a moderator: May 19, 2016
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
  3. mihai.pop1993

    mihai.pop1993 New Member

    Joined:
    May 12, 2016
    Messages:
    2
    Likes Received:
    0
    I figured out that if I completely disable the watchdog it won't reset any more. Though this is not a normal behavior unless the watchdog is already set.
     
  4. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Does this mean that you have to disable the watchdog to make it work normally?
     

Share This Page