PIC 16F84A programming (II)

Size: px
Start display at page:

Download "PIC 16F84A programming (II)"

Transcription

1 Lecture (05) PIC 16F84A programming (II) Dr. Ahmed M. ElShafee ١ Introduction to 16F84 ٣ PIC16F84 belongs to a class of 8-bit microcontrollers of RISC architecture. Program memory (FLASH) EEPROM RAM PORTA and PORTB FREE-RUN TIMER CENTRAL PROCESSING UNIT Agenda Introduction to 16F84 Assembly programming Examples ٢ PIC16F84 has a RISC architecture, or Harvard architecture in another word ٤

2 Instructions set 16F84 precisely 35 instructions. (ex. Intel's and Motorola's microcontrollers have over hundred instructions) All of these instructions are executed in one cycle except for jump and branch instructions. PIC16F84 usually reaches results of 2:1 in code compression and 4:1 in speed in relation to other 8-bit microcontrollers in its class. ٥ Pin no.7 RB1 First pin on port B. No additional function. Pin no.8 RB2 Second pin on port B. No additional function. Pin no.9 RB3 Third pin on port B. No additional function. Pin no.10 RB4 Fourth pin on port B. No additional function. Pin no.11 RB5 Fifth pin on port B. No additional function. Pin no.12 RB6 Sixth pin on port B. 'Clock' line in program mode. Pin no.13 RB7 Seventh pin on port B. 'Data' line in program mode. Pin no.14 Vdd Positive power supply pole. Pin no.15 OSC2 Pin assigned for connecting with an oscillator Pin no.16 OSC1 Pin assigned for connecting with an oscillator Pin no.17 RA2 Second pin on port A. No additional function Pin no.18 RA1 First pin on port A. No additional function. ٧ Pin description PIC16F84 has a total of 18 pins (DIP18 ) (Dual In Package) or (SMD 18) (Surface Mount Devices). Pin no.1 RA2 Second pin on port A. Has no additional function Pin no.2 RA3 Third pin on port A. Has no additional function. Pin no.3 RA4 Fourth pin on port A. TOCK1 which functions as a timer is also found on this pin Pin no.4 MCLR Reset input and Vpp programming voltage of a microcontroller Pin no.5 Vss Ground of power supply. Pin no.6 RB0 Zero pin on port B. Interrupt input is an additional function. ٦ Clock generator oscillator Oscillator circuit is used for providing a microcontroller with a clock. Clock is needed so that microcontroller could execute a program or program instructions PIC16F84 can work with four different configurations of an oscillator, two of them are crystal oscillator resistor-capacitor (RC) ٨

3 XT Oscillator Crystal oscillator is kept in metal housing with two pins, the operating frequency is written on housing. A 33pf ceramic capacitors are connected to gnd. Oscillator and capacitors can be packed in joint case with three pins, called ceramic resonator Oscillator clock divided by 4 can also be obtained on OSC2/CLKOUT pin, and can be used for testing or synchronizing other logical circuits Following a supply, oscillator starts oscillating. Oscillation at first has an unstable period and amplitude, but after some period of time it becomes stabilized ١١ RC Oscillator Resonant frequency of RC oscillator depends on supply voltage rate, resistance R, capacity C and working temperature. R value should be greater than 2.2K and less than 1M to avoid unstability Recommended R is between 3K and 100k capacitor should be above 20pF ١٠ To prevent such inaccurate clock from influencing microcontroller's performance, we need to keep the microcontroller in reset state during stabilization of oscillator's clock. ١٢ ٩

4 Reset Reset is used when microcontroller doesn't behave the way we want it to, interrupt in program execution, to get a microcontroller ready when loading a program. MCLR has to be connected via resistor to the positive supply pole, to prevent from bringing a logical zero to MCLR pin ١٣ Brown-out Reset Impulse for resetting is generated by microcontroller itself when supply doesn't drop to zero but falls below the limit that guarantees microcontroller's proper functioning (in a range from 1.2V to 1.8V) ١٥ sources of resets: Reset during power on, POR (Power-On Reset) Reset during regular work by bringing logical zero to MCLR microcontroller's pin. Reset during SLEEP regime Reset at watchdog timer (WDT) overflow Reset during at WDT overflow during SLEEP work regime. During a reset, RAM memory locations are not being reset. They are unknown during a power up and are not changed at any reset. SFR registers are reset to a starting position initial state. setting a program counter (PC) ١٤ to zero (0000h) That impulse lasts 72ms which is enough time for an oscillator to get stabilized. These 72ms are provided by an internal PWRT timer which has its own RC oscillator. ١٦

5 Central Processing Unit Central processing unit (CPU) is the brain of a microcontroller responsible for finding and fetching the right instruction which needs to be executed, decoding that instruction, finally its execution. Arithmetic logic unit is responsible for performing operations of adding, subtracting, moving, and logic operations, and shifting ١٧ Memory organization PIC16F84 has two separate memory blocks, one for data and the other for program Program memory 1024 locations with 14 bits width where locations zero and four are reserved for reset and interrupt vector. ١٩ In instructions with two operands, ordinarily one operand is in work register (W register), and the other is one of the registers (GPR, SFR ) or a constant. In instructions with one operand, is either W register or one of the registers. Execution of some instructions affects status bits, which depends on the result itself ALU can affect values of Carry (C), Digit Carry (DC), and Zero (Z) bits in STATUS register. ١٨ Data memory consists of EEPROM and RAM memories EEPROM memory consists of 64 eight bit locations RAM memory for data occupies space on a memory map from location 0x0C to 0x4F which comes to 68 locations. Locations of RAM memory are also called GPR registers which is an abbreviation for General Purpose Registers. ٢٠

