Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN431 Datasheet(PDF) 8 Page - STMicroelectronics

Part # AN431
Description  Using ST6 analog inputs for multiple key decoding
PDF  15 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN431 Datasheet(HTML) 8 Page - STMicroelectronics

Back Button AN431 Datasheet HTML 4Page - STMicroelectronics AN431 Datasheet HTML 5Page - STMicroelectronics AN431 Datasheet HTML 6Page - STMicroelectronics AN431 Datasheet HTML 7Page - STMicroelectronics AN431 Datasheet HTML 8Page - STMicroelectronics AN431 Datasheet HTML 9Page - STMicroelectronics AN431 Datasheet HTML 10Page - STMicroelectronics AN431 Datasheet HTML 11Page - STMicroelectronics AN431 Datasheet HTML 12Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 8 / 15 page
background image
ANALOG KEYBOARD
8/15
peg9_10
.equ
0d9h
;border to distinguish between switch9 and switch10
ldi
ddrpb,inpall
;sets all port B pins low — all input
ldi
orpb,01h
;option register:
;sets bit b0 high, the rest low
ldi
drpb,01h
;direction register:
;sets bit b0 high, the rest low
;— pb0 becomes analog input
;
pb1-7 become input with pull-up, but
;
are not used here (only one pin may be
;
analog input for A/D at the same time)
ldi
adcr,30h
;A/D control register:
; 0011 0000 — -activate A/D converter
;
-start conversion
;
-disable A/D interrupt
loop:
jrr
6,adcr,loop
;loop until the End Of Conversion bit is
;set (indicator that a conversion has
;been completed)
ld
a,adr ;load acc with the result of the A/D
;conversion
;now the result is compared with the
; values which represent the different
;switches
sw1:
cpi
a,peg1_2
;compare with peg1_2
jrnz
sw2
;A/D result was smaller than peg1_2
jp
s1
; — switch1 was pressed: jump to s1
sw2:
cpi
a,peg2_3
;compare with peg2_3
jrnz
sw3
;A/D result was smaller than peg2_3
jp
s2
; — switch2 was pressed: jump to s2
sw3:
cpi
a,peg3_4
;compare with peg3_4
jrnz
sw4
;A/D result was smaller than peg3_4
jp
s3
; — switch3 was pressed: jump to s3
sw4:
cpi
a,peg4_5
;compare with peg4_5
jrnz
sw5
;A/D result was smaller than peg4_5
jp
s4
; — switch4 was pressed: jump to s4



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com