$NOMOD51 ;der Modus fuer 8051 wird abgeschaltet $debug $nolist ;es wird kein Listing fuer reg535 erstellt $include(C8051F340.inc) ;die C8051F340-spezifischen Daten $list ;es wird ein Listing erstellt $title (VC_2_ACCU_REG.A51) ;------------------------------------------------------------------------ ;Programmbeschreibung ;------------------------------------------------------------------------ ;Programm: ;T1 --> A5h in Accu und ;T2 --> Accu in R1 kopieren ; ; ; ;Erstellt am: Donnerstag, 8. Januar 2009 21:38:45 ;Programmiert: Juergen Walter ; ;Verwendete Einspruenge: keine ; ;Verwendete Unterprogramme: keine ; ; ;Verwendete Register und Variable: ;Registerbank(0) ;R2 ; ;Kommentar: ; ;Aenderungen: ;Geaendert am: Donnerstag, 8. Januar 2009 21:38:45 ; ; ;------------------------------------------------------------------------ ;Initialisierungsteil fuer allgemeine Konstanten ;------------------------------------------------------------------------ CSEG AT 0H ;Legt absolute Codesegmentadresse auf 0h jmp INIT ; ;------------------------------------------------------------------------ ;Interrupt-Vektoren ;------------------------------------------------------------------------ ;ORG ;------------------------------------------------------------------------ ;Initialisierungsteil fuer On-Chip Peripherie ;------------------------------------------------------------------------ ORG 100H ;Programmstart bei 100H INIT: call Init_Device ;Aufruf zur Initialisierung der Controller Funktionen ;------------------------------------------------------------------------ ;Programmschleife ;------------------------------------------------------------------------ ABFRAGE: jnb P1.1,SCHREIBE_ACCU ;Abfrage Taster 1 jnb P1.2,KOPIERE_ACCU_REG0 ;Abfrage Taster 2 jmp ABFRAGE SCHREIBE_ACCU: mov ACC,#0A5H ;Schreibe Zahl in Accu jmp ABFRAGE KOPIERE_ACCU_REG0: mov R0,ACC ;Kopiere ACCU in Register 0 jmp ABFRAGE ;------------------------------------------------------------------------ ; Peripheral specific initialization functions, ; Called from the Init_Device label ;------------------------------------------------------------------------ Port_IO_Init: ; P0.0 - Skipped, Push-Pull, Digital ; P0.1 - Skipped, Push-Pull, Digital ; 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 - T0 (Timr0), Push-Pull, Digital ; P1.1 - T1 (Timr1), Push-Pull, Digital ; P1.2 - Unassigned, Push-Pull, Digital ; P1.3 - Unassigned, Push-Pull, Digital ; P1.4 - Unassigned, Push-Pull, Digital ; P1.5 - Unassigned, Push-Pull, Digital ; P1.6 - Unassigned, Push-Pull, Digital ; P1.7 - Unassigned, Push-Pull, Digital ; P2.0 - Unassigned, Push-Pull, Digital ; P2.1 - Unassigned, Push-Pull, Digital ; P2.2 - Unassigned, Push-Pull, Digital ; P2.3 - Unassigned, Push-Pull, Digital ; P2.4 - Unassigned, Push-Pull, Digital ; P2.5 - Unassigned, 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 XBR1, #070h ret Oscillator_Init: mov OSCICN, #083h ret ; Initialization function for device, ; Call Init_Device from your main program Init_Device: lcall Port_IO_Init lcall Oscillator_Init ret end