6 GPR registers can be accessed regardless of which bank is selected at the moment. SFR registers first 12 locations in banks 0 and 1 are registers of specialized function assigned with certain blocks of the microcontroller. ٢١ Let's assume that we have selected bank 0 at the beginning of the program, and that we now want to write to certain register located in bank 1, say TRISB. Although we specified the name of the register TRISB, data will be actually stored to a bank 0 register at the appropriate address, which is PORTB in our example. Bcf STATUS, RP0 ;Select memory bank 0 Bsf STATUS, RP0 ;Select memory bank 1 ٢٣ Working with Memory Banks Memory Banks Selecting one of the banks is done via RP0 bit in STATUS register. Example: bcf STATUS, RP0 Instruction BCF clears bit RP0 (RP0=0) in STATUS register and thus sets up bank 0. bsf STATUS, RP0 Instruction BSF sets the bit RP0 (RP0=1) in STATUS register ٢٢ and thus sets up bank1. Locations 0Ch - 4Fh are general purpose registers (GPR) which are used as RAM memory. When locations 8Ch - CFh in Bank 1 are accessed, we actually access the exact same locations in Bank 0. In other words, whenever you wish to access one of the GPR registers, there is no need to worry about which bank we are in! ٢٤

7 Program Counter Program counter (PC) is a 13-bit register that contains the address of the instruction being executed 5-bit register PCLATH for the five higher bits of the address, and the 8-bit register PCL for the lower 8 bits of the address. ٢٥ bit 3 PD (Power-down bit) 1 = after supply has been turned on 0 = executing SLEEP instruction bit 2 Z (Zero bit) Indication of a zero result This bit is set when the result of an executed arithmetic bit 1 DC (Digit Carry) DC Transfer Bit affected by operations of addition, subtraction. 1 = transfer occurred on the fourth bit according to the order of the result 0 = transfer did not occur ٢٧ STATUS Register bits 6:5 RP1:RP0 (Register Bank Select bits) 01 = first bank 00 = zero bank bit 4 TO Time-out ; Watchdog overflow. 1 = overflow did not occur 0 = overflow did occur ٢٦ bit 0 C (Carry) Transfer Bit that is affected by operations of addition, subtraction and shifting. 1 = transfer occurred from the highest resulting bit 0 = transfer did not occur ٢٨

8 TRISB, PORTB, TRISA, and PORTA To change function of port to the following directions O O I O O O I I You need to write the following literal to TRIS register =0x ٢٩ Compiler directives LIST P=16f84a include "p16f84a.inc" config _FOSC_XT & _PWRTE_ON & _WDT_OFF & _CP_OFF ٣١ Assembly programming Compiler directives (MPLAP.X) Variables Values assignment Arithmetic operations Logic operations Loops Conditioning Branches Other instructions ٣٠ Variables As mentioned before PIC16F84 has three types of registers (memory) 1. W working register 2. SFR: Bank 00: 00h 0bh Bank 01: 80h 8bh ٣٢

9 2.1 Programmer can access SFR directly using its address (after selecting targeted bank) 0x00, 0x01,.., 0x0b 0x80, 0x81,, 0x8b 2.2 Programmer can assign name for SFR address INDF equ 0x00 PCL equ 0x02 STATUS equ 0x03 FSR equ 0x04 PCLATH equ 0x0A ٣٣ W EQU H'0000' F EQU H'0001' ;-----Bank INDF EQU H'0000' TMR0 EQU H'0001' PCL EQU H'0002' STATUS EQU H'0003' FSR EQU H'0004' PORTA EQU H'0005' PORTB EQU H'0006' EEDATA EQU H'0008' EEADR EQU H'0009' PCLATH EQU H'000A' INTCON EQU H'000B ;-----Bank OPTION_REG EQU H'0081' TRISA EQU H'0085' TRISB EQU H'0086' EECON1 EQU H'0088' EECON2 EQU H'0089 ٣٥ ;----- STATUS Bits C EQU H'0000' DC EQU H'0001' Z EQU H'0002' NOT_PD EQU H'0003' NOT_TO EQU H'0004' IRP EQU H'0007' RP0 EQU H'0005' RP1 EQU H'0006' ;----- PORTA Bits RA0 EQU H'0000' RA1 EQU H'0001' RA2 EQU H'0002' RA3 EQU H'0003' RA4 EQU H'0004' ;----- PORTB Bits RB0 EQU H'0000' RB1 EQU H'0001' RB2 EQU H'0002' RB3 EQU H'0003' RB4 EQU H'0004' RB5 EQU H'0005' RB6 EQU H'0006' RB7 EQU H'0007' Programmer can refer to Bits within registers Z equ 0x02 C equ 0x00 IRP equ 0x Programmer include processor.inc file include "p16f84.inc File path C:\Program Files (x86)\microchip\mplabx\mpasmx ٣٤ ;----- OPTION_REG Bits PSA EQU H'0003' T0SE EQU H'0004' T0CS EQU H'0005' INTEDG EQU H'0006' NOT_RBPU EQU H'0007' PS0 EQU H'0000' PS1 EQU H'0001' PS2 EQU H'0002' ;----- TRISA Bits TRISA0 EQU H'0000' TRISA1 EQU H'0001' TRISA2 EQU H'0002' TRISA3 EQU H'0003' TRISA4 EQU H'0004' ;----- TRISB Bits TRISB0 EQU H'0000' TRISB1 EQU H'0001' TRISB2 EQU H'0002' TRISB3 EQU H'0003' TRISB4 EQU H'0004' TRISB5 EQU H'0005' TRISB6 EQU H'0006' TRISB7 EQU H'0007' ٣٦

