mc Mikrocomputertechnik Kapitel 5 Herzlich Willkommen Prof Jrgen

  • Slides: 28
Download presentation
mc Mikrocomputertechnik - Kapitel 5 Herzlich Willkommen Prof. Jürgen Walter Prof. J. WALTER Kurstitel

mc Mikrocomputertechnik - Kapitel 5 Herzlich Willkommen Prof. Jürgen Walter Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 1

mc Tabelle 5. 1 Verwendete Einheiten - Projekte Projekt verwendete Einheiten 1. Blinklicht mit

mc Tabelle 5. 1 Verwendete Einheiten - Projekte Projekt verwendete Einheiten 1. Blinklicht mit vorgegebener Blinkfrequenz Timer 0, 1 Interrupt 2. A/D-Wandlung A/D-Wandler 3. Serielle Schnittstelle 4. Effektivwertmessung Timer, A/D-Wandler, Serielle Schnittstelle Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 2

mc 3 Goldene Regeln für 8051 Programme · · · Prof. J. WALTER Nur

mc 3 Goldene Regeln für 8051 Programme · · · Prof. J. WALTER 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. Kurstitel Stand: Oktober 2001 Seite 3

mc Standardkopf für Programme · · Prof. J. WALTER Assembler Anweisungen Programmbeschreibung Initialisierungsteil für

mc Standardkopf für Programme · · Prof. J. WALTER Assembler Anweisungen Programmbeschreibung Initialisierungsteil für allgemeine Konstanten Initialisierungsteil für On-Chip Peripherie Kurstitel Stand: Oktober 2001 Seite 4

Assembler-Anweisungen mc $nomod 51 ; der Modus fuer 8051 wird abgeschaltet $debug $nolist ;

Assembler-Anweisungen mc $nomod 51 ; der Modus fuer 8051 wird abgeschaltet $debug $nolist ; es wird kein Listing fuer reg 535 erstellt $include(reg 535. pdf) ; die 80535 -spezifischen Daten $list ; es wird ein Listing erstellt $ title () Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 5

Programmbeschreibung mc ; ------------------------------------; Programmbeschreibung ; ------------------------------------; Programm: ; Datum: ; Programmiert: J. Walter

Programmbeschreibung mc ; ------------------------------------; Programmbeschreibung ; ------------------------------------; Programm: ; Datum: ; Programmiert: J. Walter ; Verwendete Einspruenge: keine ; Verwendete Unterprogramme: keine ; Verwendete Register und Variable: ; Registerbank(0) ; R 2 ; Kommentar: ; ; Aenderungen: ; Datum: ; ; Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 6

mc Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 7

mc Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 7

mc Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 8

mc Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 8

mc Tabelle 5. 11. Codierung Spannung 0 V <=U <= 2 V 2 V<

mc Tabelle 5. 11. Codierung Spannung 0 V <=U <= 2 V 2 V< U <= 3 V 3 V< U <= 4 V 4 V< U <= 5 V Prof. J. WALTER Kurstitel Stand: Oktober 2001 Leuchte 2 AUS EIN Leuchte 3 AUS EIN Seite 9

mc Prof. J. WALTER Bild 5. 11. Blockbild A/D-Wandler Kurstitel Stand: Oktober 2001 Seite

mc Prof. J. WALTER Bild 5. 11. Blockbild A/D-Wandler Kurstitel Stand: Oktober 2001 Seite 10

mc Prof. J. WALTER Bild 5. 12. Anschluß eines Potentiometers an EURO_535 Kurstitel Stand:

mc Prof. J. WALTER Bild 5. 12. Anschluß eines Potentiometers an EURO_535 Kurstitel Stand: Oktober 2001 Seite 11

mc Prof. J. WALTER Tabelle 5. 12. Wert - Spannung Kurstitel Stand: Oktober 2001

mc Prof. J. WALTER Tabelle 5. 12. Wert - Spannung Kurstitel Stand: Oktober 2001 Zahl Spannung / V 0 0 1 0, 01960784 . . . 50 0, 98039216 51 1 52 1, 01960784 . . . 101 1, 98039216 102 2 103 2, 01960784 . . . 254 4, 98039216 255 5 Seite 12

