programming embedded systems hands on experience with avr32 by: stefan persson mazhar hussain...

Post on 21-Dec-2015

221 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Programming Embedded Systems

Hands on Experience with AVR32

By:

Stefan Persson Mazhar Hussain Muhammad Amir Yousaf stefan.persson@miun.se mazhar.hussain @miun.se amir.yousaf@miun.se

23-04-19

1

amir.yousaf@miun.se mazhar.hussain@miun.se

Tutorial Overview

Introduction to Development Board µ-Controller Sensors Display Peripherals

AVR Studio Getting Started Workspace creation Project creation Project building Target creation and Loading Program

Course Objective

Live Demonstration

2

amir.yousaf@miun.se mazhar.hussain@miun.se 23-04-19

Introduction to Development Board EVK1100 Evaluation kit and development system for

the AVR32UC3A family EVK1100 is a fully functional embedded

computer system. Circuit board has a flexible power system

that accepts 8-20V DC input and can be operable via USB port.

The EVK1100 embeds an Atmel Data flash (8MBytes) and a SDRAM (32MBytes).

Several communication interfaces are available on the EVK1100: RS232, USB and ETHERNET.

23-04-19

µ-Controller Sensors Display

Peripherals

3

amir.yousaf@miun.se mazhar.hussain@miun.se

A JTAG connector is provided to interface JTAGICE mkII (Programmer and debugger) .

EVK1100 provides three clock inputs

for controller Main clock Oscillatior i.e 12MHz A spare clock Oscillator i.e 12MHz RTC clock at 32.768 KHz

23-04-19

µ-Controller Sensors Display

Peripherals

4

amir.yousaf@miun.se mazhar.hussain@miun.se

Block Diagram EVK1100

23-04-19

Published BY ATMEL

µ-Controller Sensors Display

Peripherals

5

amir.yousaf@miun.se mazhar.hussain@miun.se

Lowest power Consumption (2xAA battery=19years)

Support High data throughput.

High Speed Communication Interfaces

– USB up to 480 Mbit/s– Ethernet up to 100 Mbit/s– SPI up to 33 Mbit/s– SSC up to 33 Mbit/s (I2S)– USART up to 33 Mbit/s– UART up to 4 Mbit/s– I/O pin toggle up to 33 MHz

23-04-19

µ-Controller Sensors Display

Peripherals

6

amir.yousaf@miun.se mazhar.hussain@miun.se

• Support Provided :– Optimized drivers for all peripherals to speed up development.– Floating point and DSP arithmetic– USB and TCP/IP stacks– Optimized audio, picture and video codec's, display

drivers, TCP/IP services, web server, FAT12/16/32 file system, plus a complete freeRTOS Real Time OS

23-04-19

µ-Controller Sensors Display

Peripherals

7

amir.yousaf@miun.se mazhar.hussain@miun.se

23-04-19

Published BY ATMEL

µ-Controller Sensors Display

Peripherals

8

amir.yousaf@miun.se mazhar.hussain@miun.se

Sensor Name

GPIO Names

Alt. Function

UsedLight PA 23 ADC2

Temperature PA21 ADC0

Potentiometer PA22 ADC1

23-04-19

µ-Controller Sensors Display

Peripherals

9

amir.yousaf@miun.se mazhar.hussain@miun.se

LCD Pin GPIO Name

Alt. Function

5 PA16 SPI1_MOSI

7 PA17 SPI1_MISO

6 PA15 SPI1_CLK

4 PA19 SPI1_CS2

18 PA18 PWM_6

23-04-19

4x20 LCD to Design Human to Machine Interface for Soft. Development

µ-Controller Sensors Display

Peripherals

10

amir.yousaf@miun.se mazhar.hussain@miun.se

USB (2.0 mini A-B receptacle) Ethernet (External Ethernet Phy 10/100 and RJ45

connector) Atmel DataFlash (8 MBytes) SDRAM (32 MBytes) USARTs (Dual) LEDs on board (Six) Push Buttons (Three excluding Reset Push button) Joystick SD/MMC slot SPI (Two SPI interface one is dedicated for LCD one

free) TWI (Two wire Interface)

23-04-19

On Board Peripherals: µ-Controller

Sensors Display

Peripherals

11

amir.yousaf@miun.se mazhar.hussain@miun.se

23-04-19

Expansion Connectors:

>>SSC, PWM output 0 to 6,Timer A and timer B,TWI,ADC inputs line 0 to 7,SPI 0 to 1,USART 0 to 3,MAC,GPIO

µ-Controller Sensors Display

Peripherals

12

