PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Keyboard Interface 89c51xD2 ???



Import-Script
15.01.2004, 18:55
Schönen guten Abend... <BR> <BR>Ich bin wieder einmal am ausprobieren.. <BR>Keybord interface beim xD2, irgentwie klapp&#39;s nicht. <BR>Testaufbau: <BR>LED&#39;s Port 0 <BR>Taster am Port 1 &#40;schalten gegen masse&#41; <BR>Taster an INT0 &#40; dito &#41; <BR> <BR>Wenn das Prog started blinkt P0.0 gut... <BR>Wird INT0 ausgelöst CPL&#39;t P0.1 und bleibt dann, auch gut <BR>Wird irgend eine Taste vom Port 1 gedr&uuml;ckt <BR>Blinkt P0.2 mit P0.0 <BR>Der IRQ request wird also nicht zur&uuml;ckgesetzt.. <BR>Ich dachte nun wenn das Keyboard Flag &#40;KBF&#41; wieder zur&uuml;ckgesetzt wird verschwindet auch der Request, is aber nicht!? <BR>Übersehe ich da was? <BR> <BR>INCLUDE AT89C51xD2.mc <BR>; Interruptroutinen <BR>;--------------------------------------------------------------- <BR>; RST <BR>ORG 0h <BR> JMP beginn <BR> <BR>;--------------------------------------------------------------- <BR>; INT 0 <BR>ORG 03h <BR> call ext0_int <BR> RETI <BR>;--------------------------------------------------------------- <BR>; Keyboard <BR>ORG 3bh <BR> call keyb_int <BR> RETI <BR> <BR>; Interruptbehandlungsroutine Externer Int 0 <BR>ext0_int: <BR> CLR ex0 ;EX0 IRQ AUS <BR> CPL p0.1 ;bisserl blinken <BR> MOV 20h,#00 ;mach irgend was <BR> NOP <BR> NOP <BR> call wt_1sek <BR>RET <BR>;--------------------------------------------------------------- <BR> <BR>; Interruptbehandlungsroutine keyboard <BR>keyb_int: <BR> MOV ien1,#feh ;IRQ aus <BR> CPL p0.2 ;bisserl blinken <BR> MOV 20h,#0h ;mach irgend was <BR> MOV KBF,#0h ;KBF FLAG auf LO <BR> NOP <BR> NOP <BR> call wt_1sek <BR>RET <BR>;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <BR>;------------------------------------------------------------------------- <BR>; Init <BR>;------------------------------------------------------------------------- <BR>beginn: <BR> MOV SP,#40h <BR> MOV 20h,#ffh ;mach irgend was <BR> SETB EA ;global IRQ ein <BR>;------------------------------------------------------------------------- <BR>; Programmbeginn <BR>;--------------------------------------------------------------- <BR> <BR>START: <BR> <BR> SETB ex0 ; IRQ 0 ein &#40;WIEDER EIN&#41; <BR> MOV KBLS,#0h ; KBLS Level select auf LO detect <BR> MOV KBE,#FFh ; KBE Enable IRQ Keyb. <BR> MOV KBF,#0h ; KBF FLAG LO <BR> MOV ien1,#FFh ; IRQ Keybord ein &#40;WIEDER EIN&#41; <BR> MOV 20h,#FFh ; mach irgend was <BR> NOP <BR> NOP <BR> NOP <BR> NOP <BR> NOP <BR> NOP <BR> CPL p0.0 <BR> <BR> call wt_1sek <BR> <BR> <BR>JMP start <BR> <BR>;Pausenroutinen <BR>~~~ <BR>snipp <BR>~~~ <BR> <BR> <BR> <BR> <BR>

Import-Script
15.01.2004, 18:57
UPPS... <BR>Anhang: <BR>Danke schon mal <BR> <BR>Ronnie

Import-Script
18.01.2004, 03:01
hat sich erledigt.... <BR>Ronnie