10 3. GPR Bank 00: 0ch 4fh Bank 01: 8ch cfh 3.1 Programmer can access GFR directly using its address (after selecting targeted bank) 3.2 Programmer can assign name for GPR address num1 equ 0x0c num2 equ 0x0d n equ 0x0e x equ 0x0f temperature equ 0x1A ٣٧ Arithmetic operations 8 ADDLW k Add W to a constant 9 SUBLW k Subtract W from a constant 10 ADDWF f,d Add W to f 11 SUBWF f,d Subtract W from f 12 INCF f,d Increment f 13 DECF f,d Decrement f ٣٩ Addlw H 12 Sublw D 12 Addwf b ,f addwf b ,1 Subwf b ,w subwf b ,0 Incf PORTB,f Decf PORTB,f Values assignment 1 MOVLW k Write constant in W register 2 MOVWF f Copy W to f 3 MOVF f,d Copy f to d 4 CLRW Write 0 in W 5 CLRF f Write 0 in f 6 BCF f,b Reset bit b in f 7 BSF f,b Set bit b in f MOVLW H'00' BSF STATUS,RP0 MOVWF TRISB BCF STATUS,RP0 ٣٨ Logic operations 14 ANDLW k Logic AND W with constant 15 IORLW k Logic OR W with constant 16 XORLW k Logic exclusive OR W with constant 17 ANDWF f,d Logic AND W with f 18 IORWF f,d Logic OR W with f 19 XORWF f,d Logic exclusive OR W with f 20 RLF f,d Rotate f to the left through CARRY 21 RRF f,d Rotate f to the right through CARRY 22COMF f,d Complement f 23SWAPF f,d Copy the nibbles from f to d crosswise ٤٠

11 Loops 24 INCFSZ f Increment f, skip if f =0 25 DECFSZ f Decrement f, skip if f = 0 MOVLW D'04' MOVWF 0x0c loop decfsz 0x0c goto loop ٤١ Branching 28 GOTO address Jump to address 29 CALL address Call a program 30 RETURN Return from a subprogram 31 RETLW Return from a subprogram with constant in W MOVLW D'04' MOVWF 0x0c loop call delay decfsz 0x0c goto loop ٤٣ delay nop nop nop return Conditioning 26 BTFSC f,b Test bit b in f, skip next instruction if b = 0 27 BTFSS f,b Test bit b in f, skip next instruction b =1 check btfsc PORTA,RA0 goto press_active_low goto check press_active_low ٤٢ Other instructions 32 NOP No operation 33 RETFIE Return from interrupt routine 34 CLRWDT Initialize watchdog timer 35 SLEEP Stand by mode ٤٤

12 Creating project ٤٥ ٤٦ ٤٧ ٤٨

13 ٤٩ ٥٠ ٥١ ٥٢

14 ٥٣ ٥٤ Working with simulator ٥٥ ٥٦

15 ٥٧ ٥٨ ٥٩ ٦٠

16 ٦١ ٦٢ ٦٣ ٦٤

17 Build delays DELAY MOVLW D'10' MOVWF 0x4f DELAY_loop DECFSZ 0x4f goto DELAY_loop RETURN ٦٥ PressControlledLedFlasher.asm LIST P=16f84 include "p16f84.inc" config _FOSC_XT & _PWRTE_ON & _WDT_OFF & _CP_OFF ORG 0 GOTO start ORG 4 GOTO start start BSF STATUS,RP0 MOVLW H'00' MOVWF TRISB MOVLW H'01' MOVWF TRISA BCF STATUS,RP0 LOOP MOVLW B' ' CALL DELAY BTFSs PORTA,RA0 GOTO LOOP MOVLW B' ' CALL DELAY GOTO LOOP ٦٧ LedFlasher.asm LIST P=16f84 include "p16f84.inc" config _FOSC_XT & _PWRTE_ON & _WDT_OFF & _CP_OFF ORG 0 GOTO start ORG 4 GOTO start start MOVLW H'00' BSF STATUS,RP0 MOVWF TRISB BCF STATUS,RP0 LOOP MOVLW B' ' CALL DELAY MOVLW B' ' CALL DELAY GOTO LOOP ٦٦ Fara7BentEl3omdah.asm LIST P=16f84 include "p16f84.inc" config _FOSC_XT & _PWRTE_ON & _WDT_OFF & _CP_OFF ORG 0 GOTO start ORG 4 GOTO start start MOVLW H'00' BSF STATUS,RP0 MOVWF TRISB BCF STATUS,RP0 CALL DELAY MOVLW B' ' CALL DELAY MOVLW B' ' CALL DELAY MOVLW B' ' GOTO LOOP ٦٨ LOOP CALL DELAY MOVLW B' '

18 PressControlledLedStatusToogle.as m LIST P=16f84 include "p16f84.inc" config _FOSC_XT & _PWRTE_ON & _WDT_OFF & _CP_OFF ORG 0 GOTO start ORG 4 GOTO start start BSF STATUS,RP0 MOVLW H'00' MOVWF TRISB MOVLW H'01' MOVWF TRISA BCF STATUS,RP0 MOVLW h'00' MOVWF 0X0C MOVLW B' ' ٦٩ LOOP CALL DELAY BTFSS PORTA,RA0 GOTO LOOP COMF 0X0C,F MOVF 0X0C,W GOTO LOOP ٧٠ Thanks,.. See you next week (ISA),

Lecture (04) PIC16F84A (3)

Lecture (04) PIC16F84A (3) Lecture (04) PIC16F84A (3) By: Dr. Ahmed ElShafee ١ Central Processing Unit Central processing unit (CPU) is the brain of a microcontroller responsible for finding and fetching the right instruction which

More information

Lecture (03) PIC16F84 (2)

Lecture (03) PIC16F84 (2) Lecture (03) PIC16F84 (2) By: Dr. Ahmed ElShafee ١ PIC16F84 has a RISC architecture, or Harvard architecture in another word ٢ PIC16F84 belongs to a class of 8 bit microcontrollers of RISC architecture.

More information

Assembly Language Instructions

Assembly Language Instructions Assembly Language Instructions Content: Assembly language instructions of PIC16F887. Programming by assembly language. Prepared By- Mohammed Abdul kader Assistant Professor, EEE, IIUC Assembly Language

More information

Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar

Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar Starting to Program Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar Outline Introduction Program Development Process The PIC 16F84A Instruction Set Examples The PIC 16F84A Instruction Encoding Assembler Details

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 Semester 2 Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J2 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

