n4alpaca
Newbie level 3
Hello, I've gone and borrowed the reference design for atmels SAMS70j21. My board is built from their application diagrams for this particular microcontroller. I've tried to upload an LED Blinky program I've written and it fails to blink my working LED (I've checked). I've checked the power source (working). All I have in the way of test equipment is a cheap multimeter.
I'm using Atmel studios with jlink and the code seems to upload no problem. All the wires and outputs are the right ones.
I've attached the schematic and physical layout in a PDF, i will attach the Gerbers of I'm asked.
Here is my code:
I'm using Atmel studios with jlink and the code seems to upload no problem. All the wires and outputs are the right ones.
I've attached the schematic and physical layout in a PDF, i will attach the Gerbers of I'm asked.
Here is my code:
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);
}