LED Blink on high input with custom board not working

Thread Starter

Avshi

Joined Jan 16, 2015
48
Hello, I made a custom board on which I am trying to get an LED to blink with atmel's ASF using a SAMS70J21 cortex m7 microcontroller. To no avail unfortunately. I tried stepping through while connecting to a 3.3V source, but it's still not clear to me why this is happening. I am connecting to the board via SWD through atmel studio (I tried uploading a binary through j-link commander). I am connected to physical pin 25 output and 26 input. The schematic and board layout are attached. Please let me know if I've forgotten any info.
Main:
Code:
    board_init();
    pio_set_output(PIOD, PIO_PD22, LOW, DISABLE,ENABLE);
    pio_set_input(PIOD, PIO_PD21, 0);
    // set PA13 as pulldown
    PIOA->PIO_PPDDR = PIO_PD21;
 
    while(1){
        int z = pio_get(PIOD,PIO_INPUT,PIO_PD21);
        if(z){
            pio_set_pin_high(PIO_PD22);
        }
        else
            pio_set_pin_low(PIO_PD22);
    }
 

Attachments

Last edited:
Top