Hello,
I am newbie in programming the microcontroller. I would like to test the micro by blinking the LED in a pin. The micro is SAMR35J18B and I am using ATMEL ICE programmer and ATMEL studio software for the programming. I am able to detect the micro in the software but I could not find proper program to blink the led. I tried few and did not work out. The pin PB02 is connected to LED through a transistor. I will attach the code which i used. Could someone tell me what is wrong with the program or please attach a link for a basic LED blink program. Thank you.
Moderator edit: code tags added like this [code]… your code …[/code]
I am newbie in programming the microcontroller. I would like to test the micro by blinking the LED in a pin. The micro is SAMR35J18B and I am using ATMEL ICE programmer and ATMEL studio software for the programming. I am able to detect the micro in the software but I could not find proper program to blink the led. I tried few and did not work out. The pin PB02 is connected to LED through a transistor. I will attach the code which i used. Could someone tell me what is wrong with the program or please attach a link for a basic LED blink program. Thank you.
C:
#include "sam.h"
int main(void)
{
unsigned int i;
/* Initialize the SAM system */
SystemInit();
REG_PORT_DIR0 |= 1<<2;
/* Replace with your application code */
while (1)
{
REG_PORT_OUTTGL0 = PORT_PB02;
re
for (i=0;i<100000;i++)
{
}
}
}
Last edited: