| Electronic Components Datasheet Search |
|
AN431 Datasheet(PDF) 8 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN431 Datasheet(HTML) 8 Page - STMicroelectronics |
|
8 / 15 page ![]() 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 |
|
|
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 |
| 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 |