$NOMOD51 ;der Modus fuer 8051 wird abgeschaltet $debug $nolist ;es wird kein Listing fuer reg535 erstellt $include(C8051F360.inc) ;die C8051F360-spezifischen Daten $list ;es wird ein Listing erstellt $title (P02_MCWS08_S.A51) ;------------------------------------------------------------------------ ;Programmbeschreibung ;------------------------------------------------------------------------ ;Programm: ;T1 loest externen Interrupt /INT0 aus ;T2 loest externen Interrupt /INT1 aus ;Im Simulator bei "Pins" Interrupt ausloesen ; ;Erstellt am: Montag, 29. Dezember 2008 19:10:50 ;Programmiert: Juergen Walter ; ;Verwendete Einspruenge: keine ; ;Verwendete Unterprogramme: keine ; ; ;Verwendete Register und Variable: ;Registerbank(0) ;R2 ; ;Kommentar: ; ;Aenderungen: ;Geaendert am: Montag, 29. Dezember 2008 19:10:50 ; ; ;------------------------------------------------------------------------ ;Initialisierungsteil fuer allgemeine Konstanten ;------------------------------------------------------------------------ CSEG AT 0H ;Legt absolute Codesegmentadresse auf 0h ljmp INIT ;Wird hier call ausgefuehrt --> bei 03 Kollision ; ;------------------------------------------------------------------------ ;Interrupt-Vektoren ;------------------------------------------------------------------------ ORG 03H call ISR_INT0 reti ORG 13H call ISR_INT1 reti ;------------------------------------------------------------------------ ;Initialisierungsteil fuer On-Chip Peripherie ;------------------------------------------------------------------------ ORG 100H ;Programmstart bei 100H INIT: call Init_Device ;Aufruf zur Initialisierung der Controller Funktionen ;------------------------------------------------------------------------ ;Programmschleife ;------------------------------------------------------------------------ ABFRAGE: jnb P1.3,LOESCHEN ;L loeschen jmp ABFRAGE LOESCHEN: setb P3.2 ;L2 aus setb P3.3 ;L3 aus jmp ABFRAGE ISR_INT0: clr P3.2 ;Interrupt 0 erkannt ret ISR_INT1: clr P3.3 ;Interrupt 1 erkannt ret ;------------------------------------------------------------------------ ; Peripheral specific initialization functions, ; Called from the Init_Device label ;------------------------------------------------------------------------ Port_IO_Init: ; P0.0 - Skipped, Push-Pull, Digital /INT0 ; P0.1 - Skipped, Push-Pull, Digital /INT1 ; P0.2 - Skipped, Push-Pull, Digital ; P0.3 - Skipped, Push-Pull, Digital ; P0.4 - Skipped, Push-Pull, Digital ; P0.5 - Skipped, Push-Pull, Digital ; P0.6 - Skipped, Push-Pull, Digital ; P0.7 - Skipped, Push-Pull, Digital ; P1.0 - CEX0 (PCA), Push-Pull, Digital ; P1.1 - CEX1 (PCA), Push-Pull, Digital ; P1.2 - CEX2 (PCA), Push-Pull, Digital ; P1.3 - CEX3 (PCA), Push-Pull, Digital ; P1.4 - CEX4 (PCA), Push-Pull, Digital ; P1.5 - Skipped, Push-Pull, Digital ; P1.6 - Skipped, Push-Pull, Digital ; P1.7 - Skipped, Push-Pull, Digital ; P2.0 - Skipped, Push-Pull, Digital ; P2.1 - Skipped, Push-Pull, Digital ; P2.2 - Skipped, Push-Pull, Digital ; P2.3 - Skipped, Push-Pull, Digital ; P2.4 - T0 (Timr0), Push-Pull, Digital ; P2.5 - T1 (Timr1), Push-Pull, Digital ; P2.6 - Unassigned, Push-Pull, Digital ; P2.7 - Unassigned, Push-Pull, Digital ; P3.0 - Unassigned, Push-Pull, Digital ; P3.1 - Unassigned, Push-Pull, Digital ; P3.2 - Unassigned, Push-Pull, Digital ; P3.3 - Unassigned, Push-Pull, Digital ; P3.4 - Unassigned, Push-Pull, Digital ; P3.5 - Unassigned, Push-Pull, Digital ; P3.6 - Unassigned, Push-Pull, Digital ; P3.7 - Unassigned, Push-Pull, Digital mov P0MDOUT, #0FFh mov P1MDOUT, #0FFh mov P2MDOUT, #0FFh mov P3MDOUT, #0FFh mov P0SKIP, #0FFh mov P1SKIP, #0E0h mov P2SKIP, #00Fh mov XBR1, #075h ret Oscillator_Init: mov SFRPAGE, CONFIG_PAGE mov OSCICN, #082h ret Interrupts_Init: mov SFRPAGE, CONFIG_PAGE mov IT01CF, #010h mov IE, #085h ret ; Initialization function for device, ; Call Init_Device from your main program Init_Device: lcall Port_IO_Init lcall Oscillator_Init lcall Interrupts_Init ret end