PIC???????? - PowerPoint PPT Presentation

1 / 62
About This Presentation
Title:

PIC????????

Description:

Title: PowerPoint Last modified by: LAN-ZHU1 Created Date: 1/1/1601 12:00:00 AM Document presentation format: Other titles – PowerPoint PPT presentation

Number of Views:163
Avg rating:3.0/5.0
Slides: 63
Provided by: dian218
Category:
Tags: pic

less

Transcript and Presenter's Notes

Title: PIC????????


1
PIC????????
2005.12
2
????
  • ?????
  • PIC??????
  • PIC????????

3
?????
  • ???????,2001????????7??70??,?????????????6??,??16
    ????? 2002??8?????????45?????2004??2006?8???????
    ?????54??60????
  • ?? RMW 7 ??????????63?????
  • MOTOROLA?????2010????????????351??????????
  • ??????????
  • MCU ,MicroController Unit

4
?????
  • ?????
  • ?CPU?RAM?ROM?I/O??????????????
  • ????????????????????????????????????????

???
? ?
????
????
???
CPU
ROM
RAM
I/O
???
?????????
?????????
5
?????
  • ???????,?????????
  • ??
  • ????
  • ???????
  • ?????
  • ????
  • ????
  • ??
  • ????
  • ????
  • ????

????? ????? ??????
? ? ?
?????
???
?????????
6
?????
  • ????????????????
  • ??? ROM ? RAM ????
  • ???????????
  • ????(I/O)?????????????
  • ????????
  • ?????????????????

7
PIC ??????
  • ??????

? ?
????
8
8
8
CPU
ROM
RAM
I/O
ROM
CPU
RAM
I/O


8b
8b
8b
12b16b
???????(?.???)??
PIC?????(??)??
?? ??
RISC
?? ?? ?? ??
CISC
?? ??

?? ??
PIC ?????????????????
8
PIC ??????
  • ??????

???????????,ROM?RAM????????,????? ????????????????
?????????? MCS-51??ROM?RAM??8?,????13??,????! PI
C12C50X/PIC16C5X ???????????12? PIC16C6X/7X / 8X
???????????14? PIC17CXX ???????????16?
PIC ?????????????????
9
PIC ??????
  • ?????(RISC)??

PIC????????????35???,???20? ???????????????,???
??! MCS-51??????????111???!
PIC ?????????????????
10
PIC ??????
  • ??????

PIC???????4????? ??????????????????????
MCS-51 ???????7?????!
PIC ?????????????????
11
PIC ??????
  • ??????

1K???????? PIC?????????1024??? MCS-51
???????????600???
2.24
2.10
1.55
1.51
??????
1.29
1.00
MCC
PIC
COP800
ST82
68HC05
8051
Z86
?????????????
PIC ?????????????????
12
PIC ??????
  • ?????

?????????,????????????????! PIC17CXX??????????????
?
1.00
Fastest
0.30
??????
0.212
0.136
0.108
0.046
PIC
COP800
ST82
68HC05
8051
Z86
20MHz
20MHz
20MHz
8MHz
4.2MHz
12MHz
????????????
PIC ?????????????????
13
PIC ??????
  • ???

PIC??????????????????? ?4MHz???????????2mA,???????
?????1µA ???
PIC ?????????????????
14
PIC ??????
  • ?????

I/O???????,??I/O??????????????????25mA?20mA,??????
?????LED???????????????
PIC ?????????????????
15
PIC ??????
  • I2 ? SPI ??????

I2(Inter IC Bus)? SPI( Seril Peripheral
Interface)???????????????????????????????,????????
??????,??????????????? ??????????I2???
PIC ?????????????????
16
PIC ??????
  • ????????

PIC???????????????????????????(?????)?? ?????????
???????????
PIC ?????????????????
17
PIC ??????
  • ??????

PIC?????????????????I/O??????????????,????????????
????,??????????
PIC ?????????????????
18
PIC ??????
  • ????

?????????????????????????????(MPLABIDE),??PIC????
????????,???????????????????,???????????? ????????
???????(?????),???500? 2000????
PIC ?????????????????
19
PIC ??????
  • C????

