Seite 1 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Mikrocomputertechnik - Kapitel 5 Herzlich Willkommen Prof. Jürgen Walter
Seite 2 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Tabelle 5.1 Verwendete Einheiten - Projekte Projektverwendete Einheiten 1. Blinklicht mit vorgegebener Blinkfrequenz Timer 0,1 Interrupt 2. A/D-WandlungA/D-Wandler 3. Serielle SchnittstelleSerielle Schnittstelle 4. EffektivwertmessungTimer, A/D-Wandler, Serielle Schnittstelle
Seite 3 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc 3 Goldene Regeln für 8051 Programme Nur dokumentierte Hard- und Software ist existent. Durchgänge Verwendung von Registern mit Herstellung des Ausgangszustandes. Zuordnung von Tasks (Aufgaben – Prozesse) zu Registerbänken. Bei umfangreicher Software unbedingt Hochsprache C verwenden.
Seite 4 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Standardkopf für Programme Assembler Anweisungen Programmbeschreibung Initialisierungsteil für allgemeine Konstanten Initialisierungsteil für On-Chip Peripherie
Seite 5 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Assembler-Anweisungen $nomod51 ;der Modus fuer 8051 wird abgeschaltet $debug $nolist ;es wird kein Listing fuer reg535 erstellt $include(reg535.pdf) ;die spezifischen Daten $list ;es wird ein Listing erstellt $ title ()
Seite 6 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Programmbeschreibung ; ;Programmbeschreibung ; ;Programm: ;Datum: ;Programmiert: J. Walter ;Verwendete Einspruenge: keine ;Verwendete Unterprogramme: keine ;Verwendete Register und Variable: ;Registerbank(0) ;R2 ;Kommentar: ; ;Aenderungen: ;Datum: ;
Seite 7 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc
Seite 8 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc
Seite 9 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Tabelle Codierung SpannungLeuchte 2Leuchte 3 0V <=U <= 2 VAUS 2V< U <= 3 VAUSEIN 3V< U <= 4 VEINAUS 4V< U <= 5 VEIN
Seite 10 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Blockbild A/D-Wandler
Seite 11 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Anschluß eines Potentiometers an EURO_535
Seite 12 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Tabelle Wert - Spannung ZahlSpannung / V 00 10, , , , , ,
Seite 13 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Schaltbild ADDA535-Karte
Seite 14 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Tabelle ADCON REGISTER 0DFH0DEH0DDH0DCH0DB0DAH0D9H0D8H 0D9HBDCLK-BSYADMMX2MX1MX0 ADCON BitFunktion MX2 MX1 MX MYMOS ACMOS Anlog Eingang 0 AN0 P6.0 Anlog Eingang 1 AN1 P6.1 Anlog Eingang 2 AN2 P6.2 Anlog Eingang 3 AN3 P6.3 Anlog Eingang 4 AN4 P6.4 Anlog Eingang 5 AN5 P6.5 Anlog Eingang 6 AN6 P6.6 Anlog Eingang 7 AN7 P6.7 ADM"1" Kontinuierliche Wandlung. "0" Stop nach jeder Wandlung BSY"1" Busy Flag / Wandlung findet statt. "0" Wandlung beendet - frei CLK CLK - Wird nicht für A/D-Wandler verwendet BD Baudrate - Wird nicht für A/D-Wandler verwendet
Seite 15 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Tabelle Erhöhung der Auflösung durch Einschränkung des Meßbereiches DAPR DAPR VintAGND Bit VintAREF Bit 00000,05, , , , , , , , , , , , , , , ,68754
Seite 16 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Anzeige des ADDAT-Inhalts im Debug-Programm
Seite 17 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Umsetzung von parallel in seriell
Seite 18 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Einstellungen der seriellen Schnittstelle
Seite 19 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Einstellungen im Terminalprogramm Windows 98
Seite 20 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Wechselspiel zwischen PC und Controller
Seite 21 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Tabelle SCON Bits 09FH09EH09DH09CH09B09AH099H098H 98HSM0SM1SM2RENTB8RB8TIRI SCON BitSymbol SM0 SM Mode 0: Synchroner Modus, feste Baudrate fosc/12 Mode 1: 8-Bit UART, variable Baudrate Mode 2: 9-Bit UART, feste Baudrate fosc/64 oder fosc/32 Mode 3: 9-Bit UART, variable Baudrate SM2Ermöglicht Multiprozessor-Kommunikation in Mode 2 und 3 Empfänger-Interrupt wird nicht ausgelöst, falls das neunte Datenbit "0" ist. In Mode 1 und SM2="1" wird der Interrupt ebenfalls nicht aktiviert falls kein gültiges Stopbit empfangen wird. In Mode 0 muß SM2="0" sein. RENReceiver enable. "1" Gibt den seriellen Empfang durch Software frei. "0" sperrt den Empfang. TB8Übertragungsbit 8. Das neunte Bit für Mode 2 und 3. Wird durch Software gesetzt und rückgesetzt. RB8Empfangsbit 8. Neunte Bit für Empfang in Mode 2 und 3 TIÜbertragungsinterrupt. Wird durch die Hardware am Ende des achten Bits in Mode 0 gesetzt, oder am Beginn des Stop-Bits in den anderen Moden. Muß durch Software zurückgesezt werden. RIEmpfängerinterrupt. Ist das empfangene Interrupt-Flag. Wird am Ende des achten Bits in Mode 0 gesetzt, oder am Beginn des Stop-Bits in den anderen Modi. Muß durch Software zurückgesetzt werden.
Seite 22 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Erzeugen der Baudrate
Seite 23 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Baudraten im ADCON REGISTER A/D-Wandler Steuerung Bitadressierbar 0DFH0DEH0DDH0DCH0DB0DAH0D9H0D8H 0D9HBDCLK- ADCON BitFunktion BDBaudrate - Wird nicht für A/D-Wandler verwendet CLK"1" Der Takt wird nach außen an Pin P1.6/CLKOUT weitergeleitet
Seite 24 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Tabelle Allgemein verwendete Baudraten Baud Rate Mode 1,3 fosc(MHz)SMODC/(/T)TIMER 1 Mode Reload Value 62,5 Kbaud12,01020FFH 19,5 Kbaud11, FDH 9,6 Kbaud11, FDH 4,8 Kbaud11, FAH 2,4 Kbaud11, F4H 1,2 Kbaud11, E8H 110 Baud6,000272H 110 Baud12,00010FEEBH
Seite 25 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Blockschaltbild für Effektivwertmesser
Seite 26 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Abgetasteter Sinus
Seite 27 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Bild Blockschaltbild Zeitgeber 2
Seite 28 Prof. J. WALTER Kurstitel Stand: Oktober 2001 mc Tabelle Verwendete Abkürzungen AbkürzungBedeutung CRCH, CRCLCompare Reload Capture High/Low Register CCH1, CCL1Compare Capture High / Low Register 1 CCH2, CCL2Compare Capture High / Low Register 2 CCH3, CCL3Compare Capture High / Low Register 3