Close

How to blink your LED in simple way

A project log for Minimalist goes Atmel Smart D09

Now I would put one step forward to Atmel ARM series by very low price SAMD09

kodera2tkodera2t 06/10/2016 at 05:160 Comments

As I did it in AVR project, I always don't like putting something "unclear thing" between me and MCU. Ultimately machine code or assembly is ideal for this purpose and...

I bought several books but none of them shows me a straightforward guidance of my tiny SAMD09 board programming. Atmel seems to have a good support of their Xplained board series but nothing is clear for home-brew SAMD09 board.. (as far as I read and googled).

As a result, I read and find how to control PORT of SAMD09 at page 370 of SAMD09 data sheet and finally I could drive my board by own code, without any "unclear library". Here is the way...

Firstly we can make "new project" in Atmel Studio as "GCC Executable Project". NOT ASF (Atmel Software Framework) project.

Proudly we can choose "SAMD09" as device family and select the cheapest ARM chip, ATSAMD09C13A, HooHoo.

This is the default code made by above setting. Actually SystemInit() is a initialisation code and which is unclear but I dare to accept it.

We can write this very simple code driving LED connected to PA04 (14 Pin of SAMD09). REG_PORT_DIR0 defines data direction of GPIO port 4 (this case PA04 for output) and toggling port with interval defined by consuming time of empty loop of 100000.

Writing binary through ATmel ICE. Atmel ICE is indispensable for Atmel ARM and AVR!

Finally you will get LED blink by your own board and code. Currently 32.768kHz crystal is not activated and just SAMD09 with SOP-DIP conversion board is enough to fundamental check. Have fun!

Discussions