?????C?????,?????????C??????,??C????????,?????????
?
PIC ?????????????????
20
PIC ??????
  • ?????????????

PIC???????????????????????????????,?????8??64?,???
??????????? ????,PIC???????????????,???????,??????
?????,???????????????????? ??,?????????????I/O???R
AM?????????????????????,???40??????????,?????,????
?????PIC12C508?????8???,???????????
PIC ?????????????????
21
PIC ??????
  • ??????

???? ???? ????
PIC17C4X PIC17C4XA PIC17CR4X 16????? 8???? ???? DC 25MHz?? ??160ns???? 1???????8????? ????(?????DSP) OTP/EPROM OTP/EPROM ROM(??)
PIC ?????????????????
22
PIC ??????
  • ??????

???? ???? ????
PIC16C6X PIC16C6XA PIC16CR6X PIC16C62X PIC16C7X PIC16C8X PIC16F8X PIC16CR8X PIC16C9XX PIC114000 14????? 8???? ???? DC 25MHz?? ??200ns???? 8?A/D( PIC16C7X) ???? E2PROM ( PIC16C8X) LCD?? ( PIC16C9XX) ??????( PIC14000) OTP/EPROM OTP/EPROM () OTP/EPROM (C) E2PROM Flash ROM (??) OTP/EPROM (LCD) OTP/EPROM ()
PIC ?????????????????
23
PIC ??????
  • ???????

???? ???? ????
PIC16C5X PIC16CR5 PIC12C5XX 12????? 8???? DC 25MHz?? ??200ns???? ?8???(PIC12C5XX) ???? OTP/EPROM ROM(??) OTP/EPROM (8???)
PIC ?????????????????
24
PIC ??????
  • ?????????
  • ????EPROM??FLASH??,?????????????
  • ????(OPT)?EPROM??,?????????????????
  • ROM?????,????????????????

PIC ?????????????????
25
PIC ??????
  • ??????????
  • ????????,??????????????
  • ???????PIC??????????,????????????,????????,??????
    ???,PIC????????,???????????

PIC ?????????????????
26
8????8?CMOS??? PIC12F629/675????
  • ?35??????????????
  • DC20MHz??DC200ns????
  • 32KHz????????8.5uA??nA?
  • ????? 4MHz ? 1 ???
  • ??3.0V?,?CPU?????????5us
  • ???????????????
  • POR?PWRT?OST?BOD?WOT?MCLR
  • ??????????????????
  • ?????/EEPROM?????10??
  • 6???I/O675?10?A/D????

27
PIC12F629/675?????????
  • PIC12F629/675??????

Flash?? ??? 1K 14
RAM ??? 648
?????PC
8???13?
GP0/AN0/CIN GP1/AN1/CIN-VREF GP2/AN2/T0CK/INT/COU
T GP3/MCLR/VPP GP4/AN3/T1G/OSC2/CLKOUT GP5/T1CKI/O
SC1/CLKIN
PORT
??????? ??????? ???? ?????? ???? ?????
FSR???
?????
??4MHz???
?????
???????
????
?????
W ???
???0
T1G T1CKI T0CKI
EEPROM 128??
? ? ? ????
A/D???
???1
AN0 AN1 AN2 AN3
CIN- CIN COUT
28
PIC12F629/675?????????
  • PIC12F629/675?????????

OSC1
Q1
Q2
Q3
Q4
PC
??(PC)
??(PC-1)
??(PC1)
??(PC)
??(PC2)
??(PC1)
29
PIC12F629/675?????????
  • PIC12F629/675?????????

PC (120)
13
CALL, RETURN RETFIE, RETLW
??1

??8

????

????
???????
??
???????
0000h
0004h
0005h

03FFh
0400h
1FFFh
30
PIC12F629/675?????????
  • PIC12F629/675?????????

?????
?????
???? ????
TMR0 OPTION
PCL PCL
STATUS STATUS

ADCON0 ANSEL
????? 64 Bytes ????? ??
80
00
81
01
82
02
?????
?????
83
03


9F
1F
A0
20
BF

C0
7F
FF
Bank 0
Bank 1
31
PIC12F629/675?????????
  • PIC12F629/675 I/O ??GPIO ? TRISO ???

