52
Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Embed Size (px)

Citation preview

Page 1: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Microprocessor based Design for Biomedical Applications

MBE 3 – MDBA

I : Introduction

Page 2: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Today:

● Course Introduction and Administrative Information

● Survey of Student Skills

● Microcontrollers in Biomed Applications – Overview

● AVR Family Overview

● Outlook : The OpenEEG Project

● Start to assemble the Eval Boards ?

Page 3: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Semester Schedule:

In September, we will meet● on Mondays ( 16:10 – 18:35 )

Monday, Sept. 24th we will start later, at 16:55 !

● on Thursdays ( 16:10 – 19:20 )

From October on, we will meet ● on Thursdays ( 16:10 – 19:20 )

Thursday, Nov. 1st there will be no lecture !

Room EDA B3.12

!! Check for updates of the Semesterplan on the CIS !!

Page 4: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Modes of evaluation:

● 40 % Project participation, Project reviews, solved programming tasks

● 30 % Review of a scientific paper Paper selection, workout and presentation

Presentations will be on Nov. 22th and Nov. 29th

● 30 % Examination at the end of the term Theoretical Questions about the course topics ( without PC‘s or other material ) Programming task on paper, PC‘s allowed

Exam will be on Dec., 12 th

Page 5: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Our goals for this term:

● Practical usage of Microcontrollers in the Biomedical Context

● Understanding, usage and modification of a biosignal (EEG-) acquisition system

● See examples of ongoing research in BME

● Implementation of project ideas

Page 6: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Course Topics

● Features of our hardware platform

● Firmware programming, solving programming tasks

● Data transfer and transmission Protocols

● Measurement of bioelectric signals and events

● Signal processing software and methods

● Biofeedback, Brain Computer Interfaces

● Standards for design and certification

● Design examples

Page 7: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

heavens sake!... our EEG will have just 2 Channels …

http://people.brandeis.edu/~sekuler/eegERP.html

Page 8: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Course Material

HARDWARE :

● Atmel AVR microcontrollers

● Evaluation Boards with ATmega8 microcontroller

● OpenEEG hardware (MonolithEEG)

● Electrodes and Sensors

● Hardware extensions for projects

Page 9: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Course Material

SOFTWARE :

● WinAVR Toolchain, AVR Studio DIE

● Programming tools, Bootloader

● PCB – Editor and Circuit Simulator

● Signal processing tools and Biosignal Software

Page 10: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

The main hardware and software for our course are GPL‘d:

● GNU – The free software foundation

● GPL – GNU General Public License

● free sources, mention the authors !Richard Stallman http://www.stallman.org

Page 11: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Draft of a timeline

First 2 - 3 weeks:

● Prepare the Evaluation Boards and cabling● Getting started with the IDE● Gain some knowledge about AVR features and firmware programming

until October:

● Solve programming tasks● Data Transmission, A/D conversion, ● Interrupt handling

Page 12: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Draft of a timeline

October - November:

● Understand the openEEG hardware● Switch to the Monolith-EEG amplifier● work with and modify the system firmware

from Novemeber :

● use our knowledge in a practical project● review research papers, prepare a presentation● project reviews, debugging, final examination

Page 13: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Survey of your skills

Page 14: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Query the given skills .. to find out synergies and to adapt our timeline

(0) Finished Bachelor for Biomedical Engineering ?

(1) Concepts and usage of microcontrollers ?

(2) AVR microcontrollers + Tools ?

(3) Breadboard – circuits, Soldering, SMD ?

(4) Analog electronics ( OpAmps, Filtering ) ?

(5) Sampling and A/D Conversion ?

Page 15: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Query the given skills

(6) C-Programming, GCC-Toolchain ?

(7) Event-based firmware programming, interrupts ?

(8) Data Transmission using UART/RS232 ?

(9) Interfacing uC-firmware and PC (host-) software ?

(10) Design of PCBs using a CAD-Tool ?

(11) Usage of the Eagle-CAD Layout Editor ?

Page 16: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Query the given skills

(12) Soldering and building up electronic circuits

(13) Reading datasheets, studying new parts

(14) Physiological basics of bioelectricity

(15) Measurement of bioelectric events

(16) Signal processing with Matlab / Filters

What are your ideas / expectations for this course ?

Page 17: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Microcontrollers in embedded biomedical Applications

Page 18: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

Microcontrollers in embedded biomedical Applications:

We want to have systems that :

● are reliable

● are small and lightweight

● have a low power consumption

These issues are critical when we deal with body implants

