| Datenblatt-Suchmaschine für elektronische Bauteile |
|
AN431 Datenblatt(PDF) 11 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN431 Datenblatt(HTML) 11 Page - STMicroelectronics |
|
11 / 15 page ![]() ANALOG KEYBOARD 11/15 en_kint: ldi ddrpb,inpall ;sets all port B pins low — all input ldi orpb,02h ;option register: ; sets bit b1 high, the rest low ldi drpb,01h ;data register: ; sets bit b0 high, the rest low ;— pb0 becomes input, no pull-up, no int ; pb1 becomes input with pull-up and int. ; pb2-7 become input with pull-up, but ; are not used here ldi ior,10h ;interrupt option register: ;— set D4: enable all interrupts ; reset D5: falling edge on int.input(#2) ret ;return to the calling address ;*** hd_kint (handle key interrupt) interrupt service routine ;*** evaluates the data resulting in pushing a key. ;*** Interrupt vector #2 (0ff4h and 0ff5h) must point (jump) to hd_kint. hd_kint: ldi drpb,03h ;data register: ; 0000 0011 ldi ddrpb,01h ;data direction register: ; 0000 0001 ; — pb0 becomes output ldi orpb,03h ;option register: ; 0000 0011 ; — pb0: push-pull output ; — pb1: ADC-input ; pb2-7 become input with pull-up, but ; are not used here ldi adcr,30h ;A/D control register: ; 0011 0000 — -activate A/D converter ; -start conversion ; -disable A/D interrupt loop: jrr 6,adcr,loop ;waits 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 |
|
|
Link URL |
| War ALLDATASHEET hilfreich? [ DONATE ] |
Über Alldatasheet | Werbung | Kontakt | Privatsphäre und Datenschutz | Link zum Datenblatt | Linktausch | Hersteller 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 |