Asuro Switches/Interrup behaviour The Asuro Atmega8L is initialized in such a way that switch...

Post on 17-Dec-2015

214 views 1 download

Tags:

Transcript of Asuro Switches/Interrup behaviour The Asuro Atmega8L is initialized in such a way that switch...

Asuro Switches/Interrup behaviour

The Asuro Atmega8L is initialized in such a waythat switch interrupts are detected as long as theinterrupt detection pin (Pin 5, PD3) is at a low level.

...when using interrupt todetect a switch press.

Switch K1

Pin5 = I/L

High level by R23,1MOhm to VCC

Switch K1

Pin5 = I/L

Switch K1is pressed

High level by R23,1MOhm to VCC

Switch K1

Pin5 = I/L

Switch K1is pressed

High level by R23,1MOhm to VCC

External interruptlow level reached

Switch K1

Pin5 = I/L

Switch K1is pressed

High level by R23,1MOhm to VCC

External interruptlow level reached

Pin5=O/H

Switch K1

Pin5 = I/L

Interrupt functionstarts execution

Switch K1is pressed

High level by R23,1MOhm to VCC

External interruptlow level reached

Pin5=O/H

Switch K1pressed,stable level

Switch K1

Pin5 = I/L

Switch K1

Switch K1pressedstable level

Switch K1is pressed

Switch K2

Switch K2pressedstable level

Switch K2is pressed

Switch K3

Switch K3pressedstable level

Switch K3is pressed

Switch K4

Switch K4pressedstable levelSwitch K4

is pressed

Switch K5

Switch K5pressedstable levelSwitch K5

is pressed

Switch K6

Switch K6pressedstable level

Switch K6is pressed

Switch K1is pressed Switch K1

pressedstable level

6ms delay

Start ADCmeasurement ADC

measurementfinished,Pin5=I/H

Switch K1still pressed

Switch K1

an arbitrary delay

Switch K3is pressed

Switch K3pressedstable level

6ms delay

Switch K3still pressed

Pin5=I/L Pin5=O/H

Switch K3pressedstable level

Switch K3

Switchinterruptenabled

Switchinterruptdisabled

Time neededby programto handle interrupt

New interrupt.Interrupt generatedwhen low level.

Switch K3

Pin5=I/L

Switch K3released

High level by R23,1MOhm to VCC

Switch K1

Switch K3pressedstable level

6ms delay 6ms delay

Pin5=O/H

Switch K3released

Start ADCmeasurement

Wrong valuemeasurement

Sometimes a wrong value can be measured.

That’s all folks!

Arexx_Henk

Website