Page 19: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Microcontrollers

Some features / advantages of microcontrollers:

● they are small and flexible● easy to use ( most of the time .. )● few external components and wires needed● low and ultra low power designs possible (-> PSoC, ASIC )● wide range of different uCs available (memory, I/O, speed, busses, A/Ds )● data interchange using standard bus systems; -> various peripheral hardware accessible● IDEs and toolchains for firmware programming / ● Simulation and high level languages

-> 90% of the manufactured CPUs are not found in desktop PCs but in embedded systems, with growing areas of application: RFID, hidden "ubiquitous" computing, wearables, "smart environments", MEMS (micro electro-mechanical systems)

Page 20: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Microcontrollers

Some examples for uC-based biomed devices / applications:

● various sensors or meters: Body temperature, Blood Pressure, Blood Sugar Level, …

● Implants and prostetics

● Pacer makers (for heart, breathing, ...)

● functional Electrostimulation

● Orthesis and artificial limbs

● Biosignal acquisition equipment

Adam blood glucose meter

www.heartratemonitor.co.uk

Page 21: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Microcontrollers

Some examples for uC-based biomed devices / applications:

● portable emergency equipment (defibrillator, ..)

● Sports medicine

● Patient monitoring

● “Smart Homes", service robotics

● support of Communication for disabled persons

● wireless sensor networks / Body Area Network (BAN)

● Sensors and Actuators for stationary medical equipment

Life-point defibrillator Spo2 Module

Page 22: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

In a medical Context:

Dependability and Fault Tolerance are major issues.

● Failsafe: safe state after failure● Fault recovery: normal operation can be restored● Gracefully Degradation: system continues (restricted) work

MTBF Mean Time Between FailureEnvironment conditions / Materials

Redundant Hardware / Software makes sense here !

Page 23: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

System Design and Integration:

● Hardware Selection for Development / Production

● Hardware and Software Co - Development

● System Modelling and Simulation, UML

The earlier a design bug is found, the better !

Page 24: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR microcontrollers

Page 25: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

Why will we use an 8-bit AVR microcontroller in our course ?

● sufficient for many biomedical applications

● AVR Mega 8 features built-in A/D converters

● Fast and cheap ( < 3 € per unit )

● needs less power than more sophisticated uCs

● good support on the development side: AVR-GCC (WinAVR Toolchain), AVR Studio

● widely used in OpenSource projects, huge knowledge base and reference designs

● OpenEEG project is based on AVRs

Page 26: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

Members of the AVR family, different packages: 90s, Mega- and Tiny variants

http://superpositioned.com/articles/tag/exclusive

Page 27: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR Product Families

● tinyAVR General purpose Microcontroller with up to 4K Bytes Flash program memory 128 Bytes SRAM and EEPROM.

● megaAVR Self programming memory enables remote reprogramming without additional circuitry. Up to 256K Bytes Flash, 4K Bytes EEPROM and SRAM.

● LCD AVR Integrated LCD driver, contrast control. power consumption at 32 kHz < 20 μA.

● CAN AVR Integrated CAN Controller

Page 28: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR general features:

● RISC: most instructions need a single clock cycle ● Special Function Registers to access the built in peripherals● Low power and sleep modes ● In-system- programmable Flash memory

MegaAVR features:

● Self programming options● Operating voltages from 1.8-volt to 5.5-volt● 10-bit A/D converter with channel multiplexer● USART, SPI and TWI (I2C) – Interfaces● JTAG in >16KB megaAVRs

Page 29: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

Programming the AVR

Page 30: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

Programming the AVR

1.) Write source code in assembler or higher language Text editor, IDE

2.) Compile, Link (and locate) executable file WinAVR GCC, Make, IDE

3.) Use hardware link and programmer software to download firmware image to uC

Page 31: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR programming options:

Atmel AVR Quick Reference Guide http://www.atmel.com

Firmware security:locking via fuse-bits

Page 32: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

http://www.mikrocontroller.net/articles/AVR_In_System_Programmer

ISP: In system programming

● native Serial Peripheral Interface (SPI)

10-pin Kanda Dongle 6-pin Atmel (STK200) connector

Page 33: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

The AVR Studio IDE:

Atmel AVR Quick Reference Guide http://www.atmel.com

Page 34: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR STK500 Evaluation Board

http://shop.mikrocontroller.net

Firmware download via RS232, using the STK500v2 protocol.

The STK500 hardware platform transforms the RS232 commands to SPI commands

Supported by all AVRs

On-Board Leds, Keys, Cables

