1 / 30

PIC microcontrollers

PIC microcontrollers. บัญญัติ สมสุพรรณ อิเล็กทรอนิกส์ วิทยาลัยเทคนิคอุบลราชธานี. ความแตกต่างระหว่าง microcomputer กับ microcontroller. Control Unit. Arithmetic Logic Unit (ALU). Memory. โครงสร้างภายในของไมโครคอนโทรเลอร์. Port. รวมกันเรียกว่า CPU = Central Processing Unit หรือ

jara
Download Presentation

PIC microcontrollers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PIC microcontrollers บัญญัติ สมสุพรรณ อิเล็กทรอนิกส์ วิทยาลัยเทคนิคอุบลราชธานี ELectronic วท.อุบลราชธานี

  2. ความแตกต่างระหว่าง microcomputer กับ microcontroller ELectronic วท.อุบลราชธานี

  3. Control Unit Arithmetic Logic Unit (ALU) Memory โครงสร้างภายในของไมโครคอนโทรเลอร์ Port รวมกันเรียกว่า CPU = Central Processing Unit หรือ MPU = Micro Processing Unit หรือ up = Microproceser ELectronic วท.อุบลราชธานี

  4. ประเภทของไมโครคอนโทรลเลอร์ประเภทของไมโครคอนโทรลเลอร์ ประเภท CISC (Complex Instruction Set Computer) ประเภท RISC (Reduce Instruction Set Computer ) ELectronic วท.อุบลราชธานี

  5. ประเภท CISC (Complex Instruction Set Computer) ไมโครคอนโทรลเลอร์ แนวคิดในการพัฒนาซีพียูโดยการนำระบบเดิมมาปรับปรุง สร้างคำสั่งใหม่ เพิ่มวงจรเข้าไปให้ทำงานดีขึ้น ทำให้วงจรมีความซับซ้อนและมีคำสั่งเพิ่มขึ้นเรื่อยๆ และทำให้วงจรมีขนาดใหญ่ ได้แก่ z80,Motorola 68030, 68040 Intel i486, IntelPentium, IntelCeleron, AMDAthlon, AMDSempron ELectronic วท.อุบลราชธานี

  6. ประเภท RISC (Reduce Instruction Set Computer ) ไมโครคอนโทรลเลอร์ เนื่องจากชนิด CISC ยิ่งพัฒนายิ่งมีขนาดใหญ่ และ คำสั่งมากขึ้น ทำให้พัฒนาได้ยากมากขึ้น จึงได้มีแนวคิดในการออกแบบใหม่ให้มีขนาดเล็กลง ลดขนาดคำสั่งลง ได้แก่ PIC, ARM, AVR ELectronic วท.อุบลราชธานี

  7. 1. One Time Programmable (OTP) เป็นชิพที่มีราคาถูก โปรแกรมได้แค่ครั้งเดียว จะมีตัวอักษร C แสดงบนตัวชิพ เช่น 16C74, 16C84 ชนิดของ PIC (Peripheral Interface Controller ) 2. EPROM สามารถเขียนโปรแกรมเข้าไป และสามารถลบ โปรแกรมเดิม ด้วยแสง Ultra Violet (UV) 3. Electronically Erasable Programmable Read Only Memory (EEPROM) เป็นชิพที่สามารถเขียนหรือลบด้วยสัญญาณทางไฟฟ้า มีตัวอักษร F เช่น16F84 ELectronic วท.อุบลราชธานี

  8. องค์ประกอบของ Pic Register I/0 Port ELectronic วท.อุบลราชธานี

  9. 32 Bit แบ่งตามหน่วยประมวลผลได้ 3 ประเภท ประเภทของ PIC 8 Bit 16 Bit ELectronic วท.อุบลราชธานี

  10. Plastic dual in-line package (DIP) PIC 16F877 • Complexer • 40 pins IC • 8 K Woord (14 bit) Program memory • 368 Bytes data memory • 256 Bytes EEPROM • I/O Port 35 pin • Speciale function: • 10 chanal 8-bit analog input • SPI serial port • USART serial communicatie • Brown-out detection • In-circuit programmable ELectronic วท.อุบลราชธานี

  11. รูปทรงต่างๆของPIC16F877 • Quad FlatPackage (QFP) • Plastic Leaded Chip CarrierPackage (PLCC) ELectronic วท.อุบลราชธานี

  12. คุณลักษณะ Pic16F877 ELectronic วท.อุบลราชธานี

  13. pic16F877 มี • Peripheral ที่นำไป • สร้างเป็นชิ้นงานได้ อย่างหลากหลาย ELectronic วท.อุบลราชธานี

  14. PIC16F877 Peripheral features 1. I/O Ports: • PIC16F877 has 5 I/O ports: • PORT A has 6 bit wide, Bidirectional • PORT B, C, D have 8 bit wide, Bidirectional • PORT E has 3 bit wide, Bidirectional • In addition, they have the following alternate functions: ELectronic วท.อุบลราชธานี

  15. PIC16F877 Peripheral features • Each port has 2 control registers: • TRISx sets whether each pin is an input(1) or output(0) • PORTx sets their output bit levels or contain their input bit levels. • เช่น TRISC = 0 // ให้ Port C เป็น Output Port • PORTB = 0 // ให้ Port B เป็น 0 • Pin functionality “overloaded” with other features. • Most pins have 25mA source/sink thus it can drive LEDs directly. ELectronic วท.อุบลราชธานี

  16. PIC16F877 Peripheral features 2. Analog to Digital Converter (ADC) • Only available in 14bit and 16bit cores • Fs (sample rate) < 54KHz • The result is a 10 bit digital number • Can generate an interrupt when ADC conversion is done • The A/D module has 4 registers: • A/D Result High Register (ADRESH) • A/D Result Low Register (ADRESL) • A/D Control Register0 (ADCON0) • A/D Control Register1 (ADCON1) • Multiplexed 8 channel inputs • Must wait T acq to change up sampling capacitor. • Can take a reference voltage different from that of the controller. ELectronic วท.อุบลราชธานี

  17. PIC16F877 Peripheral features 3. Timer/counter modules • Generate interrupts on timer overflow • Can use external pins as clock in/ clock out (ie. for counting events or using a different Fosc) • There are 3 Timer/counter modules: • Timer0: 8-bit timer/counter with 8-bit pre-scaler • Timer1: 16-bit timer/counter with 8-bit pre-scaler, can be incremented during SLEEP via external crystal/clock • Timer2: 8-bit timer/counter with 8-bit period register, pre-scaler and post-scaler. ELectronicวท.อุบลราชธานี

  18. PIC16F877 Peripheral features 4. Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address detection. • Asynchronous communication: UART (RS 232 serial) • Can do 300bps – 115kbps • 8 or 9 bits, parity, start and stop bits, etc. • Outputs 5V  needs a RS232 level converter (e.g MAX232) ELectronic วท.อุบลราชธานี

  19. PIC16F877 Peripheral features Synchronous communication: i.e with clock signal SPI = Serial Peripheral Interface • 3 wire: Data in, Data out, Clock • Master/Slave (can have multiple masters) • Very high speed (1.6Mbps) • Full speed simultaneous send and receive (Full duplex) I2C = Inter IC • 2 wire: Data and Clock • Master/Slave (Single master only; multiple masters clumsy) • Lots of cheap I2C chips available; typically < 100kbps ELectronic วท.อุบลราชธานี

  20. PIC16F877 Peripheral features 5. Capture, Compare, PWM modules • Capture is 16-bit, max. resolution is 12.5 ns • Compare is 16-bit, max. resolution is 200 ns • PWM max. resolution is 10-bit 6. Synchronous Serial Port (SSP) with SPITM (Master mode) and 12CTM (Master/Slave) 7. Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls ELectronicวท.อุบลราชธานี

  21. ตระกูล PIC ELectronic วท.อุบลราชธานี

  22. 1 คำสั่ง จังหวะการทำงานของ CPU ต่อ รอบคำสั่ง ปฏิบัติตาม รหัสที่ถอด ถอดรหัส ข้อมูล อ่านข้อมูลจาก -Key • Memory • SenSor ช่วง Execute ช่วง Fetch ELectronic วท.อุบลราชธานี

  23. ELectronic วท.อุบลราชธานี

  24. PIC 16F877 • Program Memory • Banked memory: instelbaar met het STATUS register ELectronic วท.อุบลราชธานี

  25. PIC 16F877 • Data Memory ELectronic วท.อุบลราชธานี

  26. PIC 16F877 – I/O port • 3 Input/Output port • PORT A : • push-pull op RA3:RA0 en RA5 • Open collector op RA4 ELectronicวท.อุบลราชธานี

  27. PIC 16F877 – I/O port • PORT B : • High Z inputs • RB7:RB4 aangesloten op de interrupt ELectronicวท.อุบลราชธานี

  28. PIC 16F877 – I/O port • PORT C : • TRIS C=1 : INPUT • TRIS C=0 : OUTPUT • Meerdere functies. O.a. Schmitt trigger ELectronicวท.อุบลราชธานี

  29. PIC 16F877 – I/O port • Andere port: • PORT D/TRIS D: Schmitt-trigger input buffer • PORT E/TRIS E : Schmitt-trigger input buffers • Analoge ingangen: verspreid over andere port ELectronic วท.อุบลราชธานี

  30. จบแล้ว..ครับ ELectronic วท.อุบลราชธานี

More Related