TRISO??GPIO ?????????? 1 ??
0 ??
GPIO ??????
CLRF GPIO ??? GPIO BCF STATUS,PRO ??Bank0 MOV
LW 07h ?GPlt20gt???IO MOVWF CMCON BSF
STATUS,PRO ??Bank1 CLRF ANSEL ??????? MOVLW
B00001100 ????????? MOVWF TRISO ?GPlt32gt???
?RAlt54,10gt? ??
32
PIC12F629/675?????????
  • GPIO ???????
  • 05h GPIO ???,????6??????
  • 0Bh/8Bh INTCON ???????,???????
  • 19h CMCON ????????,?????????
  • 81h OPTION-REG ?????,???????
  • 85h TRISIO GPIO????????,??????????
  • 95h WPU ??????,??GPlt54,20gt???????
  • 96h IOC ???????????,??IOClt50gt??????
  • 9Fh ANSEL ???????,?????I/O?A/D?A/D??

33
PIC12F629/675?????????
  • TIMER0 ??? / ???
  • ????
  • 8????/??????
  • 8???????????????????
  • FFh?00h???????????????
  • ??????
  • ??T0CS?(OPTION-REGlt5gt)?????
  • ??T0CS?(OPTION-REGlt5gt)?????

TIMER0?????TMR0?INTCON?OPTION-REG?TRISIO?
34
PIC12F629/675?????????
  • TIMER1 16? ??? / ???

T1CONTIMER1????? (??10h)
U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TMR1GE T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON
Bit 0
Bit 7
Bit 6 1????TIMER10???? Bit lt54gt?????
0011?0112?1014?1118 Bit
3????LP???(INTOSC??????) Bit 2
1??????????,0??(TMR1CS0) Bit 1 ?????
1??T1OSO/T1CKI??0????(Fosc/4) Bit 0
TIMER1???? 1??TIMER1,0??TIMER1
35
PIC12F629/675?????????
  • TIMER1 16? ??? / ???

????????16????16???????????? ??????(?FFFFh???0
000h)????? ???1?2?4?8????T1CONlt54gt??,?????
TMER1H?TMER1L??????? ???????????????????? ????
?????(T1G)??LP??? ????????????? ???????INCON?P
IR1?TMR1L?TMR1H?PIE1?
36
PIC12F629/675?????????
  • ?????

CMCON??????? (??19h)
U-0 R-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
CON CINV CIS CM2 CM1 CM0
Bit 0
Bit 7
Bit 6 ????????,CINV1?1VIN lt
VIN- 0VIN gt VIN- Bit 4?????????
1????,0????? Bit 3??????????110?101???,1VIN-
???CIN 0VIN-???CIN- Bit lt20gt
???????????????VREF?????????
37
PIC12F629/675?????????
  • ???????

VIN

???? CINV COUT
VIN- gt VIN 0 0
VIN- lt VIN 0 1
VIN- gt VIN 1 1
VIN- lt VIN 1 0
??
-
VIN-
VIN-
VIN
??
???????INCON?PIR1?PIE1?TRISIO?VRCON
38
PIC12F629/675?????????
  • PIC12F675??????

????
VDD
VCFG0
VCFG1
VREF
GP0/AN0 GP1/AN1/VREF GP2/AN2 GP4/AN3
ADC
10
GO/DONE
10
ADON
CHS1CHS0
ADRESH
ADRESL
39
PIC12F629/675?????????
  • PIC12F675??????

ADCONAD????? (??1Fh)
R/W-0 R/W-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
ADFM VCFG CHS1 CHS0 GO/DONE ADON
Bit 0
Bit 7
Bit7 AD??????? 1 ???0??? Bit 6VCFG??????
1??VREF?????,0??VDD Bit lt32gt ??????? Bit
1 AD??????1 A/D??????,0A/D????/??? Bit 0
AD???????1??A/D??,0??A/D,???
40
PIC12F629/675?????????
  • PIC12F675??????

