PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051...
Transcript of PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051...
![Page 1: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/1.jpg)
1
![Page 2: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/2.jpg)
2
รายวชา 6562213 ไมโครโพรเซสเซอร 1
โดย
ผชวยศาสตราจารย ธระ กาญจนสนธ
วท.ม.(ฟสกส) วท.บ.(ฟสกส)
บทเรยนออนไลน
6562213 Microprocessor 1
มหาวทยาลยราชภฏนครปฐม
ยนดตอนรบส...
คณะวทยาศาสตรและเทคโนโลย
![Page 3: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/3.jpg)
6562213 ไมโครโพรเซสเซอร 1
จดประสงคการเรยนรของรายวชา 6562213 ไมโครโพรเซสเซอร 1
3
1) เพอใหผเรยนสามารถออกแบบและพฒนาฮารดแวรทมไมโครคอนโทรลเลอร หรอชปตระกล MCS-51เปนหนวยประมวลผล
2) เพอใหผเรยนสามารถพฒนาซอฟตแวรภาษาซ
ในการควบคมการท างานของฮารดแวรทตอวงจรรวม กบชปตระกล MCS-51
3) เพอใหผเรยนสามารถพฒนาเจตคตและมจรรยาบรรณในการคดคนและพฒนาสงประดษฐ โดยใชชปตระกลMCS-51 เปนหนวยประมวลผล
![Page 4: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/4.jpg)
6562213 ไมโครโพรเซสเซอร 1
หวขอส าคญของรายวชา 6562213 ไมโครโพรเซสเซอร 1 บทท 1-6
4
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
บทท 2 โครงสรางภายในของไมโครคอนโทรลเลอร
บทท 3 ชดค าส งแยกตามประเภทการใชงาน
บทท 4 ตวอยางการเขยนโปรแกรมเบองตนและโปรแกรมใชงาน
บทท 5 การออกแบบวงจรหนวยความจ าและอปกรณตอรวม
บทท 6 การประยกตใชงานไมโครคอนโทรลเลอร
![Page 5: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/5.jpg)
5
![Page 6: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/6.jpg)
6562213 ไมโครโพรเซสเซอร 1
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
6
รายวชา 6562213 ไมโครโพรเซสเซอร 1
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
โดยผชวยศาสตราจารยธระ กาญจนสนธ
คณะวทยาศาสตรและเทคโนโลย
มหาวทยาลยราชภฏนครปฐม
![Page 7: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/7.jpg)
6562213 ไมโครโพรเซสเซอร 1 7
บทน า
ในบทน มเนอหาเกยวกบความแตกตางระหวาง CPU กบ MCU MCU นบเปนคอมพวเตอรในรปชปไอซ ทถกสรางขนมาเพอใชในงานควบคมทเฉพาะเจาะจง จงมชอเรยกวา computer in a single chip
ปจจบนม MCU จากบรษทผผลตทหลากหลายซงตางมสมรรถนะทรองรบความตองการของผใชงาน ในดานความเรว-ประหยดพลงงาน-ชองทางสอสาร-รองรบอปกรณรายรอบ
เทคโนโลยทกาวไปสระบบสมองกลฝงตวนบวามรากฐานทพฒนามาจาก MCU
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
![Page 8: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/8.jpg)
6562213 ไมโครโพรเซสเซอร 1 8
หวขอส าคญในบทท 1
1.2ไมโครโพรเซสเซอร
VSไมโครคอนโทรลเลอร
1.3 ตระกลของไมโครคอนโทรลเลอรและความแตกตาง
1.5 การพฒนาฮารดแวรและซอฟตแวรบน MCU
1.6 สถาปตยกรรมของMCU ตระกล MCS-51
1.4 ภาษาทใช
ในการพฒนาโปรแกรมควบคม
1.1 ทบทวนบต-นบเบล-ไบต-เวรด/ MSB-LSB/ BIN2HEX
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
![Page 9: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/9.jpg)
9
![Page 10: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/10.jpg)
6562213 ไมโครโพรเซสเซอร 1 10
1.1 ทบทวน บต - นบเบล – ไบต – เวรด - ดบเบลเวรด
1เชน...บต (bit) คอ...ขอมลฐานสองขนาด 1 หลก 0หรอ
1001เชน...นบเบล (nibble) คอ...ขอมลฐานสองขนาด 4 หลก 0110หรอ
เชน...
ไบต (byte) คอ...ขอมลฐานสองขนาด 8 หลก
หรอ1001 1110 1011 0110
เชน...
เวรด (word) คอ...ขอมลฐานสองขนาด 16 หลก
หรอ1001 1110 1011 0110 1101 1010 1111 0010
เชน...
ดบเบลเวรด (double word) คอ...ขอมลฐานสองขนาด 32 หลก
1001 1110 1011 0110 1101 1010 1111 0010
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
![Page 11: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/11.jpg)
6562213 ไมโครโพรเซสเซอร 1 11
พฒนาการของ ชปไมโครคอนโทรลเลอร (MCU)
ความเขาใจในนยามของ บต-นบเบล-ไบต-ดบเบลเวรดน าไปสความเขาใจถง...พฒนาการของ ชปไมโครคอนโทรลเลอรเพอรองรบงานนวตกรรมทอ านวยความสะดวกมากขน
ประหยดพลงงาน
รองรบการใชเครอขาย
รองรบการเชอมตอ
รองรบความนรภย
เนนคมอปกรณก าลง
รองรบระบบสมผส
ความเรวประมวลผล
ชองทางสอสาร
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.1 ทบทวน บต - นบเบล – ไบต – เวรด - ดบเบลเวรด
![Page 12: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/12.jpg)
6562213 ไมโครโพรเซสเซอร 1 12
ทบทวน บตนยส าคญสงสด (MSB: Most Significant Bit)บตนยส าคญต าสด (LSB: Least Significant Bit)
ตวอยางขอมลฐานสองขนาด 20 บต 1001 1101 1010 0111 1110
บตสดทายซายมอสด เรยกวา MSB บตสดทายขวามอสด เรยกวา LSB
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.1 ทบทวน บต - นบเบล – ไบต – เวรด - ดบเบลเวรด
![Page 13: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/13.jpg)
6562213 ไมโครโพรเซสเซอร 1 13
ทบทวน การอานในรปเลขฐานสบหกโดยอานเลขฐานสอง...จากขวามอไปซายมอ ทละ 4 บตชวยใหคนเราสอสารกนงายกวา การอานในรปเลขฐานสอง
ตวอยางขอมลฐานสองขนาด 20 บต
1001 1101 1010 0111 1110
อานเปนฐานสบหก จากขวาไปซาย
E7AD9
100111011010011111102 = 9 D A 7 E 16
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.1 ทบทวน บต - นบเบล – ไบต – เวรด - ดบเบลเวรด
![Page 14: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/14.jpg)
14
![Page 15: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/15.jpg)
6562213 ไมโครโพรเซสเซอร 1 15
นยามของไมโครโพรเซสเซอร (CPU)
Microprocessor (CPU)
คอ...หนวยประมวลผลกลาง หรอ CPU (Central Processing Unit)
เปน...หนวยหลกในคอมพวเตอร ท าหนาทควบคมการท างานของอปกรณ/และประมวลผลเลขคณตและตรรกะ/
มโครงสรางภายในทเก ยวของกบเรจสเตอร/บส/หนวยความจ า/ วงจรนบ/วงจรจบเวลา/ชองสอสาร
สามารถประมวลผลค าส งและค านวณขอมลดวยความเรวสง
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.2 ไมโครโพรเซสเซอร VS ไมโครคอนโทรลเลอร
![Page 16: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/16.jpg)
6562213 ไมโครโพรเซสเซอร 1 16
Microcontroller (MCU)
คอ...คอมพวเตอรขนาดเลกเทาชปไอซ
นยมใชในงานควบคมเครองจกรกล
ภายในชปไมโครคอนโทรลเลอรมโครงสรางเหมอนคอมพวเตอร
โดยประกอบดวย 1 ) หนวยประมวลผล 2) หนวยความจ า 3) หนวยรบ/สงขอมล
ตวอยางเชน ระบบขบเคลอนของรถยนตทควบคมโดยกลอง MCU (microcontroller)
นยามของไมโครคอนโทรลเลอร (MCU)
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.2 ไมโครโพรเซสเซอร VS ไมโครคอนโทรลเลอร
![Page 17: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/17.jpg)
6562213 ไมโครโพรเซสเซอร 1 17
คอ...คอมพวเตอรขนาดเลกเทาชปไอซคอ...หนวยประมวลผลกลาง
คอ...CPU คอ...CPU + memory + I/O = computer
รปซายมอ คอ CPU...CPU : Z-80
รปขวามอ คอ MCU...microcontroller : AT89C51
Microcontroller (MCU)Microprocessor (CPU)
ความแตกตาง
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโคร คอนโทรลเลอรพนฐาน
1.2 ไมโครโพรเซสเซอร VS ไมโครคอนโทรลเลอร
![Page 18: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/18.jpg)
6562213 ไมโครโพรเซสเซอร 1 18
Microcontroller (MCU)
ม ROM/ RAM ภายในชป
Microprocessor (CPU)
ไมม ROM/ RAM ภายในชปมเพยง CPU ม CPU+ memory+ I/O อยในชปเดยวกน
Pentium (Intel) 8051 (Intel)PowerPC (Motorolla) 68HC08 (Motorolla)Spark (SUN) AVR (Atmel)Z80 (Zilog) Z8 (Zilog)
PIC (Microchip)ARM (Advance RISC Machine)
ตวอยาง
การใชงาน Desktop/ laptop/
workstations/ Server/TV remote control/ video games/Robot/
General Purpose Specific Purpose
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.2 ไมโครโพรเซสเซอร VS ไมโครคอนโทรลเลอร
![Page 19: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/19.jpg)
19
![Page 20: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/20.jpg)
6562213 ไมโครโพรเซสเซอร 1 20
1.3 ตระกลของไมโครคอนโทรลเลอรและความแตกตาง
Microcontroller Families
คอ...ไมโครคอนโทรลเลอร ทผลตจากหลากหลาย
บรษทผผลตชปช นน าในยโรป เอเชย และอเมรกา
ความแตกตาง
ประหยดพลงงาน
รองรบการใชเครอขาย
รองรบการเชอมตอ
รองรบความนรภย
เนนคมอปกรณก าลง
รองรบระบบสมผส
ชองทางสอสาร
ความแตกตางขนกบ market strategy plan ของบรษทผผลต
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
![Page 21: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/21.jpg)
6562213 ไมโครโพรเซสเซอร 1 21
Microcontroller Families
คอ...ตระกลไมโครคอนโทรลเลอร (MCU) ทบรษทผผลตท วโลกตางอางองและใชเทคโนโลยการผลต ม 4 ตระกลหลกไดแก...1) MCS-51
ความแตกตาง
MCS-51: MiCrocontrollerS-51
89S5289S5189C5289C5189V51……..
PIC: Peripheral Interface Controller
PIC10FxxPIC12FxxPIC16Fxx…………
AVR: Alf and Vegard'sRISC processor
ATmega8ATmega16ATmega32(ATtiny/ ATmega/ Atxmega)
ARM: Advanced RISC Machine
ประหยดพลงงาน
รองรบการใชเครอขาย
รองรบการเชอมตอ
รองรบความนรภย
เนนคมอปกรณก าลง
รองรบระบบสมผส
เนนความปลอดภย
ชองทางสอสาร
21
4) ARM3) AVR2) PIC
LPC2148 ARM Cortex-M0 ARM Cortex-M1ARM Cortex-M2……….ARM Cortex-M6ARM Cortex-M7
MCS-51: MiCrocontrollerS-51
89S5289S5189C5289C5189V51……..
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.3 ตระกลของไมโครคอนโทรลเลอรและความแตกตาง
![Page 22: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/22.jpg)
6562213 ไมโครโพรเซสเซอร 1 22
ความแตกตาง
ประหยดพลงงาน
รองรบการใชเครอขาย
รองรบการเชอมตอ
รองรบความนรภย
เนนคมอปกรณก าลง
รองรบระบบสมผส
เนนความปลอดภย
RISC
ทมา: https://www.technobyte.org/difference-between-risc-and-cisc/
CISCReduced Instruction Set Computing Complex Instruction Set Computing
ชดค าสงขนาดเลกกวาและจ านวนนอยกวา ชดค าสงมากกวาและซบซอนกวา
มค าสงเกยวกบ addressing mode นอยกวา มค าสงเกยวกบ addressing mode มากกวา
ขนาดค าสงคงท (32 บต) ใช 1 m/c cycle ขนาดค าสงใช 2-10 m/c cycle
สมรรถนะการท างานเนนท..ซอฟตแวร สมรรถนะการท างานเนนท..ฮารดแวร
ฮารดแวรไมซบซอน ตนทนการผลตไมสง ฮารดแวรซบซอน ตนทนการผลตสงกวา
ใชพลงงานไฟฟาไมสง ใชพลงงานไฟฟาสงการท างานตอเนองอาจใชกระบวน pipelining การท างานตอเนองใช pipeliningไมได
การปรบความเรวใหสงขนใชชปจ านวนมาก การปรบความเรวใหสงขนใชชปนอยกวา
ตวอยางชป: PIC & ARM ตวอยางชป: x86 & 8051
ตวอยางการใชงาน: Smartphones, PDAs ตวอยางการใชงาน: Security systems, Home automation.
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.3 ตระกลของไมโครคอนโทรลเลอรและความแตกตาง
![Page 23: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/23.jpg)
6562213 ไมโครโพรเซสเซอร 1 23
Microcontroller Families
8051 Microcontroller:Bus width: 8-bit for standard coreCommunication Protocols: UART, USART,SPI,I2CSpeed: 12 Clock/instruction cycleMemory: ROM, SRAM, FLASHISA: CLSCMemory Architecture: Von Neumann architecturePower Consumption: AverageFamilies: 8051 variantsPopular Microcontrollers: AT89C51, P89v51, etc.
ความแตกตาง
ประหยดพลงงาน
รองรบการใชเครอขาย
รองรบการเชอมตอ
รองรบความนรภย
เนนคมอปกรณก าลง
รองรบระบบสมผส
เนนความปลอดภย
............ขนาดบส : 8 บต
..ชองสอสาร: UART/ USART/ SPI/ I2C
............ความเรว: 1 ค าส ง/12 clk...ชนดหนวยจ า : ROM, SRAM/Flash
..ตระกล: 8051
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.3 ตระกลของไมโครคอนโทรลเลอรและความแตกตาง
![Page 24: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/24.jpg)
6562213 ไมโครโพรเซสเซอร 1 24
ความแตกตาง
ประหยดพลงงาน
รองรบการใชเครอขาย
รองรบการเชอมตอ
รองรบความนรภย
เนนคมอปกรณก าลง
รองรบระบบสมผส
เนนความปลอดภย
PIC Microcontroller:Bus width: 8/16/32-bitCommunication Protocols: PIC, UART, USART, LIN, CAN, Ethernet, SPI, I2S
Speed: 4 Clock/instruction cycleMemory: SRAM, FLASHISA: Some feature of RISCMemory Architecture: Harvard architecturePower Consumption: LowFamilies: PIC16,PIC17, PIC18, PIC24, PIC32Popular Microcontrollers: PIC18fXX8, PIC16f88X, PIC32MXX
............ขนาดบส : 8/ 16/ 32 บต
..ชองสอสาร: PIC/UART/LIN/Ethernet/SPI
............ความเรว: 1 ค าส ง/4 clk.......ชนดหนวยจ า : SRAM/Flash
..ตระกล: PIC
Microcontroller Families
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.3 ตระกลของไมโครคอนโทรลเลอรและความแตกตาง
![Page 25: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/25.jpg)
6562213 ไมโครโพรเซสเซอร 1 25
ความแตกตาง
ประหยดพลงงาน
รองรบการใชเครอขาย
รองรบการเชอมตอ
รองรบความนรภย
เนนคมอปกรณก าลง
รองรบระบบสมผส
เนนความปลอดภย
AVR Microcontroller:Bus width: 8/32-bitCommunication Protocols: UART, USART, SPI, I2C, (special purpose AVR support CAN, USB, Ethernet)Speed: 1 clock/ instruction cycleMemory: Flash, SRAM, EEPROMISA: RISCMemory Architecture: ModifiedPower Consumption: LowFamilies: Tiny, Atmega, Xmega, special purpose AVRPopular Microcontrollers: Atmega8, 16, 32, Arduino Community
............ขนาดบส : 8/ 32 บต
..ชองสอสาร: UART/ SPI/ I2C/ USB/ Ethernet
............ความเรว: 1 ค าส ง/1 clk.
หนวยจ า : Flash/SRAM E2PROM
..ตระกล: AVR
Microcontroller Families
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.3 ตระกลของไมโครคอนโทรลเลอรและความแตกตาง
![Page 26: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/26.jpg)
6562213 ไมโครโพรเซสเซอร 1 26
Microcontroller Families
ความแตกตาง
ประหยดพลงงาน
รองรบการใชเครอขาย
รองรบการเชอมตอ
รองรบความนรภย
เนนคมอปกรณก าลง
รองรบระบบสมผส
เนนความปลอดภย
ARM Microcontroller:Bus width: 32-bit mostly also available in 64-bitCommunication Protocols: UART, USART, LIN, I2C, SPI, CAN, USB, Ethernet, I2S, DSP, SAI (serial audio interface), IrDASpeed: 1 clock/ instruction cycleMemory: Flash, SDRAM, EEPROMISA: RISCMemory Architecture: Modified Harvard architecturePower Consumption: LowFamilies: ARMv4,5,6,7 and seri2esPopular Microcontrollers: LPC2148, ARM Cortex-M0 to ARM Cortex-M7, etc.
...ชองสอสาร: UART/ SPI/ I2C/ USB/ IrDA
...ขนาดบส : 32 บต
............ความเรว: 1 ค าส ง/1 clk.หนวยจ า : Flash/SDRAM E2PROM
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.3 ตระกลของไมโครคอนโทรลเลอรและความแตกตาง
![Page 27: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/27.jpg)
27
![Page 28: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/28.jpg)
6562213 ไมโครโพรเซสเซอร 1
1.4 ภาษาทใชในการพฒนาโปรแกรมควบคม
คอ...สอภาษาทมนษยเรา ใชเพอสอสารรบ-สง ขอมล-ค าส ง ...ระหวางชป MCU กบอปกรณรายรอบในงานเฉพาะเจาะจง ...เชน การควบคมการตด-ดบของไฟ แสงสวาง/......การควบคมการหมน-หยดหมนของมอเตอร
......การท างานของอปกรณแบบวฎจกร เชน ไฟจราจร/ ไฟประดบ
......การท างานของอปกรณแบบมเงอนไข เชน ลฟต (elevator)
......สายพานล าเลยง (conveyor)
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
28
![Page 29: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/29.jpg)
6562213 ไมโครโพรเซสเซอร 1 29
ภาษาทใชในการพฒนาโปรแกรมควบคมอปกรณ(ภาษาระดบสง-ภาษาแอสแซมบล-ภาษาเครอง) บนชปไมโครคอนโทรลเลอร
ภาษาระดบสง
ภาษาแอสแซมบล
ภาษาเครอง
ตวอยางภาษาเครอง
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.4 ภาษาทใชในการพฒนาโปรแกรมควบคม
![Page 30: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/30.jpg)
6562213 ไมโครโพรเซสเซอร 1 30
ภาษาระดบสง
ภาษาแอสแซมบล
ภาษาเครอง
ตวอยางภาษาแอสแซมบล
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
1.4 ภาษาทใชในการพฒนาโปรแกรมควบคม
ภาษาทใชในการพฒนาโปรแกรมควบคมอปกรณ(ภาษาระดบสง-ภาษาแอสแซมบล-ภาษาเครอง) บนชปไมโครคอนโทรลเลอร
![Page 31: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/31.jpg)
6562213 ไมโครโพรเซสเซอร 1 31
ภาษาระดบสง
ภาษาแอสแซมบล
ภาษาเครอง
ตวอยางภาษาซ
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
ภาษาทใชในการพฒนาโปรแกรมควบคมอปกรณ(ภาษาระดบสง-ภาษาแอสแซมบล-ภาษาเครอง) บนชปไมโครคอนโทรลเลอร
1.4 ภาษาทใชในการพฒนาโปรแกรมควบคม
![Page 32: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/32.jpg)
32
![Page 33: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/33.jpg)
6562213 ไมโครโพรเซสเซอร 1
ข นท 5recheck
redo
ข นท 4uploadHex. FileC2Hex.complier
ข นท 3พฒนาซอฟตแวร
C-editor
ข นท 2ประกอบวงจร
circuit asseembly
33
1.5 การพฒนาฮารดแวรและซอฟตแวรบน MCU
ข นท 1ออกแบบวงจรcircuit design
Upload Hex.file
พฒนาซอฟตแวรC-editor
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
![Page 34: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/34.jpg)
34
![Page 35: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/35.jpg)
6562213 ไมโครโพรเซสเซอร 1 35
1.6 สถาปตยกรรมของ MCU ตระกล MCS-51
MCU กบหนวยส าคญตางๆทอยภายในชป (ตวอยางชป: AT89C51)
ROM: ทเกบโคดทพฒนาใชงาน
RAM:ทเกบขอมล register/
ชองทางตดตอกบอปกรณภายนอก: P0, P1, P2, P3
จดเชอมตอการสอสารอนกรมกบอปกรณภายนอก (serial port)
สวนสรางฐานเวลาเพอการนบและการจบเวลา
สวนควบคมบสขอมล บสต าแหนง และบสควบคม
สวนควบคมการขดจงหวะ
สวนก าเนดความถในการท างาน
ALU + CU
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
![Page 36: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/36.jpg)
6562213 ไมโครโพรเซสเซอร 1 36
เมอจบบทเรยนนแลว... นกศกษาควรมสมรรถนะดงน
1.2 บอกความแตกตางระหวางCPU vs MCU
1.3 อธบายความแตกตาง
RISC vs CISCและสามารถระบ
MCU 4 ตระกลหลก
1.5 ระบขนตอนการพฒนาฮารดแวร-ซอฟตแวร บน MCU
1.6 บอกองคประกอบหลกในสถาปตยกรรมของMCU ตระกล MCS-51
1.4 อธบายความแตกตางของภาษาทใชในการพฒนาโปรแกรมควบคม
1.1 มความเขาใจ..บต-นบเบล-ไบต-เวรด/ MSB-LSB/ BIN2HEX
บทท 1 สถาปตยกรรมไมโครโพรเซสเซอรและไมโครคอนโทรลเลอรพนฐาน
![Page 37: PowerPoint Presentationcourseware.npru.ac.th/admin/files/20181009145759_8... · 8051 Microcontroller: Bus width: 8-bit for standard core Communication Protocols: UART, USART,SPI,I2C](https://reader036.fdocument.pub/reader036/viewer/2022062918/5ede83a4ad6a402d6669d6ab/html5/thumbnails/37.jpg)
37