EMBEDDED PROGRAMMING

WEEK 08

Task:

  • Read a microcontroller data sheet
  • Program your board to do something, with as many different programming languages and programming environments as possible

DATASHEET

  • ATtmega 328 SMD

Download data sheet

 

Atttiny 328

  •  Pin Descriptions executes powerful instructions in a single clock cycle.
  • VCC: supply voltage
  • GND: ground
  • Port B: Bi-directional Input/Output Ports, PB3 has a reset capability
  • Reset: reset microcontroller
  • Port A: Bi-directional Input/Output Ports

 

Relevant information:

  • The ATtiny 328 has 6 PWM pins and 9 analog pins, so this microcontroller can flash almost 6 output devices with an external power supply and 9 inputs.
  • The microprocessor 328 is similar to arduino microprocessor as can flash the same codes
  • Power Supply: supports form 3.3v up to 12v
  •  

Concepts

  • avrispMKII: programmer/flash
  • bit binary digit
  • ide integrated development environment
  • GPRS general packet radio service
  • CPU central processing unit
  • ALU arithmetic logic unit
  • ADC analog to digital converter
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • MISO: multiple input single output
  • FTDI cable: power supply
  • FABSIP: progrramer / flash

Analog signal

An analog signal is a voltage or current which varies smoothly and continuously . A sine wave is an analog signal of a single frequency. Voltages voice and video are analog signals that vary according to the sound or variations of light corresponding to the information being transmitted .

Digital signal

Digital signals , in contrast to analog signals do not vary continuously, but change in steps or in discrete increments . Most digital signals use binary or two state codes.

FABDUINO

Fabkit i/o (Fabduino) is a board compatible with ATtmega328p microcontroller, so you can write the same code with an Arduino IDE

Follow this website for make and learn how to make the Fabduino:

Componets:

  • ATtiny 328 SMD
  • (2) .1 uf capacitor
  • 1 uf capacitor
  • 10 uf capacitor
  • 10k resistor
  • 499 resistor
  • led1206 SMD
  • (3) 8 pin header
  • 6 pin header
  • 6mm switch
  • resonator 8 mhz

 

Downloads

Follow the workflow of the pcb board milling and welding process in this week (week 04)

In this case I just change the text of the board to my last name "HUANG"

Final results

According to the steps of the websites Fabkit i/o (aka Fabduino) and Fabkit v.0.3-0.4

PROGRAMMING (bootloader)

Connect the AVRISP mkII or USBtiny to the fabduino board and FTDI cable (5V), the AVRISP  who writes the data on the board and the FTDI cable is used used as a transmitter of data to the computer and as a power supply.

RST

VCC

GND

SCK

MOSI

MISO

FTDI

Connect the pinout of the Fabisp or AVRisp to fabduino: RST / VCC / GND / SCK / MOSI / MISO

Programming the bootloader in WINDOWS 8.1

Follow this steps to burn bootloader for the Fabkit:

  • Open Arduino Ide
  • Tools / Board /Arduino Pro or Pro Mini
  • Processor: ATmega 328, 3.3v , 16MHz
  • Port : Select port
  • Programmer:
    • AVRISP  if the fabduino if connected with AVRISPmskII
    • USBtinyISP if connected with USBtiny

 

  • And Burn bootloader

After to research the bootloader not works in windows 8.1 .According to the steps of the websites Fabkit i/o (aka Fabduino) and Fabkit v.0.3-0.4 is not necessary a external resonator, but my first test was without a resonator and the fabduino not works yet. Then I try to bootloader the fabduino again but it still not works with a resonator of 20 mhz so my last test was with a resonator of 8 mhz.

Following the steps of the images above work perfectly but only run in ubuntu because in windows not read the port when tries to burn bootloader.

 

  • The question is can I run burn bootloader in windows 7?
  • So I want learn to program in C and how can I burn bootloader in windows 8.1

PROGRAMMING (burn bootloader) in linux

After of many attempt, finally burn bootloader work in linux just following the same steps

Open terminal in linux and type command

 

"sudo arduino"

 

Sudo: is a utility for linux which allow user to run programs with the security privileges and safely

Open Arduino Ide

  • Tools / Board /Arduino Pro or Pro Mini
  • Processor: ATmega 328, 3.3v , 16MHz
  • Port : Select port
  • Programmer:
  • AVRISP  if the fabduino if connected with AVRISPmskII
  • USBtinyISP if connected with USBtiny
  • And Burn bootloader

PROGRAMMING FABDUINO

  • Arduino ide

Arduino ide software is and environment thats can upload many code with examples easily.

Connect a cable FTDI for power supply and transmitter of data to the fabduino

Blink

Is an example of communication that make the led of the fabduino turn off or on with delay.

Arduino ide: Edit/ Examples / Basic / Blink

In tools select the same parameter of the image

Fade

This example show how to fade an LED using a 6mm swithch buuton

Learning outcomes:

  • Identify relevant information in a microcontroler date sheet
  • Implement programming protocols

 

Have you

  • Documented what you learned from reading a microcontroller datasheet
    • What questions do you have? What would you like to learn more about?
  • Programmed your board
  • Described the programming process/es you used
  • Included your code

 

Download files and code of week 08

Copyright © Jorge Huang Li - FAB ACADEMY 2016