ANSEL??????? (??9Fh)
U-0 R/W-0 R/W-0 R/W-0 R/W-1 R/W-1 R/W-1 R/W-1
ADCS2 ADCS1 ADCS0 ANS3 ANS2 ANS1 ANS0
Bit 0
Bit 7
Bit lt64gt AD???????000110FOSC/2FOSC/64 ?
FRC Bit lt30gt ?????(???????????????)? 1
????,0 ?? I/O?
A/D?????? TACQ ??????????????????? 19.72
us ?
41
PIC12F629/675?????????
  • PIC12F629/675CPU???????

CONFIG??? (??2007h)
R/P-1 R/P-1 R/P-1 R/P-1 R/P-1 R/P-1 R/P-1 R/P-1
CP BODEN MCLRE PWRTE WDTE FOSC2 FOSC1 FOSC0
Bit 0
Bit 7
R/P-1 R/P-1 U-0 U-0 U-0 R/P-1
BG1 BG0 CPD
Bit 8
Bit 13
Bit lt1312gt BOD?POR?????????00??,11?? Bit 8
????????1???????????,0???? Bit 7
????????1???????????,0????
42
PIC12F629/675?????????
  • PIC12F629/675CPU???????

Bit 6 ????????1 ??BOD,0 ??BOD Bit 5 GP3
/ MCLR?????? 1 ?????MCLR,0 I/O Bit 4
???????????1 ??PWRT,0 ??PWRT Bit 3
??????????1 ??WDT,0 ??WDT Bit lt20gt
?????? 111?110 RC ???(?????????)
101?100 INTOSC ??? (?????????) 011 EC
010 HS ??? 001 XT ??? 001 LP
??? ?
43
PIC16F72?????????
  • PIC16F72????

Flash?? ??? 2K 14
RAM ??? 1288
RA0/AN0 RA3/AN3/VREF RA4/T0CK1 RA5/AN4/SS
PORT A
?????PC
8???13?
PORT C
RC0/T1OSO/T1CK1 RC1/T1OSI/CCP2 RC2/CCP1 RC3/SCK/S
CL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT
??????? ??????? ???? ???? ?????
FSR???
?????
?????
???????
PORT B
????
RB0/INT RB1 RB7
?????
W ???
???0
???1
???2
A/D???
?????
CCP1
44
PIC16F72?????????
  • PIC16F72?????????

OSC1
Q1
Q2
Q3
Q4
PC
??(PC)
??(PC-1)
??(PC1)
??(PC)
??(PC2)
??(PC1)
45
PIC16F72?????????
  • PIC16F72?????????

PC (14?)
14
CALL, RETURN RETFIE, RETLW
??1

??8

????

????????
???????
??
???????
0000h
0004h
0005h

07FFh
0800h
1FFFh
46
PIC16F72?????????
  • PIC16F72?????????

?????
?????
???? ????
TMR0 OPTION
PCL PCL
STATUS STATUS

ADCON0 ADCON1
????? ????? ??
80
00
81
01
82
02
?????
?????
83
03


9F
1F
A0
20
BF

C0
7F
FF
Bank 0
Bank 1
47
PIC16F72?????????
  • PIC16F72 I/O ??PORT A ? TRISA???

TRISA??PORTA ??????????
PORT A
RA0 / AN0 RA1 / AN1 RA2 / AN2 RA3 / AN3/VREF RA4
/ T0CK1 RA5 / AN4/SS
PORT A ??????
CLRF PORTA PORTA???? BSF STATUS,PRO ??Bank1 M
OVLW B11001111 ????????? MOVWF
TRISA ?RAlt13gt??? ?RAlt45gt??? D7?D6?????
0
48
PIC16F72?????????
  • PIC16F72 I/O ??PORT B ? TRISB???

PORTB????????I/O??????????????????
PORT B ??????
PORT B
RB0/INT RB1 RB7
CLRF PORTB PORTB ????????? BSF
STATUS,PRO PR0?1??Bank1 MOVLW 0x3C
00111100????????? MOVWF TRISB ?RBlt25gt??? ?
RBlt01,67gt???
??RB???,PBlt47gt????????????????????
49
PIC16F72?????????
  • PIC16F72 ??? / ???

