1 / 29

PIC mikrovezérlők

PIC mikrovezérlők. Mersich András mersich@mit.bme.hu. Ajánlott irodalom: www.microchip.com http://www.mit.bme.hu/oktatas/targyak/vimm4133/jegyzet/gkp12.pdf Kónya László: PIC mikrovezérlők alkalmazástechnikája. A PIC mikrovezérlő család. Architektúra alapok.

abby
Download Presentation

PIC mikrovezérlők

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 mikrovezérlők Mersich András mersich@mit.bme.hu • Ajánlott irodalom: • www.microchip.com • http://www.mit.bme.hu/oktatas/targyak/vimm4133/jegyzet/gkp12.pdf • Kónya László: PIC mikrovezérlők alkalmazástechnikája

  2. A PIC mikrovezérlő család

  3. Architektúra alapok Harvard architektúra: program és adatmemória külön 12+ bites instruction és 8 bites data 12+ bit instr.  single-word instr. RISC Ortogonális utasításkészlet: minden regiszterre ugyanaz végezhető 1 program utasítás = 2 utasítás ciklus (fetch+execute) = 4 órajel Pipeline: minden utasítás (kivéve ugrás) egy utasításciklus alatt

  4. Memória szervezés Adat memória Program memória • Csak egyetlen interrupt vektor (PIC18 alatt), az ISR-nek kell eldöntenie, mi okozta. • Az IT flag akkor is beáll, ha az IT nincs engedélyezve!!!

  5. Portok A WR-RD nem ugyanarra vonatkozik. Íráskor a PORT latchbe írunk, míg olvasáskor a láb állapotát olvassuk vissza. A kettő megegyezik,ha a port kimenet, egyébként nem biztos. A bitműveletek mind READ-MODIFY-WRITE jellegűek (BCF,BSF). Előbb olvassa mind a 8 bitet, aztán elvégzi az adott bit módosítását, majd a teljes 8 bitet visszaírja.Mellékhatás lehetséges, pl.:PORTB=11100000TRISB =10100000 (be,ki,be,ki,ki,…)a bemeneti lábak állapota =1x0xxxxx BCF PORTB,7 utasítás hatása:read port=1100000clr bit6 =1000000write port=1000000 (bit5 nullázódott)

  6. Baseline flash PIC • Általános tulajdonságok: • flash program memória • baseline core:33 db 12 bites utasítás, 2 rétegű HW stack • low power (100nA) sleep current • 25mA source/sink current I/O • 8 bites timer (TMR0) • watchdog timer (WDT) • In Circuit Serial Programming (ICSP) • Short Device Reset Timer, 1.125ms (DRT): csak PIC10F220/222, PIC12F510 és PIC16F506

  7. Baseline flash PICs

  8. Baseline Architecture

  9. Unique baseline PIC applications • „Electronic glue”Bug fixes and last-minutechanges (signal inversion, timing delays, …) to avoid costly and time-consuming silicon redesign. • Logic controlDelays, smart gates, signal conditioning, simple state machines, encoders/decoders and peripheral logic functions • MechatronicsReplace traditional mechanical functions: smart switches, mode selectors, remote I/Os, timers, LED flashers • Waveform generation • Intelligent disposable electronicsBlood sugar / drug tester, package monitoring, property identification

  10. Mid-range flash PIC • Általános tulajdonságok: • flash program memória • mid-range core:35 db 14 bites utasítás, 8 rétegű HW stack • low power (100nA) sleep current • 25mA source/sink current I/O • 1 db 16 bites timer (TMR1) • 2 db 8 bites timer (TMR0/2) • watchdog timer (WDT) • hardware interrupt • In Circuit Serial Programming (ICSP)

  11. Mid-rangeflash PICs ECCP: Enhanced Capture/Compare/PWM

  12. PIC16F873 block diagram

  13. PIC16F877register file • 8 bites data memory RAM • Lényeges: • Indirect addr. (INDF), FSRSTATUSPCL, PCLATHPORTA, TRISA

  14. Status register Address: 03h, 83h, 103h, 183h Nincs negative és overflow flag

  15. Register bank select RAM törlése 20h-2Fh indirekt címzéssel:

  16. PIC16F877 program memória 8 szintű HW stack Egyetlen interrupt vektor Program memória 2k-s page-ekben (11 bit)

  17. Program memory paging Table read, computed goto:ha túllépünk 256-on, PCLATH-et növelni! CALL, GOTO: PCLATH!RETURN, RETFIE: teljes 13 bit stackről Page1-ben lévő subrutin hívása page0-ból:

  18. Stack • 8 szintű, 13 bites HW stack • stack pointer nem írható és nem olvasható • CALL és interrupt hatására PC PUSH • RETURN, RETLW, RETFIE hatására PC POP • cirkuláris buffer, NINCS stack overflow flag • nincs általános PUSH, POP utasítás

  19. Instruction format 7 bit file reg. addr.: regiszter bank mérete 128 bytepl.: INCF FSR,f pl.: BCF PORTB,7 Regiszternek direkt nem adható érték, csak W-n keresztül.pl.: MOVLW 0x13 11 bit goto: 2k program memory page

  20. PIC18 • Általános tulajdonságok: • 10-16 MIPS, 128kbyte program memória, 18-100 pin • 16 bites program utasítások • self programming flash • 2 szintű IT: high/low priority • széles integrált periféria választék Integrated full-speed USB 2.0 pl. PIC18F4550 és PIC18F4450 3V general purpose portfolio PIC18FxxJ1x Integrated ethernet microcontroller pl. PIC18F97J60

  21. Programozás In-circuit Serial Programming (ICSP): MPLAB ICD 2In-circuit debugger/programmer MPLAB REAL ICETMIn-circuit emulation system MCLR=13V !!! Low voltage ICSP: RB3/PGM pin dedikált Free ICSP: ICProg MPLAB PM3Device programmer

  22. Microchip vagy Atmel?

  23. 16-bites mikrokontrollerek (MCU) PIC24F: highly cost-effective PIC24H: highest performance • Általános tulajdonságok: • 16-bites módosított Harvard RISC architektúra • tápfeszültség: 3-3.6V • műveleti sebesség: 16 MIPS (PIC24F), 40 MIPS (PIC24H) • flexibilis interrupt szerkezet, processzor exception és software trap • kommunikációs modulok: SPI, I2C, UART, CAN • timerek • real time clock & calendar (RTCC) • ADC • JTAG, ICSP, in-circuit emulation • CodeGuardTM • RTOS:CMX-RTX: preemptive, multitasking OSCMX-Tiny+CMX-Scheduler: free

  24. PIC24Hblokk diagram • 16 bites adat • 71 db 24 bites utasítás • software stack • 16x16 szorzás • 16/16 és 32/16 osztás • DMA • flexibilis és determinisztikus IT (latency 5 ciklus) • A+B=C egyetlen ciklusban

  25. 16-bit Digital Signal Controllers (DSC) dsPIC30: versatile, 5V, 30MIPS dsPIC33F: high performance, cost-effective, 3.3V, 40MIPS dsPICworksTM Data Analysis and DSP Software Digital Filter Design Tool Noise Suppression Library Acoustic Echo Cancellation Library TCP/IP Protocol Stack Soft Modem Libraries Encryption Libraries FAT16 File System Motor Control Application Software

  26. dsPIC33Fblokk diagram • 16 bites adat • 83 db 24 bites utasítás • software stack • 2 db 40 bites akkumulátor • 16x16 szorzás • 16/16 és 32/16 osztás • single-cycle multiply and accumulate (MAC) • flexibilis és determinisztikus IT (latency 5 ciklus) • DMA

  27. PIC33FDSP engine • 17-bit x 17-bit multiplier • barrel shifter • 40-bit adder/subtracter • 2 accumulators

  28. Tipikus DSP feladatok FIR szűrő, konvolúció(súlyozott mozgó átlag): FFT:

  29. CodeGuardTM Egy processzor erőforrásainak (memória, IT, perifériák) biztonságos megosztása különböző felhasználók között. IP: Intellectual Property ODM/OEM: Original Device/Equipment Manufacturer VAR: Value-Added Reseller

More Related