PIC PIC Harvard Architecture Reduce Instruction Set Computing
- Slides: 61
สถาปตยกรรมและการออกแบบ PIC • PIC ถกออกแบบใหมคณสมบตดงตอไปน – Harvard Architecture – Reduce Instruction Set Computing (RISC) – Single Word Instruction – Pipeline
Program Memory Mode
PICDEM™ PIC 18 EXPLORER PICkit™ DEMONSTRATION BOARD Starter Kit ใส PIC 18 F 8722 )ไฟ 5 V) Plug-In Module ��� PIC 18 F 87 J 11 )�� 3. 3 V)
PICDEM™ PIC 18 EXPLORER DEMONSTRATION BOARD PIC 18 F 8722 Connector ������ Plug In Module PIC 18 F 87 J 11 In Circuit Debugger PICkit Connector
PICDEM™ PIC 18 EXPLORER DEMONSTRATION������ BOARDs 4 PIC 18 F 8722 PIC 18 F 87 J 11 ����� PIC ���� (PIC 18 F 8722) ����� PIM (PIC 18 F 87 J 11) LED �������� JP 1 ������ LED 8 ดวง
PICDEM™ PIC 18 EXPLORER ����� DEMONSTRATION 32. 768 BOARD k. Hz ������ Timer 1 ���������� ��� MPC 9701 A 25 LC 256 SPI EEPROM JP 2 Enable/Disable EEPROM
การพฒนาโปรแกรมโดยใช Demo PIC 5. Step three : Create New Project File กด Browse เลอก Folder และชอ Project File ทตองการ
ตวอยางโปรแกรมไฟวง Demo 1. c ADCON 0 bits. ADON = 1; while(1) { ADCON 0 bits. GO=1; while(ADCON 0 bits. GO); result = ADRES; result >>=2; if(result==0) result = 1; #include <p 18 f 8722. h> #include <adc. h> #include <delays. h> #include <timers. h> #define NUMBER_OF_LEDS 8 #pragma code // int result; int shift; void main(void) { TRISAbits. TRISA 0=1; TRISD = 0; PORTD = 0; ADCON 1 = 0 b 00001110; ADCON 2 = 0 b 10001010; PORTD = result; PORTD=1<<shift; shift++; shift %=8; Delay 10 KTCYx(result); } }
Library ของ MPLab C 18 • ฟงกชนทมากบ Library ของ MPLab. C 18 มทงหมด 4 กลมคอ 1. Hardware Peripheral Function • • A/D Converter Input Capture I 2 C I/O Port Microwire Pulse-Width Modulation SPI Timer
Library ของ MPLab C 18 2. Software Peripheral Function • • • External LCD Function External CAN 2510 Function Software I 2 C Function Software SPI Function Software UART Function
Library ของ MPLab C 18 3. General Software Library • • • Character Classification Functions Data Conversion Functions Memory and String Manipulation Functions Delay Functions Reset Functions Character Output Functions 4. Math Libraries • 32 -Bit Floating Point Library • The C Standard Library Math Functions
โครงสรางการเขยนโปรแกรมภาษา /* Include Files */ #include <p 18 xxxxx. h> #include … …. . /* Symbol Definitions */ #define MAX 100 #define … …. #pragma config WDTEN = OFF /* Global Variables */ int x, y, z, …. . char a, b, c, …… …. . /* Function Declarations */ int Func(char r) { int x, y; …………. return … } …. …. /* Start of MAIN Program */ void main(void) { …………. . } C
• ตองประกาศฟงกชนกอนทกคร งทจะถกเรยกใช float Sin. Wave(float x); Void Send. Wave(char x); void main(void) { float t, Output; for(t=0; t<1. 0; t+=0. 1) { Output = Sin. Wave(255. 0, t); Send. Wave(Output); } }
Local & Global Variable • Local Variable คอตวแปรทสามารถใชไดในฟงกชนทมการประก าศไวเทานน • float. Global Variable Sin. Wave(float x); void Sin. Wave(float A, float t) Void Send. Wave(void); { คอตวแปรทสามารถเรยกใชในฟงกชนใดๆกได float x; // x is global variable x = A*sin(2. 0*3. 14*t); // x is global variable void main(void) { float x; // x is local variable for(x=0; x<1. 0; x+=0. 1) { Output = Sin. Wave(255. 0, x); Send. Wave(); } } } void Send. Wave(void) { PORTA = (char) x; // x is global variable }
ตวแปร Array void main(void) { int LED[] ={ 0 b 00000001, 0 b 00000010, 0 b 00000100, 0 b 00001000, 0 b 00010000, 0 b 00100000, 0 b 01000000, 0 b 10000000}; TRISAbits. TRISA 0=1; TRISD = 0; PORTD = 0; ADCON 1 = 0 b 00001110; ADCON 2 = 0 b 10001010; ADCON 0 bits. ADON = 1; while(1) { ADCON 0 bits. GO=1; while(ADCON 0 bits. GO); result = ADRES; result >>=2; if(result==0) result = 1; PORTD=LED[shift]; shift++; shift %=8; } } Delay 10 KTCYx(result);
- Pic harvard architecture
- Pic 프로그래밍
- Marie skipcond
- Types of instruction set architecture
- Mips instruction set architecture
- Arm high speed multiplier organization
- Which instruction set architecture is used in beaglebone?
- Instruction set architecture
- 430830
- Instruction set architecture in computer organization
- Mips code
- Total set awareness set consideration set
- Training set validation set test set
- Research computing harvard
- Map reduce word count
- Assembly movlw
- Oucpfse4qyi -site:youtube.com
- Individualized instruction vs differentiated instruction
- Indirect instruction definition
- Intel itanium architecture
- Conventional computing and intelligent computing
- Pengertian arsitektur harvard
- 8051 architecture
- Harvard bus architecture
- Mmu
- Harvard architecture
- Harvard architecture
- Harvard architecture
- Classify instruction set of 8086
- The little man computer
- 8051 microcontroller instruction set
- Sic addressing modes
- Set instruksi
- Zero instruction set computer
- Cpl instruction in 8051
- Picoblaze instruction set
- Intel simd instructions
- 8088 instruction set
- Classification of instruction set of 8086
- Classify instruction set of 8086
- Instruction format of ibm 360 in system programming
- Ece 2560
- Riscv instruction set
- Lc3 instruction set
- Lc3 instruction set
- Arc instruction set
- Motorola 68000 instruction set
- Lc3 computer
- Avr opcodes
- Sic/xe
- Ia64
- Picoblaze instruction set
- Logical instructions in 8085
- Dlx instruction set
- Arquitetura risc e cisc
- Application specific instruction set processor
- Define instruction set
- 8087 programming examples
- Sap-1 instruction set
- Cisc complex instruction set computer
- 8085 instruction set
- Arc instruction set