T0CS TMRO???? ? ? ? ?
0 ??? ???????1(????)
1 ??? RA4/T0CKI ?????????1
TMR1CS TMR1???? ? ? ? ?
0 ??? ???????1(????)
1 ??? RC0/T1OSO/T1CKI?????????1
TMR2???8?????/???,??????????????????????PWM(CCP???
PWM??)????
50
PIC16F72?????????
  • PIC16F72 ????? WDT
  • WDT?????,??????????,???????????
  • ??????18ms???1128,?128???,?????2.3s?
  • ????????,? WDT ?????? CLRWDT ???
  • ?????????,?? CONFIG ??? WDTE ?0

51
PIC16F72?????????
  • PIC16F72 CCP ??

- - CCP1X CCP1Y CCP1M3 CCP1M2 CCP1M1 CCP1M0
? ? CCP1CON17h ?????00h
??,????0
CCPx ????
10?PWM????2???
0000 ??(?? )CCPx?? 0100 0111 ???? 1000 1011
???? 11XX PWM ??
RC2/CCP1???????,????TMR1?16???
CCPR1?TMR1????,RC2/CCP1??????????????
CCP2/CCP1?????10?????????
CCP1CON / CCP2CON???????
52
PIC16F72?????????
  • PIC16F72 ????
  • ????? SSP ?????????SPI ? I2C ????????
  • SPI???????????????8???,?SSP?????SSPSTAT?SSP?????S
    SPCON???
  • ?????(I2C)????????
  • ?????? SCI ?????TXSTA?RCSTA??????????
  • ??RC6?RC7?????????????????,??????? ???????
  • ?????????
  • ??????????

53
PIC16F72?????????
  • PIC16F72 A/D?????????ADCONx

ADCON0 ??A/D??????
? ? ADCON008h ?????00h
ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/D ADIF ADON
A/D?????
A/D?????????
A/D?????1??,0????
A/D???????
A/D???????
ADCON1 ????A/D?????
? ? ADCON19Fh ?????00h
- - - - - PCFG2 PCFG1 PCFG0
A/D?????????
54
PIC16F72?????????
  • PIC16F72 A/D????A/D???????

PCFG2 PCFG1 PCFG0 RA0 RA1 RA2 RA5 RA3 VREF
0 0 0 A A A A A VDD
0 0 1 A A A A VREF RA3
0 1 0 A A A A A VDD
0 1 1 A A A A VREF RA3
1 0 0 A A D D A VDD
1 0 1 A A D D VREF RA3
1 1 x D D D D D -
55
PIC16F72?????????
  • PIC16F72 A/D?????RA0????A/D??

BSF STATUS,PRO ????1 CLRF ADCON1 ??A/D?????? BS
F PIE1,ADIE ??A/D?? BCF STATUS,PR0 ????0 MOVLW 0
xC1 RC??,??A/D???,????0 MOVWF ADCON0 A/D???RC,
RA0?A/D??? BCF PIR1,ADIF ?A/D????? BSF INTCON,PEI
E ?????????? BSF INTCON,GIE ????? BSF ADCON0,GO
??A/D??
56
PIC ??????????
  • ?????????

?? ?????? ???1,???2 ?? Lable BSF
STATUS,PRO ????1
  • ?????
  • MOVLW 0x5A 5Ah ?W???
  • ???????????????????FSR?,????
  • ?????INDF???????
  • ????
  • MOVF REG1,0 ????EG1?????W???
  • ???
  • BCF REG1,0 ????REG1?D0???

57
PIC ??????????
  • ????
  • ???????
  • ??????
  • ???????????
  • ???PIC16C5X??????33???,??????12?
  • ??PIC16C6X/7X/8X???????35?,??????14?
  • ??PIC17CXX???????55?,??????16?

58
PIC????????????
  • ???????

????RB???????????
59
PIC????????????
  • ?????????????

START
RB????????
??RC?????
??RB?????
??RB?????
??????????
??????
INT?RB??????
?????????
?RC??????
E N D
????RB???????????
60
PIC????????????
  • ???????????

61
PIC????????????
  • ??????????????

?? ??
? ? ? ? ? ?
???
PWM??
ABC
????
?? ??
??? ???
?? ?? ?? ??
??
(U?V?W)
?? ??
??? ???
(PIC16F72)
?? ??
??? ???
?? ??
62
? ?!
Write a Comment
User Comments (0)
About PowerShow.com