Youngsik Kim - fabacademy 2018
home about assignments finalproject

| Week8 | Week10 |

Week9. Embedded Programming

assignment

group assignment:

compare the performance and development workflows
for other architectures

individual assignment:

read a microcontroller data sheet
program your board to do something,
with as many different programming languages
and programming environments as possible

1. compare performance for other architectures

compare_architecture

2. compare development workflows for other architectures

- PIC microcontroller

The Microchip produce PIC microcontrollers. I was search toolchain about PIC.
There are several compiler for architectures. They can be plug-in to MPLAB X IDE.
Also there are several programmers, but I think PICkit3 is resonable choice for current.

- atmel microcontroller

The Atmel microcontroller is well known as Atmega series, now the company merged to Microchip.
Anyway AtmelStudio IDE tool is well developed, so now, possible to integrate ARM core based MCU
also, many engineer made isp hardwares so even it is possible fabisp integrate.(I'm so exiting!)

- ARM microcontroller

In this fields,I thought about professional area compare than other architectures.
But, I find some possibilities to take in to this which is relate to GCC C compiler plus
Advanced Software Framework (ASF) helping with library to make coding easy.

3. read a microcontroller data sheet

I read about datasheets for two devices. One is Attiny45 series the other is Atmega328P.
Here are some reviews.
• Attiny25/45/85
-datasheet:download site
This device named as flash memory size such as if 2KB version call to Attiny25 and if 4KB call to Attiny45.
It has 6 programmable I/O pin, some pin function is 8-bit Timer/Counter, ADC resolution is 10-bit scale.
Also two pins are can be programmable gain(1x, 20x) controlled ADC function. Its clock range is depends on
operating voltage, if low-power(1.8V ~) applied version (Attiny25V/45V/85V) can be operate 0 to 4Mhz.
For the high frequency(20Mhz) application choose that Attiny25/45/85.
Low power model(such as Attiny45V) can take only 0.1uA at 1.8V while sleep mode.

• Atmega328P
-datasheet:download site
This device has a RISC architecture and single cycle instruction execution. The flash memory size is 32KB.
Its Pin configuration range from 28 ~ 32pins depends on package style included 26 programmable IO pins.
For the communication, these pins act as 2-ports for SPI, 1-port as H/W serial, 1-port as S/W serial
and 1-byte based 2-wire serial(Philips I2C compatible). Operating voltage can be start at 1.8V in this voltage
power consumption is 0.1A in power down mode (0.75A if 32K RTC operated).
ADC or extra I/O functions are same as attiny25 series.

4. program your board to do something

4-1. make a target board

I was choose FabKit version 0.4.
download:(copied from archive 2016 : eagle cad)
- schematic file : fabkit_v0.4.sch
- pcb file : fabkit_v0.4.brd
but it makes error in trace mill.

compare_architecture

At that moment, I was thought a lot of about process, and find what is wrong.
In archive information of fabacademy 2016, above design fit some high resolution machine more then 0.4mm of SRM-20.
So, I did redesign and made fix paths during several fabmodules work. Most worked in paint program of Windows10.

compare_architecture

here my revision files
- trace file : fabkit_v0.4R_traces.png
- hole file : fabkit_v0.4_holes.png
- cut file : fabkit_v0.4_cut.png
- bom :

fabkit_bom

make pcb board and assembly

rev_pcb rev_pcb

4-2. C-code on arduinoIDE1.8.5

hello-world board : switch activity, press button -> on, release button -> off
rev_pcb rev_pcb rev_pcb

fabkit-0.4R board : LED blink

rev_pcb
rev_pcb rev_pcb

4-3. C-code on AtmelStudio7

- how to use fabisp in AtmelStudio7

Here I started to find FabISP on Windows Device Manager.(altanate to upgrade drive)

rev_pcb

And make sure driver set to libusb-win32(c1.2.6.0) in Zadig software.
rev_pcb
and check over connected target board(I used hello-world board, select Attiny44 mcu.) rev_pcb

And pre-install to AtmelStudio7, then open the program goto Tools / External Tools.
Add new tool(i.e. usbtinySPI isp device plus connected mcu(ATtiny44) of targetboard(Hello-world board)).
argument set :
- Title : USBTiny ATtiny44 (custom device name)
- Command : C:\avrdude\avrdude.exe (avrdude program location)
- Arguments : -c usbtiny -p t44 -v -v -v -U flash:w:$(TargetDir)$(TargetName).hex:i (t44 : mcu of target board)
- Initial directory : C:\avrdude\(avrdude program directory)

rev_pcb rev_pcb

After this, simply select Tools/USBTiny ATtiny44 menu to upload with compiled code.

- making project and download to fabkit 0.4(Young pattern).

To make new project, select File/New/Project, check GCC C Executable Project and fill out other description.
Then press OK button goto new editor screen to coding. Code work done and build it. And select Tool/USBTiny ATtiny44 menu
to uploading.

rev_pcb rev_pcb

rev_pcb

Here is result to output file.

rev_pcb

Working program

code download:
-Arduino code(IDE ver 1.8.5) : fabkit_Blink.ino
-gcc code(in AtmelStudio7 IDE) :main.c

| Week8 | Week10 |