08 mikrokontrolery rodziny 8051

background image

Mikrokontrolery rodziny 8051

Dariusz Chaberski

background image

8051

2

background image

§ PDIP package

3

background image

§ Memory Structure

4

background image

§ Program Memory

z

5

background image

§ Executing from External Program Memory

6

background image

§ Accessing External Data Memory

7

background image

§ Internal Data Memory

8

background image

§ Lower 128 Bytes of Internal RAM

9

background image

§ Upper 128 Bytes of Internal RAM (8052 Extension)

10

background image

§ SFR Space

11

background image

§ Program Status Word

12

background image

§ State Sequence

+ 1-byte, 1-cycle Instruction, e.g., INC A

+ 2-byte, 1-cycle Instruction, e.g., ADD A,#data

13

background image

§

+ 1-byte, 2-cycle Instruction, e.g., INC DPTR

+ MOVX (1-byte, 2-cycle)

14

background image

§ Bus Cycles in 80C51 Family Devices Executing from External Program Memory

+ Without a MOVX

15

background image

§

+ With a MOVX

16

background image

§ Interrupt Enable (IE) Register

17

background image

§ Interrupt Priority (IP) Register

18

background image

§ Interrupt Control System

19

background image

§ SFR Memory Map

20

background image

§ 80C51 Port Bit Latches and I/O Buffers

+ Port 0 Bit

21

background image

§

+ Port 1 Bit

22

background image

§

+ Port 2 Bit

23

background image

§

+ Port 3 Bit

24

background image

§ Timer/Counter Mode 0: 13-Bit Counter

25

background image

§ Timer/Counter Mode 2: 8-Bit Auto-Load

26

background image

§ Timer/Counter 0 Mode 3: Two 8-Bit Counters

27

background image

§ instrukcje

+ operacje arytmetyczne

ADD A, Rn/adr/@Ri/#dana - A=A+Rn/(adr)/(Ri)/#dana

ADDC A, Rn/adr/@Ri/#dana - A=A+Rn/(adr)/(Ri)/#dana+C

SUBB A, Rn/adr/@Ri/#dana - A=A-Rn/(adr)/(Ri)/#dana-C

INC A/Rn/adr/@Ri/DPTR - A/Rn/(adr)/(Ri)/DPTR=A/Rn/(adr)/(Ri)/DPTR+1

DEC A/Rn/adr/@Ri - A/Rn/(adr)/(Ri)=A/Rn/(adr)/(Ri)-1

MUL AB - B:A=A*B

DIV AB - A=Int(A/B), B=Mod(A/B)

DA - if((A(3..0)>9) || AC==1) A(3..0)=A(3..0)+6, if((A(7..4)>9) || CY==1) A(7..4)=A(7..4)+6

28

background image

§

+ operacje logiczne

ANL A, Rn/adr/@Ri/#dana - A=A&Rn/(adr)/(Ri)/#dana

ANL adr, A/#dana - (adr)=(adr)&A/#dana

ORL A, Rn/adr/@Ri/#dana - A=A|Rn/(adr)/(Ri)/#dana

ORL adr, A/#dana - (adr)=(adr)|A/#dana

XRL A, Rn/adr/@Ri/#dana - A=AˆRn/(adr)/(Ri)/#dana

XRL adr, A/#dana - (adr)=(adr)ˆA/#dana

CLR A - A=0

CPL A - A=0xFF-A

RL A - A(n+1)=A(n), A(0)=A(7)

RLC A - A(n+1)=A(n), n=0..6, A(0)=C, C=A(7)

RR A - A(n)=A(n+1), A(7)=A(0)

RRC A - A(n)=A(n+1), n=0..6, A(7)=C, C=A(0)

SWAP A - A(7..4)<->A(3..0)

29

background image

§

+ rozkazy przesłań

MOV A, Rn/adr/@Ri/#dana - A=Rn/(adr)/(Ri)/#dana

MOV Rn, A/adr/#dana - Rn=A/(adr)/#dana

MOV adr, A/Rn/adr1/@Ri/#dana - (adr)=A/Rn/(adr1)/(Ri)/#dana

MOV @Ri, A/adr/#dana - (Ri)=A/(adr)/#dana

MOV DPTR,#dana 16 - DPTR=#dana 16

MOVC A, @A+DPTR/@A+PC - A=(A+DPTR)/(A+PC)

MOVX A, @Ri/@DPTR - A=(256*P2+Ri)/(DPTR)