DERTS Design Requirements (1): Microcontroller Architecture & Programming

DERTS Design Requirements (1): Microcontroller Architecture & Programming Lecture (5) DERTS Design Requirements (1): Microcontroller Architecture & Programming Prof. Kasim M. Al-Aubidy Philadelphia University 1 Lecture Outline: Features of microcomputers and microcontrollers.

More information

Instuction set

Instuction set Instuction set http://www.piclist.com/images/www/hobby_elec/e_pic3_1.htm#1 In PIC16 series, RISC(Reduced Instruction Set Computer) is adopted and the number of the instructions to use is 35 kinds. When

More information

EEE111A/B Microprocessors

EEE111A/B Microprocessors EEE111A/B Microprocessors Revision Notes Lecture 1: What s it all About? Covers the basic principles of digital signals. The intelligence of virtually all communications, control and electronic devices

More information

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27) Lesson 14 Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27) Name and affiliation of the author: N W K Jayatissa Department of Physics,

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J1 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

Lecture (04) PIC 16F84A programming I

Lecture (04) PIC 16F84A programming I Lecture (04) PIC 16F84A programming I Dr. Ahmed M. ElShafee ١ Agenda Introduction to PIC16F84A programming using C language Preprocessors and, Compiler directives Constants Variables and data types Pointers

More information

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work LAB WORK 1 We are studying with PIC16F84A Microcontroller. We are responsible for writing assembly codes for the microcontroller. For the code, we are using MPLAB IDE software. After opening the software,

More information

SOLUTIONS!! DO NOT DISTRIBUTE!!

SOLUTIONS!! DO NOT DISTRIBUTE!! THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF FEBRUARY MID-TERM 2005 Code and Name of Course: EE25M Introduction to Microprocessors Paper: Date and Time: Duration: One Hour INSTRUCTIONS TO CANDIDATES:

More information

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2006 Recitation 01 21.02.2006 CEng336 1 OUTLINE LAB & Recitation Program PIC Architecture Overview PIC Instruction Set PIC Assembly Code Structure 21.02.2006

More information

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS PIC6F87X 3.0 INSTRUCTION SET SUMMARY Each PIC6F87X instruction is a 4bit word, divided into an OPCODE which specifies the instruction type and one or more operands which further specify the operation of

More information

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester Embedded Systems PIC16F84A Sample Programs Eng. Anis Nazer First Semester 2017-2018 Development cycle (1) Write code (2) Assemble / compile (3) Simulate (4) Download to MCU (5) Test Inputs / Outputs PIC16F84A

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design Year: IV DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6008 Microcontroller based system design Semester : VII UNIT I Introduction to PIC Microcontroller

More information

TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE. E4160 Microprocessor & Microcontroller System. Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010

TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE. E4160 Microprocessor & Microcontroller System. Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010 TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010 E4160 Microprocessor & Microcontroller System Learning Outcomes 2 At the end of this topic, students should

More information

Chapter 13. PIC Family Microcontroller