mc Prof. J. WALTER Bild 5. 13. Schaltbild ADDA 535 -Karte Kurstitel Stand: Oktober

mc Prof. J. WALTER Bild 5. 13. Schaltbild ADDA 535 -Karte Kurstitel Stand: Oktober 2001 Seite 13

mc Tabelle 5. 13. ADCON REGISTER 0 DFH 0 D 9 H 0 DEH

mc Tabelle 5. 13. ADCON REGISTER 0 DFH 0 D 9 H 0 DEH BD CLK - 0 DCH BSY 0 DB ADM 0 DAH MX 2 0 D 9 H MX 1 Bit Funktion MX 2 MX 1 MX 0 0 0 1 1 1 0 0 1 1 1 MYMOS ACMOS Anlog Eingang 0 AN 0 P 6. 0 Anlog Eingang 1 AN 1 P 6. 1 Anlog Eingang 2 AN 2 P 6. 2 Anlog Eingang 3 AN 3 P 6. 3 Anlog Eingang 4 AN 4 P 6. 4 Anlog Eingang 5 AN 5 P 6. 5 Anlog Eingang 6 AN 6 P 6. 6 Anlog Eingang 7 AN 7 P 6. 7 ADM "1" Kontinuierliche Wandlung. "0" Stop nach jeder Wandlung BSY "1" Busy Flag / Wandlung findet statt. "0" Wandlung beendet - Prof. J. WALTER 0 DDH MX 0 ADCON frei CLK - Wird nicht für A/D-Wandler verwendet BD Baudrate - Wird nicht für A/D-Wandler verwendet Kurstitel Stand: Oktober 2001 0 D 8 H Seite 14

mc Tabelle 5. 14. Erhöhung der Auflösung durch Einschränkung des Meßbereiches DAPR. 3 -.

mc Tabelle 5. 14. Erhöhung der Auflösung durch Einschränkung des Meßbereiches DAPR. 3 -. 0 DAPR. 4 -. 7 Vint. AGND 0. - 3. Bit Vint. AREF 4. - 7. Bit 0000 0, 0 5, 0 0001 0, 3125 - 0010 0, 625 - 0011 0, 9375 - 0100 1, 25 0101 1, 5625 0110 1, 875 0111 2, 1875 1000 2, 5 1001 2, 8125 1010 3, 125 1011 3, 4375 1100 3, 75 1101 - 4, 0625 1110 - 4, 375 1111 - 4, 68754 Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 15

mc Prof. J. WALTER Bild 5. 14. Anzeige des ADDAT-Inhalts im Debug-Programm Kurstitel Stand:

mc Prof. J. WALTER Bild 5. 14. Anzeige des ADDAT-Inhalts im Debug-Programm Kurstitel Stand: Oktober 2001 Seite 16

mc Prof. J. WALTER Bild 5. 15. Umsetzung von parallel in seriell Kurstitel Stand:

mc Prof. J. WALTER Bild 5. 15. Umsetzung von parallel in seriell Kurstitel Stand: Oktober 2001 Seite 17

mc Prof. J. WALTER Bild 5. 16. Einstellungen der seriellen Schnittstelle Kurstitel Stand: Oktober

mc Prof. J. WALTER Bild 5. 16. Einstellungen der seriellen Schnittstelle Kurstitel Stand: Oktober 2001 Seite 18

mc Prof. J. WALTER Bild 5. 17. Einstellungen im Terminalprogramm Windows 98 Kurstitel Stand:

mc Prof. J. WALTER Bild 5. 17. Einstellungen im Terminalprogramm Windows 98 Kurstitel Stand: Oktober 2001 Seite 19

mc Prof. J. WALTER Bild 5. 18. Wechselspiel zwischen PC und Controller Kurstitel Stand:

mc Prof. J. WALTER Bild 5. 18. Wechselspiel zwischen PC und Controller Kurstitel Stand: Oktober 2001 Seite 20

mc Tabelle 5. 15. SCON Bits 09 FH 98 H SM 0 Bit SM