MOVX @Ri/@DPTR, A - (256*P2+Ri)/(DPTR)=A

XCH A, Rn/adr/@Ri - A<->Rn/(adr)/(Ri)

XCHD A, @Ri - A(3..0)<->(Ri)(3..0)

PUSH adr - SP=SP+1, (SP)=(adr)

POP adr - (adr)=(SP), SP=SP-1

NOP

30

background image

§

+ instrukcje bitowe

MOV C, bit - C=bit

MOV bit, C - bit=C

CLR C/bit - C/bit=0

SETB C/bit - C/bit=1

CPL C/bit - C/bit=1-C/bit

ANL C, bit/(1-bit) - C=C&bit/(1-bit)

ORL C, bit/(1-bit) - C=C|bit/(1-bit)

31

background image

§

+ Skoki i wywołania podprogramów

AJMP adr 11

LJMP adr 16

SJMP rel

JMP @A+DPTR - PC=A+DPTR

JC/JNC/JZ/JNZ rel

JB/JNB/JBC bit, rel

CJNE A, adr/#dana, rel

CJNE Rn/@Ri, #dana, rel

DJNZ Rn/adr, rel

ACALL adr 11

LCALL adr 16

RET

RETI

32

background image

ADuC 812

33

background image

§ QFP package

34

background image

§ Program and Data Memory Maps

35

background image

§ Internal ADC Structure

36

background image

§ ADC Result Format

37

background image

§ Typical DMA External Memory Preconfiguration

38

background image

§ Typical External Memory Configuration Post ADC DMA Operation

39

background image

§ DMA Cycle

40

background image

§ Timer/Counter 2, 16-Bit Autoreload Mode

41

background image

§ Timer/Counter 2, 16-Bit Capture Mode

42

background image

§ External Data Memory Interface (16 M Bytes Address Space)

43

background image

CY7C 68013

44

background image

§ QFP package

45

background image

§ FX2 Block Diagram

46

background image

§ FX2 Block Diagram

47

background image

§ FX2 to Standard 8051 Timing Comparison

48

background image

§ Special Function Registers

49

background image

§ Internal Code Memory, EA = 0

50

background image

§ External Code Memory, EA = 1

51

background image

§ Register Addresses

52

background image

§ Endpoint Configurations (High-speed Mode)

53

background image

§ Default High-Speed Alternate Settings

54

background image

§ GPIF’s Place in the FX2 System

55

background image

§ USB Interrupts

56

background image

§ The USB Autovector Mechanism in Action

57

background image

§ EP2/4/6/8CFG - Endpoint 2/4/6/8 Configuration (E612-E615)

VALID: 1 = activate

DIR: 0 = OUT, 1 = IN

TYPE

SIZE: 0 = 512 bytes, 1 = 1024 bytes

BUF

58

background image

§ EP2/4/6/8CS Endpoint 2/4/6/8 Control and Status (E6A3-E6A6)

NPAK2:0: Number of Packets in FIFO

FULL: Endpoint FIFO Full

EMPTY: Endpoint FIFO Empty

STALL: ENDPOINT STALL

59

background image

§ EP2468STAT Endpoint(s) 2,4,6,8 Status Flags (SFR 0xAA)

SFR and FX2 Register File Correspondences

60

background image

§ EP2/6BCH Endpoint 2/6 Byte Count HIGH (E690/E698)

§ EP4/8BCH Endpoint 4/8 Byte Count HIGH (E694/E69C)

61

background image

§ EP2/4/6/8BCL Endpoint 2/4/6/8 Byte Count LOW (E691,E695,E699, E69D)

EP2BCL = 0x01;

// commit newly sourced pkt. to interface fifo

EP2BCL = 0x80;

// arm EP2OUT by writing to the byte count w/skip

62


Wyszukiwarka

Podobne podstrony:
Mikrokomputer edukacyjny z 8051 cz 2
fras,systemy wbudowane L, Wstęp do mikrokontrolerów rodziny MCS 51
09 8 bitowe mikrokontrolery rodziny PIC
32 32 bitowe mikrokontrolery rodziny AVR
06 8 bitowe mikrokontrolery rodziny AVR
10 mikrokontrolery rodziny M68
2250 Mikrokomputer edukacyjny z 8051 1
Mikrokontrolery rodziny AVR w obudowach 8 wyprowadzeniowych
Mikrokomputer edukacyjny z 8051 cz 2

więcej podobnych podstron