Chapter 13. PIC Family Microcontroller Chapter 13 PIC Family Microcontroller Lesson 15 Instruction Set Most instructions execution Time One instruction cycle If XTAL frequency = 20 MHz, then instruction cycle time is 0.2 s or 200 ns (= 4/20

More information

16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution

16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution 16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

Week1. EEE305 Microcontroller Key Points

Week1. EEE305 Microcontroller Key Points Week1 Harvard Architecture Fig. 3.2 Separate Program store and Data (File) stores with separate Data and Address buses. Program store Has a 14-bit Data bus and 13-bit Address bus. Thus up to 2 13 (8K)

More information

PIC16C84. 8-bit CMOS EEPROM Microcontroller PIC16C84. Pin Diagram. High Performance RISC CPU Features: CMOS Technology: Peripheral Features:

PIC16C84. 8-bit CMOS EEPROM Microcontroller PIC16C84. Pin Diagram. High Performance RISC CPU Features: CMOS Technology: Peripheral Features: 8-bit CMOS EEPROM Microcontroller High Performance RISC CPU Features: Only 35 single word instructions to learn All instructions single cycle (400 ns @ 10 MHz) except for program branches which are two-cycle

More information

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers 18-pin Flash/EEPROM 8-Bit Microcontrollers Devices Included in this Data Sheet: PIC16F83 PIC16F84 PIC16CR83 PIC16CR84 Extended voltage range devices available (PIC16LF8X, PIC16LCR8X) High Performance RISC

More information

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017 Philadelphia University Faculty of Engineering Course Title: Embedded Systems (630414) Instructor: Eng. Anis Nazer Dept. of Computer Engineering Final Exam, First Semester: 2016/2017 Student Name: Student

More information

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory 0907334 6 Experiment 6:Timers Objectives To become familiar with hardware timing

More information

PIC Discussion. By Eng. Tamar Jomaa

PIC Discussion. By Eng. Tamar Jomaa PIC Discussion By Eng. Tamar Jomaa Chapter#2 Programming Microcontroller Using Assembly Language Quiz#1 : Time: 10 minutes Marks: 10 Fill in spaces: 1) PIC is abbreviation for 2) Microcontroller with..architecture

More information

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL NH-67, TRICHY MAIN ROAD, PULIYUR, C.F. 639 114, KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL Subject Name : Embedded System Class/Sem : BE (ECE) / VII Subject Code

More information

PIC16F8X. 8-Bit CMOS Flash/EEPROM Microcontrollers PIC16F8X PIC16CR8X. Pin Diagram. Devices Included in this Data Sheet:

PIC16F8X. 8-Bit CMOS Flash/EEPROM Microcontrollers PIC16F8X PIC16CR8X. Pin Diagram. Devices Included in this Data Sheet: This document was created with FrameMaker 404 PIC16F8X 8-Bit CMOS Flash/EEPROM Microcontrollers Devices Included in this Data Sheet: PIC16F83 PIC16CR83 PIC16F84 PIC16CR84 Extended voltage range devices

More information

ECE Test #1: Name

ECE Test #1: Name ECE 376 - Test #1: Name Closed Book, Closed Notes. Calculators Permitted. September 23, 2016 20 15 10 5 0

More information

Embedded Systems Design (630470) Lecture 4. Memory Organization. Prof. Kasim M. Al-Aubidy Computer Eng. Dept.

Embedded Systems Design (630470) Lecture 4. Memory Organization. Prof. Kasim M. Al-Aubidy Computer Eng. Dept. Embedded Systems Design (630470) Lecture 4 Memory Organization Prof. Kasim M. Al-Aubidy Computer Eng. Dept. Memory Organization: PIC16F84 has two separate memory blocks, for data and for program. EEPROM

More information

Outlines. PIC Programming in C and Assembly. Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University

Outlines. PIC Programming in C and Assembly. Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University PIC ming in C and Assembly Outlines Microprocessor vs. MicroController PIC in depth PIC ming Assembly ming Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University Embedded C

More information

Section 4. Architecture

Section 4. Architecture M Section 4. Architecture HIGHLIGHTS This section of the manual contains the following major topics: 4. Introduction...4-2 4.2 Clocking Scheme/Instruction Cycle...4-5 4.3 Instruction Flow/Pipelining...4-6

More information

Micro II and Embedded Systems

Micro II and Embedded Systems 16.480/552 Micro II and Embedded Systems Introduction to PIC Microcontroller Revised based on slides from WPI ECE2801 Moving Towards Embedded Hardware Typical components of a PC: x86 family microprocessor

More information

Chapter 5 Sections 1 6 Dr. Iyad Jafar

Chapter 5 Sections 1 6 Dr. Iyad Jafar Building Assembler Programs Chapter 5 Sections 1 6 Dr. Iyad Jafar Outline Building Structured Programs Conditional Branching Subroutines Generating Time Delays Dealing with Data Example Programs 2 Building

More information

M PIC16F84A. 18-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller. High Performance RISC CPU Features: Pin Diagrams. Peripheral Features:

M PIC16F84A. 18-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller. High Performance RISC CPU Features: Pin Diagrams. Peripheral Features: M PIC6F84A 8-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller High Performance RISC CPU Features: Pin Diagrams Only 35 single word instructions to learn All instructions single-cycle except for program branches

More information

16.317: Microprocessor-Based Systems I Summer 2012

16.317: Microprocessor-Based Systems I Summer 2012 16.317: Microprocessor-Based Systems I Summer 2012 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

/* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */

/* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */ /* PROGRAM FOR BLINKING LEDs CONEECTED TO PORT-D */ CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _HS_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF ;***** VARIABLE DEFINITIONS COUNT_L EQU 0x01 ;**********************************************************************

More information

Learning Objectives:

Learning Objectives: Topic 5.2.1 PIC microcontrollers Learning Objectives: At the end of this topic you will be able to; Recall the architecture of a PIC microcontroller, consisting of CPU, clock, data memory, program memory

More information

Embedded System Design

Embedded System Design ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ Embedded System Design : Microcontroller 1. Introduction to PIC microcontroller 2. PIC16F84 3. PIC16F877

More information

D:\PICstuff\PartCounter\PartCounter.asm

D:\PICstuff\PartCounter\PartCounter.asm 1 ;********************************************************************** 2 ; This file is a basic code template for assembly code generation * 3 ; on the PICmicro PIC16F84A. This file contains the basic

More information

PIC16C63A/65B/73B/74B

PIC16C63A/65B/73B/74B PI663A/65B/73B/74B 4.0 MEMORY ORGANIATION 4. Program Memory Organization The PI663A/65B/73B/74B has a 3bit program counter capable of addressing an 8K x 4 program memory space. All devices covered by this

More information

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features:

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features: M PIC6F84A 8-pin Enhanced Flash/EEPROM 8-Bit Microcontroller Devices Included in this Data Sheet: PIC6F84A Extended voltage range device available (PIC6LF84A) High Performance RISC CPU Features: Only 35

More information

which means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch.

which means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch. Introduction to microprocessors Feisal Mohammed 3rd January 2001 Additional features 1 Input/Output Ports One of the features that differentiates a microcontroller from a microprocessor is the presence

More information

Fortune. Semiconductor Corporation 富晶半導體股份有限公司. 8-bit MCU with 1k program ROM, 64-byte RAM, 1 R2F module and 3 13 LCD driver. TD Rev. 1.

Fortune. Semiconductor Corporation 富晶半導體股份有限公司. 8-bit MCU with 1k program ROM, 64-byte RAM, 1 R2F module and 3 13 LCD driver. TD Rev. 1. Fortune 1 R2F module and 3 13 LCD driver. Data Sheet TD-0410001 Rev. 1.2 This manual contains new product information. Fortune reserves the rights to modify the product specification without further notice.

More information

CONNECT TO THE PIC. A Simple Development Board

CONNECT TO THE PIC. A Simple Development Board CONNECT TO THE PIC A Simple Development Board Ok, so you have now got your programmer, and you have a PIC or two. It is all very well knowing how to program the PIC in theory, but the real learning comes

More information

EE6008-Microcontroller Based System Design Department Of EEE/ DCE

EE6008-Microcontroller Based System Design Department Of EEE/ DCE UNIT- II INTERRUPTS AND TIMERS PART A 1. What are the interrupts available in PIC? (Jan 14) Interrupt Source Enabled by Completion Status External interrupt from INT INTE = 1 INTF = 1 TMR0 interrupt T0IE

More information

PIC16F84A 7.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

PIC16F84A 7.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS PI6F84A 7.0 INSTRUTION SET SUMMARY Each PI6XX instruction is a 4bit word, divided into an OPODE which specifies the instruction type and one or more operands which further specify the operation of the

More information

SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER

SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER Amey Arvind Madgaonkar 1, Sumit Dhere 2 & Rupesh Ratnakar Kadam 3 1. Block diagram International Journal of Latest Trends in Engineering

More information

movwf prevcod ; a new button is pressed - rcnt=3 movwf (mtx_buffer+1) movlw 3 movwf rcnt

movwf prevcod ; a new button is pressed - rcnt=3 movwf (mtx_buffer+1) movlw 3 movwf rcnt movlw 0x20 #endif call scan movlw 0xfd tris PORTB ; select colb (RB1) #ifdef MODE_CH8 movlw 0x04 #endif #ifdef MODE_CH4 movlw 0x30 #endif call scan movf cod, W bz loop2 ; if no buton is pressed, skip subwf

More information

16.317: Microprocessor-Based Systems I Spring 2012

16.317: Microprocessor-Based Systems I Spring 2012 16.317: Microprocessor-Based Systems I Spring 2012 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

PIC16C432 OTP 8-Bit CMOS MCU with LIN bus Transceiver

PIC16C432 OTP 8-Bit CMOS MCU with LIN bus Transceiver OTP 8-Bit CMOS MCU with LIN bus Transceiver Devices included in this Data Sheet: High Performance RISC CPU: Only 35 instructions to learn All single cycle instructions (200 ns), except for program branches

More information

PTK8756B 8 Bit Micro-controller Data Sheet

PTK8756B 8 Bit Micro-controller Data Sheet PTK8756B 8 Bit Micro-controller DEC 15, 2008 Ver1.1 普泰半導體股份有限公司 PORTEK Technology Corporation 公司地址 : 臺北縣新店市寶橋路 235 巷 120 號 4 樓 聯絡電話 : 886-2-89121055 傳真號碼 : 886-2-89121473 公司網址 : www.portek.com.tw Page1

More information

Application Note - PIC Source Code v1.1.doc

Application Note - PIC Source Code v1.1.doc Programmable, RGB-backlit LCD Keyswitches APPLICATION NOTE PIC SOURCE CODE 2004-2006 copyright [E³] Engstler Elektronik Entwicklung GmbH. All rights reserved. PIC Source Code The following Assembler source

More information

ME 6405 Introduction to Mechatronics

ME 6405 Introduction to Mechatronics ME 6405 Introduction to Mechatronics Fall 2006 Instructor: Professor Charles Ume Microchip PIC Manufacturer Information: Company: Website: http://www.microchip.com Reasons for success: Became the hobbyist's

More information

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester Embedded Systems PIC16F84A Internal Architecture Eng. Anis Nazer First Semester 2017-2018 Review Computer system basic components? CPU? Memory? I/O? buses? Instruction? Program? Instruction set? CISC,

More information

Section 31. Instruction Set

Section 31. Instruction Set 31 HIGHLIGHTS Section 31. Instruction Set Instruction Set This section of the manual contains the following major topics: 31.1 Introduction... 31-2 31.2 Data Memory Map... 31-3 31.3 Instruction Formats...

More information

Model Answer Microcontrollers. MCQ Problems Total Q1 Q2

Model Answer Microcontrollers. MCQ Problems Total Q1 Q2 Model Answer Course name: Microcontrollers Exam numer: Midterm - Fall 2017 Course Code: ECE401 Exam Date: Nov 2016 Lecturer: Dr. Ahmed ElShafee Time Allowed: 60 minutes ID:... Name:.... MCQ Prolems Total

More information

Chapter 2 Sections 1 8 Dr. Iyad Jafar

Chapter 2 Sections 1 8 Dr. Iyad Jafar Introducing the PIC 16 Series and the 16F84A Chapter 2 Sections 1 8 Dr. Iyad Jafar Outline Overview of the PIC 16 Series An Architecture Overview of the 16F84A The 16F84A Memory Organization Memory Addressing

More information

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller Maxim > App Notes > 1-Wire DEVICES BATTERY MANAGEMENT Keywords: 1-wire, PICmicro, Microchip PIC, 1-Wire communication, PIC microcontroller, PICmicro microcontroller, 1 wire communication, PICs, micros,

More information

CHAPTER 1. Introduction to Microcontrollers. Introduction

CHAPTER 1. Introduction to Microcontrollers. Introduction Chapter 1 - Introduction to Microprocessors CHAPTER 1 Introduction to Microcontrollers Introduction History Microcontrollers versus microprocessors 1.1 Memory unit 1.2 Central processing unit 1.3 Buses

More information

Chapter 3: Further Microcontrollers

Chapter 3: Further Microcontrollers Chapter 3: Further Microcontrollers Learning Objectives: At the end of this topic you will be able to: recall and describe the structure of microcontrollers as programmable assemblies of: memory; input

More information

Hardware Interfacing. EE25M Introduction to microprocessors. Part V. 15 Interfacing methods. original author: Feisal Mohammed

Hardware Interfacing. EE25M Introduction to microprocessors. Part V. 15 Interfacing methods. original author: Feisal Mohammed EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 18th February 2002 CLR Part V Hardware Interfacing There are several features of computers/microcontrollers which have not

More information

Flow Charts and Assembler Programs

Flow Charts and Assembler Programs Flow Charts and Assembler Programs Flow Charts: A flow chart is a graphical way to display how a program works (i.e. the algorithm). The purpose of a flow chart is to make the program easier to understand.

More information

PIC16F8X PIC16F8X. 18-pin Flash/EEPROM 8-Bit Microcontrollers

PIC16F8X PIC16F8X. 18-pin Flash/EEPROM 8-Bit Microcontrollers Devices Included in this Data Sheet: PIC6F83 PIC6F84 PIC6CR83 PIC6CR84 Extended voltage range devices available (PIC6LF8X, PIC6LCR8X) High Performance RISC CPU Features: Only 35 single word instrucs to

More information

A Better Mouse Trap. Consumer Appliance, Widget, Gadget APPLICATION OPERATION: Ontario, Canada

A Better Mouse Trap. Consumer Appliance, Widget, Gadget APPLICATION OPERATION: Ontario, Canada A Better Mouse Trap Author: APPLICATION OPERATION: My application uses a PIC12C508 to produce realistic sounding mouse-like coos that all mice are sure to find seductive. The entire circuit should be imbedded

More information

PIC16C52. EPROM-Based 8-Bit CMOS Microcontroller PIC16C52. Pin Diagrams. Feature Highlights. High-Performance RISC CPU. Peripheral Features

PIC16C52. EPROM-Based 8-Bit CMOS Microcontroller PIC16C52. Pin Diagrams. Feature Highlights. High-Performance RISC CPU. Peripheral Features This document was created with FrameMaker 404 PIC16C52 EPROM-Based 8-Bit CMOS Microcontroller Feature Highlights Pin Diagrams Program Memory Data Memory I/O PDIP, SOIC 384 25 12 High-Performance RISC CPU

More information

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics: M 11 Section 11. HIGHLIGHTS This section of the manual contains the following major topics: 11.1 Introduction...11-2 11.2 Control Register...11-3 11.3 Operation...11-4 11.4 TMR0 Interrupt...11-5 11.5 Using

More information

Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh

Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh Work Completed: Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh Last week started with the goal to complete writing the overall program for the game.

More information

EECE.3170: Microprocessor Systems Design I Summer 2017 Homework 5 Solution

EECE.3170: Microprocessor Systems Design I Summer 2017 Homework 5 Solution For each of the following complex operations, write a sequence of PIC 16F1829 instructions that performs an equivalent operation. Assume that X, Y, and Z are 16-bit values split into individual bytes as

More information

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller Maxim/Dallas > App Notes > REAL-TIME CLOCKS Keywords: DS1305, SPI, PIC, real time clock, RTC, spi interface, pic microcontroller Aug 20, 2003 APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with

More information

Arithmetic,logic Instruction and Programs

Arithmetic,logic Instruction and Programs Arithmetic,logic Instruction and Programs 1 Define the range of numbers possible in PIC unsigned data Code addition and subtraction instructions for unsigned data Perform addition of BCD Code PIC unsigned

More information

TM57PA20/ TM57PA40. 8 Bit Microcontroller. User Manual. Tenx reserves the right to change or discontinue this product without notice.

TM57PA20/ TM57PA40. 8 Bit Microcontroller. User Manual. Tenx reserves the right to change or discontinue this product without notice. Advance Information TM57PA20/ TM57PA40 User Manual Tenx reserves the right to change or discontinue this product without notice. tenx technology inc. tenx technology, inc. CONTENTS FEATURES... 3 BLOCK

More information

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4 Overview of the PIC 16F648A Processor: Part 1 EE 361L Lab 2.1 Last update: August 1, 2016 Abstract: This report is the first of a three part series that discusses the features of the PIC 16F648A processor,

More information

When JP1 is cut, baud rate is Otherwise, baud rate is Factory default is that JP1 is shorted. (JP1 is jumper type in some model)

When JP1 is cut, baud rate is Otherwise, baud rate is Factory default is that JP1 is shorted. (JP1 is jumper type in some model) ELCD SERIES INTRODUCTION ALCD is Serial LCD module which is controlled through Serial communication. Most of existing LCD adopts Parallel communication which needs lots of control lines and complicated

More information

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application...

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application... Overview of the PIC 16F648A Processor: Part 1 EE 361L Lab 2.1 Last update: August 19, 2011 Abstract: This report is the first of a three part series that discusses the features of the PIC 16F684A processor,

More information

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK 134 CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK 6.1 CONCLUSION Many industrial processes such as assembly lines have to operate at different speeds for different products. Process control may demand

More information

Outline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware:

Outline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware: HCMIU - DEE Subject: ERTS RISC MCU Architecture PIC16F877 Hardware 1 Outline Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware: Program Memory Data memory organization: banks,

More information

More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller

More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller 1 von 8 24.02.2010 21:53 More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller As with the FPGA board previously, the connections are made by soldering standard IDC

More information

DESIGN AND FABRICATION OF FARE METER OF TAXICAB USING MICROCONTROLLER

DESIGN AND FABRICATION OF FARE METER OF TAXICAB USING MICROCONTROLLER Proceedings of the International Conference on Mechanical Engineering 00 (ICME00) 8-0 December 00, Dhaka, Bangladesh ICME0-AM-0 DESIGN AND FABRICATION OF FARE METER OF TAXICAB USING MICROCONTROLLER Md.

More information

S w e d i s h c r. w e e b l y. c o m j a l i l a h m e l i v e. c o m Page 1

S w e d i s h c r. w e e b l y. c o m j a l i l a h m e l i v e. c o m Page 1 ********************************************************************** This file is a basic code template for assembly code generation * on the PICmicro PIC12C508. This file contains the basic code * building

More information

ME 515 Mechatronics. A microprocessor

ME 515 Mechatronics. A microprocessor ME 515 Mechatronics Microcontroller Based Control of Mechanical Systems Asanga Ratnaweera Department of Faculty of Engineering University of Peradeniya Tel: 081239 (3627) Email: asangar@pdn.ac.lk A microprocessor

More information

/ 40 Q3: Writing PIC / 40 assembly language TOTAL SCORE / 100 EXTRA CREDIT / 10

/ 40 Q3: Writing PIC / 40 assembly language TOTAL SCORE / 100 EXTRA CREDIT / 10 16.317: Microprocessor-Based Systems I Summer 2012 Exam 3 August 13, 2012 Name: ID #: Section: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic

More information

Lecture (02) PIC16F84 (I)

Lecture (02) PIC16F84 (I) Lecture (02) PIC16F84 (I) By: Dr. Ahmed ElShafee ١ Review of Memory Technologies The PIC 16 Series PIC 16F84A The PIC 16F84A Memory The Oscillator Instruction Cycle Power up and Reset Parallel ports Technical

More information

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!!

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!! THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF APRIL MID-TERM 2005 Code and Name of Course: EE25M Introduction to Microprocessors Paper: MidTerm Date and Time: Thursday April 14th 2005 8AM Duration:

More information

Chapter 11: Interrupt On Change

Chapter 11: Interrupt On Change Chapter 11: Interrupt On Change The last two chapters included examples that used the external interrupt on Port C, pin 1 to determine when a button had been pressed. This approach works very well on most

More information

ME 475 Lab2 Introduction of PIC and Programming. Instructor: Zhen Wang

ME 475 Lab2 Introduction of PIC and Programming. Instructor: Zhen Wang ME 475 Lab2 Introduction of PIC and Programming Instructor: Zhen Wang 2013.1.25 Outline Lecture Introduction of PIC microcontroller Programming cycle Read CH5 Programming guidelines Read CH6 Sample program

More information

Mod-5: PIC 18 Introduction 1. Module 5

Mod-5: PIC 18 Introduction 1. Module 5 Mod-5: PIC 18 Introduction 1 Module 5 Contents: Overview of PIC 18, memory organisation, CPU, registers, pipelining, instruction format, addressing modes, instruction set, interrupts, interrupt operation,

More information

Arithmetic and Logic Instructions. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Arithmetic and Logic Instructions. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan Arithmetic and Logic Instructions Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.tw Find the sum of the values from 40H to 43H. Put the sum in filereg locations

More information

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU:

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU: 14-Pin, 8-Bit CMOS Microcontroller Device included in this Data Sheet: PIC16C505 High-Performance RISC CPU: Only 33 instructions to learn Operating speed: - DC - 20 MHz clock input - DC - 200 ns instruction

More information

PIN DESCRIPTION Name I/O Description VDD P VSS P 5V Power from USB cable Ground RC6M O X1 I Test/OTP mode clock in Internal clock output (6MHz) VPP I

PIN DESCRIPTION Name I/O Description VDD P VSS P 5V Power from USB cable Ground RC6M O X1 I Test/OTP mode clock in Internal clock output (6MHz) VPP I GENERAL DESCRIPTION The IN6005 is an 8-bit microprocessor embedded device tailored to the USB genernal purpose application. It includes an 8-bit RISC CPU core, 192-byte SRAM, Low Speed USB Interface and

More information

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU:

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU: 14-Pin, 8-Bit CMOS Microcontroller Device included in this Data Sheet: PIC16C505 High-Performance RISC CPU: Only 33 instructions to learn Operating speed: - DC - 20 MHz clock input - DC - 200 ns instruction

More information

PIC16F5X Data Sheet. Flash-Based, 8-Bit CMOS Microcontroller Series

PIC16F5X Data Sheet. Flash-Based, 8-Bit CMOS Microcontroller Series Data Sheet Flash-Based, 8-Bit CMOS Microcontroller Series Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular

More information

ABOV SEMICONDUCTOR 8-BIT SINGLE-CHIP MICROCONTROLLERS MC71PD506. USER S MANUAL (Ver. 1.0)

ABOV SEMICONDUCTOR 8-BIT SINGLE-CHIP MICROCONTROLLERS MC71PD506. USER S MANUAL (Ver. 1.0) ABOV SEMICONDUCTOR 8-BIT SINGLE-CHIP MICROCONTROLLERS MC71PD506 USER S MANUAL (Ver. 1.0) TABLE OF CONTENTS 1. PRODUCT OVERVIEW... 1 2. MEMORY ORGANIZATION... 12 3. INTERRUPT... 26 4. INSTRUCTIONS SET...

More information

CENG-336 Introduction to Embedded Systems Development. Timers

CENG-336 Introduction to Embedded Systems Development. Timers CENG-336 Introduction to Embedded Systems Development Timers Definitions A counter counts (possibly asynchronous) input pulses from an external signal A timer counts pulses of a fixed, known frequency

More information

To Our Valued Customers

To Our Valued Customers Devices Included in this Data Sheet: PIC12C671 PIC12C672 PIC12CE673 PIC12CE674 Note: Throughout this data sheet PIC12C67X refers to the PIC12C671, PIC12C672, PIC12CE673 and PIC12CE674. PIC12CE67X refers

More information

Performance & Applications

Performance & Applications EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 15th March 2002 CLR Part VI Performance & Applications It is possible to predict the execution time of code, on the basis

More information

PIC16F5X Data Sheet. Flash-Based, 8-Bit CMOS Microcontroller Series Microchip Technology Inc. DS41213D

PIC16F5X Data Sheet. Flash-Based, 8-Bit CMOS Microcontroller Series Microchip Technology Inc. DS41213D Data Sheet Flash-Based, 8-Bit CMOS Microcontroller Series 2007 Microchip Technology Inc. DS41213D Note the following details of the code protection feature on Microchip devices: Microchip products meet

More information

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6 Mechatronics and Measurement Lecturer:Dung-An Wang Lecture 6 Lecture outline Reading:Ch7 of text Today s lecture: Microcontroller 2 7.1 MICROPROCESSORS Hardware solution: consists of a selection of specific

More information

Figure 1: Pushbutton without Pull-up.

Figure 1: Pushbutton without Pull-up. Chapter 7: Using the I/O pins as Inputs. In addition to working as outputs and being able to turn the I/O pins on and off, these same pins can be used as inputs. In this mode the PIC is able to determine

More information

PIC10F200/202/204/206 Data Sheet

PIC10F200/202/204/206 Data Sheet Data Sheet 6-Pin, 8-Bit Flash Microcontrollers DS4239A 6-Pin, 8-Bit Flash Microcontrollers Devices Included In ThisData Sheet: PIC0F200 PIC0F202 PIC0F204 PIC0F206 High-Performance RISC CPU: Only 33 single-word

More information