mc Tabelle 5. 15. SCON Bits 09 FH 98 H SM 0 Bit SM 1 09 DH SM 2 09 CH REN 09 B 09 AH TB 8 RB 8 099 H TI 098 H RI SCON Symbol SM 0 SM 1 0 0 1 1 0 1 Prof. J. WALTER 09 EH Mode 0: Mode 1: Mode 2: Mode 3: Synchroner Modus, feste Baudrate fosc/12 8 -Bit UART, variable Baudrate 9 -Bit UART, feste Baudrate fosc/64 oder fosc/32 9 -Bit UART, variable Baudrate SM 2 Ermö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 SM 2="1" wird der Interrupt ebenfalls nicht aktiviert falls kein gültiges Stopbit empfangen wird. In Mode 0 muß SM 2="0" sein. REN Receiver enable. "1" Gibt den seriellen Empfang durch Software frei. "0" sperrt den Empfang. TB 8 Übertragungsbit 8. Das neunte Bit für Mode 2 und 3. Wird durch Software gesetzt und rückgesetzt. RB 8 Empfangsbit 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. RI Empfä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. Kurstitel Stand: Oktober 2001 Seite 21

mc Prof. J. WALTER Bild 5. 19. Erzeugen der Baudrate Kurstitel Stand: Oktober 2001

mc Prof. J. WALTER Bild 5. 19. Erzeugen der Baudrate Kurstitel Stand: Oktober 2001 Seite 22

mc Baudraten im ADCON REGISTER A/D-Wandler Steuerung Bitadressierbar 0 DFH 0 D 9 H

mc Baudraten im ADCON REGISTER A/D-Wandler Steuerung Bitadressierbar 0 DFH 0 D 9 H Prof. J. WALTER BD 0 DEH CLK 0 DDH 0 DCH 0 DB 0 DAH 0 D 9 H - ADCON Bit Funktion BD Baudrate - Wird nicht für A/D-Wandler verwendet CLK "1" Der Takt wird nach P 1. 6/CLKOUT weitergeleitet Kurstitel Stand: Oktober 2001 0 D 8 H außen an Pin Seite 23

mc Tabelle 5. 17. Allgemein verwendete Baudraten Baud Rate Mode 1, 3 fosc(MHz) SMOD

mc Tabelle 5. 17. Allgemein verwendete Baudraten Baud Rate Mode 1, 3 fosc(MHz) SMOD C/(/T) TIMER 1 Reload Mode Value 62, 5 Kbaud 12, 0 1 0 2 0 FFH 19, 5 Kbaud 11, 059 1 0 2 0 FDH 9, 6 Kbaud 11, 059 0 0 2 0 FDH 4, 8 Kbaud 11, 059 0 0 2 0 FAH 2, 4 Kbaud 11, 059 0 0 2 0 F 4 H 1, 2 Kbaud 11, 059 0 0 2 0 E 8 H 110 Baud 6, 0 0 0 2 72 H 110 Baud 12, 0 0 0 1 0 FEEBH Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 24

mc Prof. J. WALTER Bild 5. 20. Blockschaltbild für Effektivwertmesser Kurstitel Stand: Oktober 2001

mc Prof. J. WALTER Bild 5. 20. Blockschaltbild für Effektivwertmesser Kurstitel Stand: Oktober 2001 Seite 25

mc Prof. J. WALTER Bild 5. 21. Abgetasteter Sinus Kurstitel Stand: Oktober 2001 Seite

mc Prof. J. WALTER Bild 5. 21. Abgetasteter Sinus Kurstitel Stand: Oktober 2001 Seite 26

mc Prof. J. WALTER Bild 5. 22. Blockschaltbild Zeitgeber 2 Kurstitel Stand: Oktober 2001

mc Prof. J. WALTER Bild 5. 22. Blockschaltbild Zeitgeber 2 Kurstitel Stand: Oktober 2001 Seite 27

mc Tabelle 5. 18. Verwendete Abkürzungen Abkürzung Bedeutung CRCH, CRCL Compare Reload Capture High/Low

mc Tabelle 5. 18. Verwendete Abkürzungen Abkürzung Bedeutung CRCH, CRCL Compare Reload Capture High/Low Register CCH 1, CCL 1 Compare Capture High / Low Register 1 CCH 2, CCL 2 Compare Capture High / Low Register 2 CCH 3, CCL 3 Compare Capture High / Low Register 3 Prof. J. WALTER Kurstitel Stand: Oktober 2001 Seite 28