User Tools

Site Tools


Lab 1: Microcontroller programming setup

In this first exercise let's install the necessary tools and run an example program on a pre-assembled microcontroller board.

By the end of this exercise we should be able to compile the example project Blink, program Arduino Nano board with it, then include by yourself Serial interface for helping monitoring for debugging purpose.

  1. See uc2 for tool installation.
  2. Arrange a day/time for soldering your own ‘nano’ board during the following week; see lab_2.
  3. Answer the questions below.


By next class, individually attempt at answers to the following questions, which you may be able to answer by reading the ATmega328P Datasheet, Sparkfun Arduino Programming guide and Arduino Reference language. The datasheet contains usage information, while the both Sparkfun and Arduino programming references have more information about programming in Sketch.

The questions are below. The link to the google form for you to answer these questions will be sent to by email.

  1. How much flash/SRAM/EEPROM memory does the ATmega328P have?
  2. Is there one instruction executed per clock cycle or does it require multiple clock cycles per instruction?
  3. What is the maximum system clock frequency, does clock frequency have any dependence?
  4. What is the maximum power consumption of ATmega328P? Which two main parameters are in this matter?
  5. What is the oscillator start-up time from sleep?
  6. What is the “initialisation time” for the ADC?
  7. What is the ADC power consumption?
  8. What is the maximum PWM output frequency using 8-bit timer/counter (analogWrite function)? And using 16-bit timer/counter (Servo library)?
  9. What is the value of the pull-up resistor on the GPIO (when enabled)?
  10. Does the ATmega family have floating point hardware support?
  11. Does the ATmega328P have a hardware multiplier? If so, how many clock cycles does it take and what is its resolution, i.e, how does it handle overflows?
  12. And does the Atmega have DSP (Digital Signal Processing) instructions for multiplying, accumulating, and incrementing a pointer in one instruction?
  13. What is a Sketch? Do you know the difference between C/C++ programming and Arduino Sketches?
  14. How can you debug your code under Arduino?
dig/lab_1_2014.txt · Last modified: 2016/02/27 09:07 by tobi