Page 35: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR ISP : In-System Programmer

http://www.raphnet.net/divers/avrprog/avrisp.jpg

http://www.btnode.ethz.ch

The ISP- Programmer:

An Adapter between PC / RS232 and the on-chip SPI programming interface

Page 36: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR ISP mkII : In-System Programmer, USB-Version

http://lintel.ls0578.net/Article

The ISP mkII - Programmer:

An Adapter between PC / USB and the on-chip SPI programming interface

Page 37: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

Lots of ISP Clones: cheap remakes of the AVR ISP

http://www.restek.dk/grafik/ispclone.jpg

http://avrtools.co.krhttp://hubbard.engr.scu.edu/embedded/avr/boards

Page 38: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR Dragon Board

http://www.bfrdesign.com/blog.htm

Atmel's new low-cost generic programmer + debuggerJTAG, DebugWire, ISP, USB. 53x105mm, price less than $100

Page 39: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

JTAG ICE / JTAG ICE mkII:

Atmel AVR Quick Reference Guide http://www.atmel.com

Page 40: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

ICE50 Emulator:

Atmel AVR Quick Reference Guide http://www.atmel.com

Page 41: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

AVR Application Notes regarding programming:

http://www.atmel.com/dyn/products/app_notes.asp?family_id=607

AVR910 (PDF) "Low-cost" In-system programming (AVRISP)

AVR911 (PDF) Open source serial programmer (AVROSP)

AVR109 (PDF) Self-Programming with a Bootloader

Page 42: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

The most simple and cheap solution for AVR firmware programming:Parallel Port Cable + ISP Sofware

Page 43: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

Our Evaluation platform - the Pollin EvalBoard2 :

Features: ISP / JTAG connectors, RS232 level converter, 2 Leds, 3 Buttons, buzzer, 40Pin extension header. Price: 14.99 €

Page 44: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

EvalBoard2 top view:

Sockets for Attiny2313/21/15, Atmega8/16/32/8535

Page 45: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – The Atmel AVR family of microcontrollers

EvalBoard2 jumper settings

Page 46: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Outlook: The OpenEEG Project

Outlook: the OpenEEG project

● Online since 1999● Project aims: development of a lost cost, high quality EEG amplifier development of Open Source firmware / PC-software sharing of knowledge the area of EEG / biosignal - instrumentation and application

● Major Hardware Designs : ModularEEG (6 Chn, non-SMD, Kit) MonolithEEG (2 Chn, SMD, USB) SoundcardEEG (FM/AM - Modulation

Page 47: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Outlook: The OpenEEG Project

Outlook: the OpenEEG project

● Available Software:

different firmware implementations PC host software in JAVA, C++ Client/Server architecture for biosignal sharing Software for filter design and application Experimental BCI-software

● Hardware overview ModularEEG:

AVR-Atmega8 Microcontroller Resolution: 10bit / 0.5 uV Samplingrate: 1kHz up to 6 Channels DRL (driven right leg) – circuit CMRR < -94dB

ModularEEG, digital + analog boards. Author: Jörg Hansmann, http://openeeg.sf.net

Page 48: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Outlook: The OpenEEG Project

Outlook: Monolith EEG

● Small and leightweight SMD ● USB-powered● one double-sided board with extension plug

MonolithEEG amplifier. Author: Reiner Münch, http://openeeg.sf.net

Page 49: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Outlook: The OpenEEG Project

Outlook: BrainBay

● Windows software for Biosignal Processing and Biofeedback● Real time graphical configuration of designs using Input-, Processing- and Output-Elements

BrainBay OpenSource software. Author: Chris Veigl, http://brainbay.lo-res.org

Page 50: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Outlook: The OpenEEG Project

Preparation of Cables

Eval Boards

and Extension Boards

Page 51: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Hardware Preparation

Page 52: Microprocessor based Design for Biomedical Applications MBE 3 – MDBA I : Introduction

I: Introduction – Hardware Preparation

MonolithEEG Extension Board

16 Pin Monolith Extension Header16 Signals1:1 wired to a prototyping connector;Signals GND, MISO, MOSI, /RESET, SCKadditionally routed to the 10 Pin AVR- ISP Connector for firmware programming

4 Buttons with pulldown resistors (->GND)8 Leds + Led-Driver ICLed Anodes connected to Outputs (B0-B7) of 74HC245 – BusDriver-IC (Dir=VCC, /OE=GND)Led-Cathodes connected to Resistor Net(Resistor Net GND = Pin 1)