amir.yousaf@miun.se mazhar.hussain@miun.se

Tutorial Overview

Introduction to Development Board µ-Controller Sensors Display Peripherals

AVR Studio Getting Started Workspace creation Project creation Project building Target Creation and Loading Program

Course Objectives Live Demonstration

13

amir.yousaf@miun.se mazhar.hussain@miun.se 23-04-19

AVR Studio Getting Started

23-04-19

Workspace creation Project creationProject building Target Creation & Loading program Start -> Program -> Atmel AVR Tools ->

AVR32 Studio

14

amir.yousaf@miun.se mazhar.hussain@miun.se

23-04-19

15

amir.yousaf@miun.se mazhar.hussain@miun.se

Running an Example Project– Click File >> New >> Project >>AVR32 Example Project

23-04-19

• Running your own Project• Click File >> New >> Project >>AVR32 C Project From Template

16

amir.yousaf@miun.se mazhar.hussain@miun.se

Workspace creation Project creationProject building Target Creation & Loading program

23-04-19

Building a Project Select the project from the project plan (on left side of the

window) and right click Click ‘Build Project’

Build complete for project ’myproject’ ’Debug’ directory will be added in the workspace myproject.elf will be created in the Debug

directory and is ready to be loaded in the controller

17

amir.yousaf@miun.se mazhar.hussain@miun.se

Workspace creation Project creationProject building Target Creation & Loading program

For Programming EVK1100 there are three listed methods available, (Note: we can use two among them)

– In system Programming (ISP)

– Programming Via JTAG port

– Self Programming via One chip BOOT program

Tool for using programming is JTAG or USB cable (for ISP)

– JTAG ICE mkII

23-04-19

Workspace creation Project creationProject building Target Creation & Loading program

18

amir.yousaf@miun.se mazhar.hussain@miun.se

For Programming EVK1100 we need to add a Target– Scan the target as shown in Picture

23-04-19

Workspace creation Project creationProject building Target Creation & Loading program

19

amir.yousaf@miun.se mazhar.hussain@miun.se

Configure the target device i.e JTAGICE mkII for downloading your program

23-04-19

Workspace creation Project creationProject building Target Creation & Loading program

20

amir.yousaf@miun.se mazhar.hussain@miun.se

23-04-19

Loading Code in the Micro-controller Loading through USB DFU Loading through JTAG

On EVK1100

Press the joystick downwards and hold it.

Now press the re-start button to put the device in programming mode

On AVR Studio Right-click on target for USB-programming

and click program. Browse the target file and press ‘ok’ in

newly appeared window to start loading the program

21

amir.yousaf@miun.se mazhar.hussain@miun.se

Workspace creation Project creationProject building Target Creation & Loading program

23-04-19

Loading Code in the Micro-controller Loading through JTAG

Right click on JTAGICE mkII and click on ‘Program’. Browse the target .elf file and press ok to start loading

22

amir.yousaf@miun.se mazhar.hussain@miun.se

Workspace creation Project creationProject building Target Creation & Loading program

Tutorial Overview

Introduction to Development Board µ-Controller Sensors Display Peripherals

AVR Studio Getting Started Workspace creation Project creation Project building Target creation and Loading Programs

Course Objective

Live Demonstration

23

amir.yousaf@miun.se mazhar.hussain@miun.se 23-04-19

Application

Our WSN Platform (Sentio)o Number of different platforms targeting different application areas

SENTIO a stackable platform developed in 2004 (IEEE802.15.4 compatible(Zigbee), having three layers i.e communication layer, processing layer (Atmel Mega 128L 8-bit uC), and analog/digital interfaces to sensor layer. Sufficient for short range communication.

SENTIO-HP high-precision wireless instrument that can be used for characterizing processes SENTIO-BT for urban sensing applications. SENTIO-e2 for  environmental monitoring, communicating at 433MHz at ranges up to 1 km.

Global communication via GSM/GPRS or to a PC via USB

23-04-19

SENTIO32:

A latest platform that is very compact with (IEEE802.15.4 compatible (Zigbee)) and processor (AVR32) on the same board.

It is a Development Board, can be used for variety of wireless sensor applications

24

amir.yousaf@miun.se mazhar.hussain@miun.se

Tutorial Overview

Introduction to Development Board µ-Controller Sensors Display Peripherals

AVR Studio Getting Started Workspace creation Project creation Target creation Project building and Downloading

Course Objective Live Demonstration

23-04-1925

amir.yousaf@miun.se mazhar.hussain@miun.se

Demonstration

23-04-19

26

amir.yousaf@miun.se mazhar.hussain@miun.se

top related