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

Size: px
Start display at page:

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

Transcription

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

2 TABLE OF CONTENTS 1. PRODUCT OVERVIEW MEMORY ORGANIZATION INTERRUPT INSTRUCTIONS SET CLOCK CIRCUIT RESET AND POWER-DOWN MODE I/O PORTS WATCHDOG TIMER BIT TIMER BIT TIMER 1 (8-BIT TIMER A/B) REAL TIMER SERIAL INTERFACE LCD CONTROLLER/DRIVER ELECTRICAL DATA MECHANICAL DATA MC71PD506 OTP DEVELOPMENT TOOLS

3 1. PRODUCT OVERVIEW 1.1 KEY FEATURES CPU Main clock Sub clock Instruction set ROM capacity RAM capacity Instruction execution times I/O Port Programmable timer LCD driver GMC14 core (8-bit RISC CPU) 0.4MHz 12MHz (Crystal, ceramic, or RC) kHz (Crystal) 35 instructions single word instructs 14-bit wide instruction word 6,144 x 14-bits (10,752-Byte) 176 x 8-bits (30 x 8-bits including LCD display RAM) 167nS at 12MHz fx (main) 61uS at kHz fxt (sub) I/O: 47 bits Normal I/O: 13bits LCD shared I/O: 34 bits One 8-bit timer/counter One 16-bit timer/counter (Shared with two 8-bit timer/counters) 26 segments x 2/ 3/ 4/ 5/ 6/ 8 commons (Internal or external resistor bias) Bias selectable (1/2, 1/3, 1/4) Watchdog timer function Time interval generation Serial Interface Interrupt Power supply voltage 0.25, 0.5, 1S and 10mS at KHz Eight-frequency output to BUZ pin Mode0: synchronous Mode1: asynchronous External: Twelve external interrupts Internal: WDT interrupt : Timer 0 interrupt (8-bit) : Timer 1/A interrupt (16/8-bit) : Timer B interrupt (8-bit) : Real timer interrupt 2.4 V to 5.5 V at 4MHz 2.7 V to 5.5 V at 8MHz 4.0 V to 5.5 V at 12MHz SEP.2007 VER 1.0 1

4 1.1 KEY FEATURES (CONTINUED) Operating temperature -20 to +85 Power-saving Idle: only CPU clock stop Stop: System clock and CPU clock stop Package 64-pin LQFP, Pallet 2 SEP.2007 VER 1.0

5 1.2 Ordering Information MC71PD506E MC71PD506C Device ROM Size RAM size Package 6K words OTP 6K words OTP 176 bytes 176 bytes 64 LQFP Pellet(Probe tested wafer) SEP.2007 VER 1.0 3

6 1.3 BLOCK DIAGRAM XIN nmclr XTIN XOUT XTOUT VDD VSS T0PWM/P4.4 T1OUT/P0.1 T1CLK/P0.0 T1CLK/P0.0 T1OUT/P0.1 P0.2 P0.3 INT0 INT3/P0.4 P0.7 SEG29 SEG22/ INT4 INT11/P1.0 P1.7 8-Bit Timer/ Counter 0 16-Bit Timer/ Counter 1 Port 0 Port 1 SEG21 SEG14/P2.0 P2.7 Port 2 SEG13 SEG6/P3.0 P3.7 Port 3 Port I/O and Interrupt Control 6,144 X 14-bit ROM GMC14Core (8-bit RISC CPU) 176 X 8-bit Register File Watchdog Timer Real Timer LCD Driver/ Controller Serial Interface Port 5 Port 4 BUZ/P4.3 COM0 COM3/P5.7 P5.4 COM4 COM7/SEG0 SEG3/P5.3 P5.0 SEG4 SEG5/P4.6 P4.5 SEG6 SEG13/P3.7 P3.0 SEG14 SEG21/P2.7 P2.0 SEG22 SEG29/P1.7 P1.0 VLC0 VLC3 SCK/P4.0 SO/P4.1 SI/P4.2 P5.4 P5.7/COM3 COM0 P5.0 P5.3/SEG3 SEG0/ COM7 COM4 P4.0/SCK P4.1/SO P4.2/SI P4.3/BUZ P4.4/T0PWM P /SEG5 SEG4 Figure 1-1. Block Diagram 4 SEP.2007 VER 1.0

7 1.4 PIN ASSIGNMENTS PIN PACKAGE NC P4.0/SCK P4.1/SO P4.2/SI P4.3/BUZ P4.4/T0PWM P1.0/INT4/SEG29 P1.1/INT5/SEG28 P1.2/INT6/SEG27 P1.3/INT7/SEG26 P1.4/INT8/SEG25 P1.5/INT9/SEG24 P1.6/INT10/SEG23 P1.7/INT11/SEG22 P2.0/SEG21 NC MC71PD NC P2.1/SEG20 P2.2/SEG19 P2.3/SEG18 P2.4/SEG17 P2.5/SEG16 P2.6/SEG15 P2.7/SEG14 P3.0/SEG13 P3.1/SEG12 P3.2/SEG11 P3.3/SEG10 P3.4/SEG9 P3.5/SEG8 P3.6/SEG7 P3.7/SEG6 P0.7/INT3 P0.6/INT2 VSS P0.5/INT1 P0.4/INT0 XOUT XIN NMCLR (Vpp) XTIN XTOUT P0.3 (SDATA) P0.2 (SCLK) VDD P0.1/T1OUT P0.0/T1CLK NC NC P5.7/COM0 P5.6/COM1 P5.5/COM2 P5.4/COM3 P5.3/COM4/SEG0 P5.2/COM5/SEG1 P5.1/COM6/SEG2 P5.0/COM0/SEG3 VLC3 VLC2 VLC1 VLC0 P4.6/SEG4 P4.5/SEG5 NC Figure 1-2. MC71PD506 Pin Assignments (64-Pin) SEP.2007 VER 1.0 5

8 1.5 PIN DESCRIPTIONS Pin Names I/O Pin Description After RESET Alternative Functions P0.0 I/O 1-bit programmable I/O pin. Schmitt trigger input, Pushpull output, or Open-drain output port. Used as an input Input T1CLK P0.1 T1OUT port, a Pull-up resistor can be programmed as 1-bit. P0.2 - P0.3 - P0.4 INT0 P0.5 INT1 P0.6 INT2 P0.7 INT3 P1.0 I/O 1-bit programmable I/O pin. Schmitt trigger input, Pushpull output, or Open-drain output port. Used as an input Input INT4/SEG29 P1.1 INT5/SEG28 port, a Pull-up resistor can be programmed as 1-bit. P1.2 INT6/SEG27 P1.3 INT7/SEG26 P1.4 INT8/SEG25 P1.5 INT9/SEG24 P1.6 INT10/SEG23 P1.7 INT11/SEG22 P2.0 I/O Pair-bit programmable I/O pin. Input, Push-pull output, or Input SEG21 P2.1 Open-drain output port. Used as an input port, a Pull-up SEG20 resistor can be programmed as pair-bit. P2.2 SEG19 P2.3 SEG18 P2.4 SEG17 P2.5 SEG16 P2.6 SEG15 P2.7 SEG14 P3.0 I/O Pair-bit programmable I/O pin. Input, Push-pull output, or Input SEG13 P3.1 Open-drain output port. Used as an input port, a Pull-up SEG12 resistor can be programmed as pair-bit. P3.2 SEG11 P3.3 SEG10 P3.4 SEG9 P3.5 SEG8 P3.6 SEG7 P3.7 SEG6 6 SEP.2007 VER 1.0

9 1.5 PIN DESCRIPTIONS (CONTINUED) Pin Names I/O Pin Description After RESET Alternative Functions P4.0 I/O 1-bit programmable I/O pin. Input, Push-pull output, or Input SCK P4.1 Open-drain output port. Used as an input port, a Pull-up SO resistor can be programmed as 1-bit. P4.2 SI P4.3 BUZ P4.4 T0PWM P4.5 SEG5 P4.6 SEG4 P5.0 I/O 1-bit programmable I/O pin. Input, Push-pull output, or Input SEG3/COM7 P5.1 Open-drain output port. Used as an input port, a Pull-up SEG2/COM6 resistor can be programmed as 1-bit. P5.2 SEG1/COM5 P5.3 SEG0/COM4 P5.4 COM3 P5.5 COM2 P5.6 COM1 P5.7 COM0 T1CLK I/O Timer 1/A external clock input Input P0.0 T1OUT I/O Timer 1/A data output Input P0.1 INT0 I/O External interrupt input pins Input P0.4 INT1 P0.5 INT2 P0.6 INT3 P0.7 SCK I/O Serial clock Input P4.0 SI I/O Serial data input Input P4.2 SO I/O Serial data output Input P4.1 BUZ I/O Buzzer signal output Input P4.3 T0PWM I/O Timer 0 PWM output Input P4.4 INT4 I/O External interrupt input pins Input P1.0 INT5 P1.1 INT6 P1.2 INT7 P1.3 INT8 P1.4 INT9 P1.5 INT10 P1.6 INT11 P1.7 SEP.2007 VER 1.0 7

10 1.5 PIN DESCRIPTIONS (CONTINUED) Pin Names I/O Pin Description After RESET Alternative Functions SEG29 SEG22 I/O LCD Segment signal output Input P1.0 P1.7 SEG21 SEG14 P2.0 P2.7 SEG13 SEG6 P3.0 P3.7 SEG5 SEG4 P4.5 P4.6 SEG3 SEG0 P5.0 P5.3 COM0 COM7 I/O LCD common signal output Input P5.7 P5.0 VLC0 VLC3 - LCD bias voltage input pins - - nmclr I System reset pin - - XIN,XOUT - Main oscillator pins - - XTIN,XTOUT - Sub oscillator pins. - - VDD,VSS - Power input pins SEP.2007 VER 1.0

11 1.6 PIN CIRCUITS In Schmitt Trigger Figure 1-3. Pin Circuit Type 1 (nmclr) VDD Pull-up Enable OPEN-DRAIN ENABLE DATA OUTPUT DISABLE VDD P- Channel N- Channel I/O VSS Figure 1-4. Pin Circuit Type 4-1 (P0) SEP.2007 VER 1.0 9

12 VDD OPEN-DRAIN ENABLE Pull-up Enable VDD P- Channel DATA OUTPUT DISABLE VSS N- Channel I/O Figure 1-5. Pin Circuit Type 4-0 (P4.0-P4.4) V LC0 V LC1 COM/ SEG OUTPUT Disable OUT VLC2 VLC3 VSS Figure 1-6. Pin Circuit Type SEP.2007 VER 1.0

13 VDD Open Drain Data Output Disable 1 VDD P-CH N-CH Pull-Up Resistor I/O Resistor Enable COM/SEG Output Disable 2 Circuit Type 7-5 Figure 1-7. Pin Circuit Type 7-1 (P1) VDD Open Drain Data Output Disable 1 VDD P-CH N-CH Pull-Up Resistor I/O Resistor Enable COM/SEG Output Disable 2 Circuit Type 7-5 Figure 1-8. Pin Circuit Type 7-2 (P2, P3, P4.5-P4.6, P5) SEP.2007 VER

14 User Memory Space MC71PD MEMORY ORGANIZATION 2.1 PROGRAM MEMORY ORGANIZATION The GMC14 series have a 16-bit program counter capable of addressing a 64k x 14-bit program memory space. The reset vector is at 0000H and the interrupt vector is at 0004H. The program memory size of the MC71PD506 is 6k words (6k x 14-bit, from the address 0000H to 17FFH). PC<15:0> 16 Stack Level 1 Stack Level 8 Reset Vector 0000H Interrupt Vector On-chip program Memory (page 0) On-chip program Memory (page 1) On-chip program Memory (page 2) 0004H 0005H 07FFH 0800H 0FFFH 1000H 17FFH 1800H On-chip program Memory (page 30) On-chip program Memory (page 31) EFFFH F000H F7FFH F800H FFFFH Figure 2-1. Program Memory Map and Stack 12 SEP.2007 VER 1.0

15 2.1.1 PC AND PCLATH REGISTERS The Program Counter (PC) is 16-bit wide. The lower bits (PC<7:0>) come from PCL register, which is a readable and writable register. The upper bits (PC<15:8>) are not directly readable (or writable), but are indirectly writable through the PCLATH register. On any reset, (the upper bits of) the PC is (will be) cleared. Figure 2-2 shows the two situations for PC loading. The upper example in the figure 2-2 shows how the PC is loaded by writing to PCL (PCLATH<7:0> PCH). The lower example in the figure 2-2 shows how the PC is loaded during a CALL or GOTO instruction (PCLATH<7:3> PCH). Write to PCL PCH PCL PC PCLATH ALU RESULT 7 0 GOTO, CALL PCH PCL PC OPCODE[10:0] PCLATH Figure 2-2. Loading of PC in different situations A computed GOTO is accomplished by adding an offset to the program counter (ADDWF PCL). When reading a table using a computed GOTO method, pay attention if the table location crosses a PCL memory boundary (each 256 byte block). SEP.2007 VER

16 2.1.2 Program memory paging The GMC14 series devices are capable of addressing a continuous 64k words block of program memory. The CALL and GOTO instructions provide only 11 bits of address to allow branching within any 2k words program memory page. When doing a CALL or GOTO instruction the upper 5 bits of the address are provided by PCLATH<7:3>. When doing a CALL or GOTO instruction, the user must ensure that the page select bits are programmed so that the desired program memory page is addressed. If RETURN, RETLW, or RETFIE instructions are executed, the entire 16-bit PC is popped from the stack. Therefore, manipulation of the PCLATH<7:3> bits is not required for the return instructions (which pops the address from the stack). NOTE: Because the MC71PD506 use only PCLATH<4:0> bit, the PCLATH<7:5> bits should be always logic 000b. 2.2 STACK The GMC14 series has an 8 level depth x 16-bit width hardware stack. The stack space is neither part of program nor data space and the stack pointer is not readable or writable. The PC is pushed onto the stack when a CALL instruction is executed or an interrupt causes a branch. The stack is popped in the event of a RETURN, RETLW or a RETFIE instruction execution. PCLATH is not affected by a push or pop operation. The stack operates as a circular buffer. This means that after the stack has been pushed eight times, the ninth push overwrites the value that stored from the first push. The tenth push overwrites the second push (and so on). NOTES: 1. There are no STATUS bits to indicate stack overflow or stack underflow conditions. 2. There are no instructions/mnemonics called push or pop. These are actions that occur from the execution of the CALL, RETURN, RETLW, and RETFIE instructions, or the vectoring to an interrupt address. 14 SEP.2007 VER 1.0

17 2.3 DATA MEMORY The data memory for the MC71PD506 is partitioned onto two banks which contain the general purpose registers and the special function registers. Bank 0 is selected when the RP1:RP0 bits in status register are 00b and bank 1 when RP1:RP0 are 01b. 00H Indirect addr 80H Indirect addr 1FH Special Function Register 9FH Special Function Register 20H A0H General purpose Register 7FH General purpose Register D1H D2H LCD Display RAM EFH F0H Mapped in Bank 0 70H - 7FH FFH Bank 0 Bank 1 Figure 2-3. Register File Organization (MC71PD506) The lower locations of each bank are reserved for the special function registers. The upper locations of each bank are general purpose registers implemented as static RAM. All two banks contain special function registers. Some of the special function registers are mirrored in other banks for code reduction and quicker access. The register file can be accessed either directly, or indirectly through the File Select Register (FSR). Refer to addressing mode GENERAL PURPOSE REGISTER The size of the MC71PD506 s general purpose register is 176 bytes (20H~7FH and A0H~EFH(30-byte including LCD display RAM)). The following general purpose registers are not physically implemented: - 0F0H-0FFH of Bank 1 These locations are used for common access across banks. SEP.2007 VER

18 2.3.2 SPECIAL FUNCTION REGISTER There are 51 bytes of special function register. Some of the special function registers are visible on any of two memory banks. As is shown in figure below; 00H 01H 02H 03H 04H 05H 06H 07H 08H 09H 0AH 0BH 0CH 0DH 0EH 0FH 10H 11H 12H 13H 14H 15H 16H 17H 18H 19H 1AH 1BH 1CH 1DH 1EH 1FH 20H 7FH CONFIG CPUCLK PCL STATUS FSR SICR SIDAT SIPS WTSCR WTCR PCLATH INTCON IPND TSCR0 TCR0 TDR0H TDR0L TSCRA TCRA TDRA TSCRB TCRB TDRB RTSCR LCDR RAM Memory Space Bank 0 CONFIG OSCSEL PCL STATUS FSR DDR0H DDR0L PUR0 EINT0 EPND0 PCLATH - DDR1H DDR1L PUR1 EINT1 EPND1 DDR2 DDR3 PUR2n3 DDR4H DDR4L PUR4 DDR5H DDR5L PUR5 P0 P1 P2 P3 P4 P5 RAM Memory Space Bank 1 Figure 2-4. Data memory map The special function registers are the registers used by the cpu and peripheral modules for controlling the desired operation of the device. These registers are implemented as static RAM. The special function registers can be classified into two sets (core and peripheral). The special function registers associated with the core functions are described below. The rest of special function registers are described in the corresponding peripheral section. 16 SEP.2007 VER 1.0

19 CONFIG Register The CONFIG register contains configuration bits, which defines additional the MC71PD506 core features. To change it s contents, the FSR register should be cleared first, and then a particular instruction using indirect addressing mode should be executed. CONFIG REGISTER (CONFIG) (00H, 80H) CONFIG DEC INC (Initial value : ) Read/Write R/W R/W Bit7-2 DEC INC Not available for the MC71PD506 Indirect addressing mode with post decrement FSR contents Indirect addressing mode with post increment FSR contents 0: Post FSR decrement disabled 1: Post FSR decrement enabled 0: Post FSR increment disabled 1: Post FSR increment enabled NOTE: Both DEC and INC bits set disable auto increment/decrement function. SEP.2007 VER

20 STATUS Register The STATUS register contains the arithmetic status of the ALU and the bank selection bits for data memory. The STATUS register can be the destination for any instruction, as with any other register. If the STATUS register is the destination for an instruction that affects the Z, DC or C bits, then writing to these three bits is disabled. These bits are set or cleared according to the device logic. Furthermore, the nto and npd bits are not writable. Therefore, the result of an instruction with the STATUS register as destination may be different from intended. STATUS REGISTER (STATUS) (03H, 83H) STATUS IRP RP1 RP0 nto npd Z DC C (Initial value : NOTE ) Read/Write R/W R/W R/W R R R/W R/W R/W IRP RP1 RP0 nto npd Z DC Register Bank Selection Bit (used for indirect addressing) Register Bank Selection Bits (used for direct addressing) Time-out Bit Power-down Bit Zero Bit Digit Carry/nBorrow Bit 0: Bank 0, 1 (00H 0FFH) 1: Bank 2, 3 (100H 1FFH); (Not used for the MC71PD506) 00: Bank 0 01: Bank 1 10: Bank 2; (Not used for the MC71PD506) 01: Bank 3; (Not used for the MC71PD506) 0: A WDT time-out occurred 1: After power-up, CLRWDT instruction, or SLEEP instruction. 0: By execution of the SLEEP instruction 1: After power-up or by the CLRWDT instruction 0: The result of an arithmetic or logic operation is not zero 1: The result of an arithmetic or logic operation in zero 0: No carry-out from the 4 th low order bit of the result occurred 1: A carry-out from the 4 th low order bit of the result occurred C Carry/nBorrow Bit 0: No carry-out from the most significant bit of the result occurred 1: A carry-out from the most significant bit of the result occurred NOTE: Refer to the Table 6-3 in the Chapter 6. RESET AND POWER DOWN for the initial value of STATUS register. 18 SEP.2007 VER 1.0

21 Internal Interrupt Control Register (INTCON) The INTCON register is able to select enable or disable global interrupt, watchdog timer interrupt, timer 0 interrupt, timer 1/A interrupt, timer B interrupt, real timer interrupt, and SI interrupt. INTERNAL INTERRUPT CONTROL REGISTER (INTCON) (0BH) INTCON GIE WTIE T0IE TAIE TBIE RTIE SIIE - (Initial value : ) Read/Write R/W R/W R/W R/W R/W R/W R/W - GIE WTIE T0IE TAIE TBIE RTIE SIIE Bit0 Global Interrupt Enable Bit Watchdog Timer Interrupt Enable Bit Timer 0 Interrupt Enable Bit Timer 1/A Interrupt Enable Bit Timer B Interrupt Enable Bit Real Timer Interrupt Enable Bit SI Interrupt Enable Bit Not available for the MC71PD506 0: Disable all interrupt 1: Enable all un-masked interrupts 0: Disable interrupt 1: Enable interrupt 0: Disable interrupt 1: Enable interrupt 0: Disable interrupt 1: Enable interrupt 0: Disable interrupt 1: Enable interrupt 0: Disable interrupt 1: Enable interrupt 0: Disable interrupt 1: Enable interrupt SEP.2007 VER

22 Internal Interrupt Pending Register (IPND) The IPND register is a readable and writable register, which contains various pending bits for internal interrupt. INTERNAL INTERRUPT PENDING REGISTER (IPND) (0CH) IPND WT PND T0 PND TA PND TB PND RT PND SI PND Read/Write - R/W R/W R/W R/W R/W R/W - - (Initial value : ) Bit7 WTPND T0PND TAPND TBPND RTPND SIPND Bit0 Not available for the MC71PD506 Watchdog Timer Interrupt Pending Bit Timer 0 Interrupt Pending Bit Timer 1/A Interrupt Pending Bit Timer B Interrupt Pending Bit Real Timer Interrupt Pending Bit PWM Interrupt Pending Bit Not available for the MC71PD506 0 : interrupt request is not pending (when read); pending bit clear when write 0 1 : interrupt request is pending (when read) 0 : interrupt request is not pending (when read); pending bit clear when write 0 1 : interrupt request is pending (when read) 0 : interrupt request is not pending (when read); pending bit clear when write 0 1 : interrupt request is pending (when read) 0 : interrupt request is not pending (when read); pending bit clear when write 0 1 : interrupt request is pending (when read) 0 : interrupt request is not pending (when read); pending bit clear when write 0 1 : interrupt request is pending (when read) 0 : interrupt request is not pending (when read); pending bit clear when write 0 1 : interrupt request is pending (when read) 20 SEP.2007 VER 1.0

23 Special Function Register s Map Register Name Address Hex Table 2-1. BANK0 Register s Map Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 CONFIG 00H DEC INC CPUCLK 01H IDLE CCLK PCL 02H Program counter (PC) Least Significant Byte STATUS 03H IRP RP1 RP0 nto npd Z DC C FSR 04H Indirect data memory address pointer SICR 05H SIMOD CSEL DAT SIOP SIPRE C3CLR SIEDGE - SIDAT 06H SI Data Register SIPS 07H SI Pre-scaler Register WTSCR 08H WTFUN WT3C WTCS WTCC WTCR 09H 8-bit Watchdog Timer Counter Register PCLATH 0AH Write buffer upper 5 bits of PC INTCON 0BH GIE WTIE T0IE TAIE TBIE RTIE SIIE - IPND 0CH - WTPND T0PND TAPND TBPND RTPND SIPND - TSCR0 0DH T0SS T0TS T0MS T0FF T0CS TCR0 0EH Timer0 Counter Register TDR0H 0FH Timer0 Data Register High Byte TDR0L 10H Timer0 Data Register Low Byte TSCRA 11H - - TARL TACE TACS T1MOD TCRA 12H Timer 1/A Counter Register TDRA 13H Timer 1/A Data Register TSCRB 14H - - TBRL TBCE TBCS - TCRB 15H Timer B Counter Register TDRB 16H Timer B Data Register RTSCR 17H LBRS RTEN RTSS BUZ RTCS LCDR 18H LCDDR BIAS and DUTY LCD Clock DISP 19H 1FH are not mapped NOTE: A dash ( ) means that the bit is neither used nor mapped. SEP.2007 VER

24 Register Name Address Hex Table 2-2. BANK1 Register s Map Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 CONFIG 80H DEC INC OSCSEL 81H MOSC SOSC SCLK PCL 82H Program counter (PC) Least Significant Byte STATUS 83H IRP RP1 RP0 nto npd Z DC C FSR 84H Indirect data memory address pointer DDR0H 85H P07 P06 P05 P04 DDR0L 86H P03 P02 P01 P00 PUR0 87H PUR07 PUR06 PUR05 PUR04 PUR03 PUR02 PUR01 PUR00 EINT0 88H INT3 INT2 INT1 INT0 EPND0 89H PND3 PND2 PND1 PND0 PCLATH 8AH Write buffer upper 5 bits of PC 8BH is not mapped DDR1H 8CH P17 P16 P15 P14 DDR1L 8DH P13 P12 P11 P10 PUR1 8EH PUR17 PUR16 PUR15 PUR14 PUR13 PUR12 PUR11 PUR10 EINT1 8FH INT1011 INT89 INT67 INT45 EPND1 90H PND11 PND10 PND9 PND8 PND7 PND6 PND5 PND4 DDR2 91H P267 P245 P223 P201 DDR3 92H P367 P345 P323 P301 PUR2n3 93H PUR267 PUR245 PUR223 PUR201 PUR367 PUR345 PUR323 PUR301 DDR4H 94H - - P46 P45 P44 DDR4L 95H P43 P42 P41 P40 PUR4 96H - PUR46 PUR45 PUR44 PUR43 PUR42 PUR41 PUR40 DDR5H 97H P57 P56 P55 P54 DDR5L 98H P53 P52 P51 P50 PUR5 99H PUR57 PUR56 PUR55 PUR54 PUR53 PUR52 PUR51 PUR50 P0 9AH Port 0 Data Register P1 9BH Port 1 Data Register P2 9CH Port 2 Data Register P3 9DH Port 3 Data Register P4 9EH Port 4 Data Register P5 9FH Port 5 Data Register NOTE: A dash ( ) means that the bit is neither used nor mapped. 22 SEP.2007 VER 1.0

25 2.3.3 ADDRESSING MODES The MC71PD506 supports two addressing modes: direct or indirect. In Direct Addressing, the 9-bit direct address is concatenated from RP [1:0] bits of STATUS (03H) register and a 7LSB of instruction word. Indirect addressing is possible by using the CONFIG (00H) register. Any instruction using CONFIG (00H) register actually accesses data pointed by the File Select Register (FSR (04H)). The 9-bit address is concatenated from IRP bit from STATUS (03H) register and 8 bits of FSR (04H) register. Both Direct and indirect addressing modes are shown in figure below. Direct Addressing Indirect Addressing RP1RP0 6 Opcode 0 IRP 7 6 FSR register 0 Bank select Location select Bank select Location select 00H H 7FH Bank0 Bank1 Bank2 Bank3 7FH NOTE: The Bank2 and Bank3 are not used for the GM120BP Figure 2-5. Direct/Indirect addressing SEP.2007 VER

26 Indirect Addressing Mode Indirect addressing mode is applied when the instruction point directly to the CONFIG (00H) register. Any instruction pointing directly the CONFIG (00H) register as a source/destination, actually accesses data pointed by the FSR (file select register, 04H). In indirect addressing mode, user can select three of supported indirect addressing mode: - Simple indirect: the indirect address comes from concatenated IRP and FSR. - Indirect with post increment: the content of FSR register is post incremented, after execution of any instruction using indirect addressing mode. - Indirect with post decrement: the content of FSR register is post decremented, after execution of any instruction using indirect addressing mode. A simple program to clear RAM locations 20H-2FH using indirect addressing is shown in Example 2-1. EXAMPLE 2-1: INDIRECT ADDRESSING MOVLW 0x20 ;initialize pointer MOVWF FSR ;to RAM NEXT: CLRF CONFIG ;clear CONFIG register INCF FSR,F ;inc pointer BTFSS FSR,4 ;all done? GOTO NEXT ;no clear next CONTINUE: : ;yes continue 24 SEP.2007 VER 1.0

27 NOTES SEP.2007 VER

28 3. INTERRUPT 3.1 INTERRUPT STRUCTURE The MC71PD506 has 18 interrupt sources: - 12 external interrupts (Port 0.4~Port 0.7, Port 1.0~Port 1.7) - Watchdog timer interrupt - Timer 0 underflow interrupt - Timer 1/A underflow interrupt - Timer B underflow interrupt - Real timer interrupt - SI interrupt The interrupt vector address is located at 0004H of ROM address area. Please be careful not to overwrite any of the stored vector addresses. P0.4 External Interrupt PND0 INT0 P0.5 External Interrupt PND1 INT1 P0.6 External Interrupt PND2 INT2 P1.0 ExternalInterrupt P1.1 ExternalInterrupt P1.2 External Interrupt P1.3 External Interrupt P1.4 ExternalInterrupt P1.5 ExternalInterrupt P1.6 ExternalInterrupt P1.7 ExternalInterrupt P0.7 External Interrupt PND4 PND5 PND6 PND7 PND8 PND9 PND10 PND11 Watchdog Timer Interrupt PND3 INT3 INT45 INT67 INT89 INT1011 WTPND WTIE GIE Power-down Release Interrupt Vector 0004H Timer 0 Interrupt T0PND T0IE Timer 1/A Interrupt TAPND TAIE Timer B Interrupt TBPND TBIE Real Timer Interrupt RTPND RTIE SI Interrupt SIPND SIIE Figure 3-1. Interrupt Structure 26 SEP.2007 VER 1.0

29 The interrupt control registers, INTCON, EINT0 and EINT1 have enable bit of individual interrupt, and INTCON has global interrupt enable bit. The interrupt pending registers, IPND, EPND0 and EPND1 record individual interrupt requests in corresponding bits. A global interrupt enable bit, GIE (INTCON<7>) enables (if set) all un-masked interrupts or disables (if cleared) all interrupts. When GIE bit is set, and an interrupt s pending bit and interrupt enable bit are set, the interrupt will vector immediately. Individual interrupts can be disabled through their corresponding enable bits in the INTCON, EINT0 or EINT1. The watchdog timer interrupt, timer 0 underflow interrupt, timer 1/A underflow interrupt, timer B underflow interrupt, real timer interrupt, and SI interrupt control bits are contained in the INTCON register and their corresponding interrupt pending bits are in the IPND register. 12 external interrupts are contained in the EINT0 and EINT1 registers and their corresponding interrupt pending bits are in the EPND0 and EPND1 registers. When an interrupt is responded to, the GIE bit is cleared to disable any further interrupts, the return address is pushed onto the stack and the PC is loaded with vector address 0004H. At the interrupt service routine, the source(s) of the interrupt can be determined by polling the interrupt pending bits. The interrupt pending bit(s) must be cleared in software before re-enabling interrupts to avoid recursive interrupts. SEP.2007 VER

30 3.2 SAVING KEY REGISTERS DURING AN INTERRUPT SERVICE During an interrupt, only the return PC value is saved on the stack. Typically, users may wish to save key registers like W register or STATUS register during an interrupt. This will have to be implemented in software. Ex 3-1) shows how to store and restore the STATUS, W, and PCLATH registers. The register, W_TEMP, must be defined in each bank at the same offset from the bank base address. The example: 1) Stores the W register. 2) Stores the STATUS register in bank 0. 3) Stores the PCLATH register. 4) Executes the Interrupt Service Routine code. 5) Restores the PCLATH register. 6) Restores the STATUS and W registers. EX 3-1) SAVING STATUS, W, AND PCLATH REGISTERS IN RAM MOVWF W_TEMP ;Copy W to TEMP register, could be bank one or zero SWAPF STATUS, W ;Swap status to be saved into W CLRF STATUS ;bank 0, regardless of current bank, Clears IRP, RP1, RP0 MOVWF STATUS_TEMP ;Save status to bank zero STATUS_TEMP register MOVF PCLATH, W ;Only required if using pages 1, 2 and/or 3 MOVWF PCLATH_TEMP ;Save PCLATH into W CLRF PCLATH ;Page zero, regardless of current page : :(Interrupt Service Routine) : MOVF PCLATH_TEMP, W ;Restore PCLATH MOVWF PCLATH ;Move W into PCLATH SWAPF STATUS_TEMP, W ;Swap STATUS_TEMP register into W ;(sets bank to original state) MOVWF STATUS ;Move W into STATUS register SWAPF W_TEMP, F ;Swap W_TEMP SWAPF W_TEMP, W ;Swap W_TEMP into W 28 SEP.2007 VER 1.0

31 NOTES SEP.2007 VER

32 INSTRUCTION SET MC71PD INSTRUCTIONS SET Each MC71PD506 instruction has 14-bit word length divided into an OPCODE, which specifies the instruction type and operands. The instruction set is grouped into the three basic categories: - Byte-oriented operations - Bit-oriented operations - Literal and control operations Figure below shows three general formats that the instruction can have. Byte-oriented file register operations OPCODE d f(file#) 0 d = 0 for destination W d = 1 for destination f f = 7-bit file register address Bit-oriented file register operations OPCODE b(bit#) f(file#) 0 b = 3-bit bit address f = 7-bit file register address Literal and Control operation OPCODE k(literal) k = 8-bit immediate value CALL and GOTO OPCODE k(literal) k = 11-bit immediate value Figure 4-1. General Format of Instructions All instructions are executed within 2 Clock cycles. Except the instructions using indirect addressing mode which are executed within 4 CLK periods (two instruction cycles). 30 SEP.2007 VER 1.0

33 Field f W b k Table 4-1. Opcode Filed Descriptions Description Working register (accumulator) Bit address within an 8-bit file register Literal field, constant data or label x Don't care location (=0 or 1) d Destination selected; d = 0: store result in W, d = 1: store result in file register f. Default is d = 1 label TOS PC PCLATH GIE WDTCNT nto npd destination Register file address (0x00 to 0x7F) Label name Top of Stack Program Counter Program Counter High Latch Global Interrupt Enable bit Watchdog Timer Counter Time-out bit Power-down bit Destination either the W register or the specified register file location SEP.2007 VER

34 4.1 INSTRUCTION SET SUMMARY BYTE-ORIENTED INSTRUCTIONS Table 4-2. Byte-Oriented Operations Mnemonic, 14-bit opcode Description operands MSB LSB Status Cycles ADDWF f, d Add W and f d f f f f f f f C, DC, Z 2 d Add W and (FSR) d C, DC, Z 4 ANDWF f, d AND W and f d f f f f f f f Z 2 d AND W and (FSR) d Z 4 CLRF f Clear f f f f f f f f Z 2 Clear (FSR) Z 4 CLRW f, d Add W and f x x x x x x x Z 2 COMF f, d Complement f d f f f f f f f Z 2 d Complement (FSR) d Z 4 DECF DECFSZ f, d f, d Decrement f Decrement f, Skip if d f f f d f f f f f f f f f f f Z d d Decrement (FSR) Decrement (FSR), Skip if d d Z INCF INCFSZ IORWF MOVF MOVWF f, d f, d f, d f, d f, d Increment f Increment f, Skip if 0 Inclusive OR W with f Move f Move W to f d f f f d f f f d f f f d f f f 1 f f f f f f f f f f f f f f f f f f f f f f f Z - Z Z d d d d Increment (FSR) Increment (FSR), Skip if 0 Inclusive OR W with (FSR) Move (FSR) Move W to (FSR) d d d d Z - Z Z NOP No Operation x x RLF RRF SUBWF f, d Rotate Right f through Carry d f f f f f f f C 2 d Rotate Right (FSR) through Carry d C 4 f, d f, d Rotate Left f through Carry Subtract W from f d f f f d f f f f f f f f f f f C C, DC, Z 2 2 d d Rotate Left (FSR) through Carry Subtract W from (FSR) d d C C, DC, Z 4 2 SWAPF f, d Swap nibbles in f d f f f f f f f - 2 d Swap nibbles in (FSR) d XORWF f, d Exclusive OR W with f d f f f f f f f Z 2 d Exclusive OR W with (FSR) d Z 4 32 SEP.2007 VER 1.0

35 4.1.2 BIT-ORIENTED INSTRUCTIONS Table 4-3. Bit-Oriented Operations Mnemonic, 14-bit opcode Description operands MSB LSB Status Cycles BCF f, b Bit Clear f b b b f f f f f f f - 2 b Bit Clear (FSR) b b b BSF f, b Bit Set f b b b f f f f f f f - 2 b Bit Set (FSR) b b b BTFSC BTFSS f, b f, b Bit Test f, Skip if Clear Bit Test f, Skip if Set b b 1 1 b b b f f f b f f f f f f f f f f f b b Bit Test (FSR), Skip if Clear Bit Test (FSR), Skip if Set b b 1 1 b b b b LITERAL AND CONTROL OPERATIONS Mnemonic, operands Table 4-4. Literal and Control Operations Description MSB 14-bit opcode LSB Status ADDLW imm Add literal and f x k k k k k k k k C, DC, Z 2 ANDLW imm Add literal and f k k k k k k k k Z 2 CALL imm Call subroutine k k k k k k k k k k k - 4 CLRWDT - Clear Watchdog Timer nto, npd 2 GOTO imm Go to address k k k k k k k k k k k - 4 IORLW imm Inclusive OR literal with W k k k k k k k k Z 2 MOVLW imm Move literal to W x x k k k k k k k k - 2 RETFIE - Return from Interrupt RETLW imm Return with literal in W x x k k k k k k k k - 4 RETURN - Return from subroutine SLEEP - Go into standby mode nto, npd 2 SUBLW imm Subtract W from literal x k k k k k k k k C, DC, Z 2 XORLW imm Exclusive OR literal with W k k k k k k k k Z 2 Cycles SEP.2007 VER

36 4.2 INSTRUCTIONS DESCRIPTION ADDLW ADD LITERAL AND W Operands: 0 imm (k) 255 Operation: Status Affected: W <= W + imm (k) C, DC, Z Description: The contents of W register are added to the eight bit immediate data 'imm' and the result is placed in the W register. Encoding: x k k k k k k k k Cycles: DIR : 2 Example: ADDLW 0x15 Before Instruction W = 0x10 After Instruction W = 0x25 34 SEP.2007 VER 1.0

37 4.2.2 ADDWF ADD W AND F Operands: 0 f 127 d [0, 1] Operation: Status Affected: destination <= W + f destination <= W + FSR C, DC, Z Description: ADDWF instruction add contents of the W register with register specified by f operand. If 'd' is 0 the result is stored in the W register. If 'd' is 1 the result is stored back in register 'f'. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: ADDWF FSR, 0 Before Instruction W = 0x17 FSR = 0xC2 After Instruction W = 0xD9 FSR = 0XC2 SEP.2007 VER

38 4.2.3 ANDLW AND LITERAL WITH W Operands: 0 imm (k) 255 Operation: Status Affected: W <= W and imm (k) Z Description: The contents of W register are AND'ed with the eight bit immediate data 'imm'. The result is placed in the W Encoding: k k k k k k k k Cycles: DIR : 2 Example: ANDLW 0x5F Before Instruction W = 0xA3 After Instruction W = 0x03 36 SEP.2007 VER 1.0

39 4.2.4 ANDWF AND W WITH F Operands: 0 f 127 d [0, 1] Operation: Status Affected: destination <= W and f destination <= W and FSR Z Description: ANDWF instruction AND the W register with register specified by 'f' operand. The result is stored in W or back in f register respectively to the d value. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: ANDWF FSR, 1 Before Instruction W = 0x17 FSR = 0XC2 After Instruction W = 0X17 FSR = 0x02 SEP.2007 VER

40 4.2.5 BCF BIT CLEAR F Operands: 0 f b 7 Operation: f.b <= 0 FSR.b <= 0 Status Affected: - Description: Encoding: Bit 'b' in register 'f' is cleared b b b f f f f f f f b b b Cycles: DIR : 2 INDIR : 4 Example: BCF Flag_Buf, 1 Before Instruction Flag_Buf = 0x17 After Instruction Flag_Buf = 0x16 38 SEP.2007 VER 1.0

41 4.2.6 BSF BIT SET F Operands: 0 f b 7 Operation: f.b <= 1 FSR.b <= 1 Status Affected: - Description: Encoding: Bit 'b' in register 'f' is cleared b b b f f f f f f f b b b Cycles: DIR : 2 INDIR : 4 Example: BSF Flag_Buf, 7 Before Instruction Flag_Buf = 0x17 After Instruction Flag_Buf = 0x97 SEP.2007 VER

42 4.2.7 BTFSC BIT TEST, SKIP IF CLEAR Operands: 0 f b 7 Operation: skip if, f.b = 0 skip if, FSR.b = 0 Status Affected: - Description: Check the b bit in f register and skip next instruction when b is 0. If bit 'b' is '0' then the next instruction fetched during the current instruction execution is discarded, and a NOP is executed instead, making this a two-cycle instruction. Encoding: b b b f f f f f f f b b b Cycles: DIR : 2 INDIR : 4 Example: aaa: BTFSC Flag_Buf, 1 bbb: GOTO ccc ddd: Before Instruction After Instruction PC = address aaa If Flag_Buf <1> = 0, PC = address ddd If Flag_Buf <1> = 1, PC = address bbb 40 SEP.2007 VER 1.0

43 4.2.8 BTFSS BIT TEST, SKIP IF SET Operands: 0 f b 7 Operation: skip if f.b = 1 skip if FSR.b = 1 Status Affected: - Description: If bit 'b' in register 'f' is '1' then the next instruction is skipped. If bit 'b' is '1' then the next instruction fetched during the current instruction execution is discarded, and a NOP is executed instead, making this a twocycle instruction. Encoding: b b b f f f f f f f b b b Cycles: DIR : 2 INDIR : 4 Example: aaa: BTFSC Flag_Buf, 1 bbb: GOTO ccc ddd: Before Instruction After Instruction PC = address aaa If Flag_Buf<1> = 0, PC = address bbb If Flag_Buf<1> = 1, PC = address ddd SEP.2007 VER

44 4.2.9 CALL CALL SUBROUTINE Operands: 0 imm (k) 2047 Operation: TOS <= PC + 1, PC [10:0] <= imm (k), PC [12:11] <= PCLATH [4:3] Status Affected: - Description: Call Subroutine. First, return address PC+1 is pushed onto the stack. The eleven bit immediate address is loaded into PC [10:0]. The upper bits of the PC are loaded from PCLATH. CALL is two-cycle instruction. Encoding: k k k k k k k k k k k Cycles: 4 Example: aaa: CALL bbb Before Instruction PC = address aaa After Instruction PC = address bbb SP = address aaa+1 42 SEP.2007 VER 1.0

45 CLRF CLEAR F Operands: 0 f 127 Operation: Status Affected: f <= 0x00 FSR <= 0x00 Z Description: Encoding: The contents of register 'f' is cleared and the Z bit in STATUS register is set f f f f f f f Cycles: DIR : 2 INDIR : 4 Example: CLRF Flag_Buf Before Instruction Flag_Buf = 0xAA After Instruction Flag_Buf = 0x00 SEP.2007 VER

46 CLRW CLEAR W Operands: - Operation: Status Affected: W <= 0x00 Z Description: The contents of working register W is cleared and the Z bit in STATUS register is set Encoding: x x x x x x x Cycles: 2 Example: CLRW Before Instruction W = 0xAA After Instruction W = 0x00 44 SEP.2007 VER 1.0

47 CLRWDT CLEAR WATCHDOG TIMER Operands: - Operation: Status Affected: WDTCNT <= Clear nto, npd Description: Encoding: CLRWDT instruction resets the WDTCNT. Status bits nto and npd are set Cycles: 2 Example: CLRWDT Before Instruction WDTCNT =? After Instruction WDTCNT = 0x00 nto = 1 npd = 1 SEP.2007 VER

48 COMF COMPLEMENT F Operands: 0 f 127 d [0, 1] Operation: Status Affected: destination <= f destination <= FSR Z Description: of the d. Encoding: The contents of register 'f' is complemented and transferred to the destination W or f depending d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: COMF REG1, 0 Before Instruction REG1 = 0x13 After Instruction REG1 = 0x13 W = 0xEC 46 SEP.2007 VER 1.0

49 DECF DECREMENT F Operands: 0 f 127 d [0, 1] Operation: destination <= f 1 destination <= FSR 1 Status Affected: Z Description: d value. Encoding: Decrement register f. The result of operation is stored in the destination W or f depending of the d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: DECF REG1, 1 Before Instruction REG1 = 0x1 Z = 0 After Instruction REG1 = 0x0 Z = 1 SEP.2007 VER

50 DECFSZ DECREMENT F, SKIP IF 0 Operands: 0 f 127 d [0, 1] Operation: destination <= f 1, Skip if result = 0 destination <= FSR 1, Skip if result = 0 Status Affected: - Description: The contents of register f are decremented and stored in the destination. If the result of operation is 0, the next instruction, which is already fetched, is discarded and NOP is executed instead making it two-cycle instruction. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: aaa: DECFSZ REG1, 1 GOTO aaa bbb: Before Instruction PC = address aaa After Instruction REG1 = REG1 1 If REG1 = 0, PC = address bbb If REG1 0, PC = address aaa SEP.2007 VER 1.0

51 GOTO UNCONDITIONAL BRANCH Operands: 0 imm (k) 2047 Operation: PC [10:0] <= imm (k) PC [12:11] <= PCLATH [4:3] Status Affected: - Description: GOTO is an unconditional branch. The eleven bit immediate value is loaded into PC bits [10:0]. The upper bits of PC are loaded from PCLATH [4:3]. GOTO is a two-cycle instruction Encoding: k k k k k k k k k k k Cycles: 4 Example: GOTO Loop After Instruction PC = address Loop SEP.2007 VER

52 INCF INCREMENT F Operands: 0 f 127 d [0, 1] Operation: destination <= f + 1 destination <= FSR + 1 Status Affected: Z Description: The contents of register f are incremented. The result of operation is stored in the W register or f, depending of the d value. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: INCF REG1, 1 Before Instruction REG1 = 0xFF Z = 0 After Instruction REG1 = 0x0 Z = 1 50 SEP.2007 VER 1.0

53 INCFSZ INCREMENT F, SKIP IF 0 Operands: 0 f 127 d [0, 1] Operation: destination <= f + 1, Skip if result = 0 destination <= FSR + 1, Skip if result = 0 Status Affected: - Description: The contents of register f are incremented and stored in the destination. If the result is 0, the next instruction which is already fetched, is discarded, and a NOP is executed instead making it a two-cycle instruction. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: aaa: INCFSZ REG1, 1 GOTO Loop bbb: Before Instruction PC = address aaa After Instruction REG1 = REG1 + 1 If REG1 = 0, PC = address bbb If REG1 0, PC = address aaa + 1 SEP.2007 VER

54 IORLW INCLUSIVE OR LITERAL WITH W Operands: 0 imm (k) 255 Operation: Status Affected: W <= W OR imm (k) Z Description: register. Encoding: The contents of the W register are OR'ed with the eight bit literal 'k'. The result is placed in the W k k k k k k k k Cycles: 2 Example: IORLW 0x35 Before Instruction W = 0x9A After Instruction W = 0XBF Z = 0 52 SEP.2007 VER 1.0

55 IORWF INCLUSIVE OR W WITH F Operands: 0 f 127 d [0, 1] Operation: Status Affected: destination <= W OR f destination <= W OR FSR Z Description: Inclusive OR the W register with register 'f'. If 'd' is 0 the result is placed in the W register. If 'd' is 1 the result is placed back in register 'f'. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: IORWF REG1 Before Instruction REG1 = 0x13 W = 0x9A After Instruction REG1 = 0X13 W = 0x93 Z = 1 SEP.2007 VER

56 MOVLW MOVE LITERAL TO W Operands: 0 imm (k) 255 Operation: W <= imm (k) Status Affected: - Description: Encoding: The eight bit immediate data 'imm' is loaded into W register x x k k k k k k k k Cycles: 2 Example: MOVLW 0XAA After Instruction W = 0xAA 54 SEP.2007 VER 1.0

57 MOVF MOVE F Operands: 0 f 127 d [0, 1] Operation: Status Affected: destination <= f destination <= FSR Z Description: Encoding: The contents of register f are moved to destination dependent of d value d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: MOVF REG1, 0 After Instruction W = value in REG1 register Z = 1 SEP.2007 VER

58 MOVWF MOVE W TO F Operands: 0 f 127 Operation: f <= W FSR <= W Status Affected: - Description: Move data from W register to register 'f'. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: MOVWF REG1 Before Instruction REG1 = 0x00 W = 0x9A After Instruction REG1 = 0x9A W = 0x9A 56 SEP.2007 VER 1.0

59 NOP NO OPERATION Operands: - Operation: - Status Affected: - Description: No operation. Encoding: x x Cycles: 2 Example: NOP SEP.2007 VER

60 RETFIE RETURN FROM INTERRUPT Operands: - Operation: PC <= TOS GIE <= 1 Status Affected: - Description: Return from interrupt. Stack is POPed and Top of Stack (TOS) is loaded in the PC. Interrupts are enabled by setting Global Interrupt Enable bit, GIE (INTCON(7)). Encoding: Cycles: 4 Example: RETFIE After Instruction PC = TOS GIE = 1 58 SEP.2007 VER 1.0

61 RETLW RETURN WITH LITERAL IN W Operands: 0 imm (k) 255 Operation: PC <= TOS W <= imm (k) Status Affected: - Description: The W register is loaded with eight bit immediate data 'imm'. The program counter is loaded with the return address from the top of stack. Encoding: x x k k k k k k k k Cycles: 4 Example: CALL TABLE TABLE ADDWF RETLW R0 RETLW R1 RETLW R2 PC Before Instruction W = 0x02 After Instruction W = value of R3 SEP.2007 VER

62 RETURN RETURN FROM SUBROUTINE Operands: - Operation: PC <= TOS Status Affected: - Description: Encoding: Return from subroutine. The stack is POPed and the top of the stack is loaded into the PC Cycles: 4 Example: RETURN After Instruction PC = TOS 60 SEP.2007 VER 1.0

63 RLF ROTATE LEFT F THROUGH CARRY Operands: 0 f 127 d [0, 1] Operation: C f7 f0 Status Affected: C Description: The contents of register 'f' is rotated one bit to the left through the Carry Flag. Result is stored in to destination respectively to the d value. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: RLF REG1, 0 Before Instruction REG1 = C = 0 After Instruction REG1 = W = C = 1 SEP.2007 VER

64 RRF ROTATE RIGHT F THROUGH CARRY Operands: 0 f 127 d [0, 1] Operation: C f7 f0 Status Affected: C Description: The contents of register 'f' are rotated one bit to the right through the Carry Flag. Result is stored in to destination respectively to the d value. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: RRF REG1, 0 Before Instruction REG1 = C = 0 After Instruction REG1 = W = C = 0 62 SEP.2007 VER 1.0

65 SLEEP Operands: - Operands: Status Affected: WDTCNT <= Clear nto, npd Description: Status bits nto is set and npd is cleared. WDTCNT is cleared. It will be in STOP mode when CPUCLK.7-.6 value is 10, and the SLEEP instruction is executed. It will be in IDLE mode when CPUCLK.7-.6 value is any values except for 10, and the SLEEP instruction is executed. Encoding: Cycles: 2 Example: SLEEP SEP.2007 VER

66 SUBLW SUBTRACT W FROM LITERAL Operands: 0 imm (k) 255 Operands: Status Affected: W <= imm (k) W C, DC, Z Description: The W register is subtracted (2 complement method) from the eight bit immediate data imm. The result is stored in W register. Encoding: x k k k k k k k k Cycles: 2 64 SEP.2007 VER 1.0

67 SUBLW SUBTRACT W FROM LITERAL(CONTINUED) Example: SUBLW 0x02 Before Instruction W = 1 C =? Z =? After Instruction W = 1 C = 1; result is positive Z = 0 Before Instruction W = 2 C =? Z =? After Instruction W = 0 C = 1; result is zero Z = 1 Before Instruction W = 3 C =? Z =? After Instruction W = 0xFF C = 0; result is negative Z = 0 SEP.2007 VER

68 SUBWF SUBTRACT W FROM F Operands: 0 f 127 d [0, 1] Operands: Status Affected: destination <= f W destination <= FSR W C, DC, Z Description: Subtract (2's complement method) W register from register 'f'. Result is stored in destination respectively to the value of d. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 66 SEP.2007 VER 1.0

69 SUBWF SUBTRACT W FROM F(CONTINUED) Example: SUBWF REG1, 1 Before Instruction REG1 = 3 W = 2 C =? Z =? After Instruction REG1 = 1 W = 2 C = 1; result is positive Z = 0 Before Instruction REG1 = 2 W = 2 C =? Z =? After Instruction REG1 = 0 W = 2 C = 1; result is zero Z = 1 Before Instruction REG1 = 1 W = 2 C =? Z =? After Instruction REG1 = 0xFF W = 2 C = 0; result is negative Z = 0 SEP.2007 VER

70 SWAPF SWAP NIBBLES IN F Operands: 0 f 127 d [0, 1] Operands: destination [7:4] <= f [3:0], destination [3:0] <= f [7:4] Status Affected: - Description: The upper and lower nibbles of register 'f' are exchanged. Result is stored in destination respectively to the value of d. Encoding: d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: SWAPF REG1 Before Instruction REG1 = 0xA5 After Instruction REG1 = 0xA5 W = 0x5A 68 SEP.2007 VER 1.0

71 XORLW EXCLUSIVE OR LITERAL WITH W Operands: 0 imm (k) 255 Operands: Status Affected: W <= imm (k) XOR W Z Description: The Exclusive OR of the contents of W register and 8 bit immediate data is stored in W. Encoding: k k k k k k k k Cycles: 2 Example: XORLW 0xAF Before Instruction W = 0xB5 After Instruction W = 0x1A SEP.2007 VER

72 XORWF EXCLUSIVE OR W WITH F Operands: 0 f 127 d [0, 1] Operands: Status Affected: destination <= W XOR f destination <= W XOR FSR Z Description: value of d. Encoding: Exclusive OR the W register with register 'f'. Result is stored in destination respectively to the d f f f f f f f d Cycles: DIR : 2 INDIR : 4 Example: XORWF REG1 Before Instruction REG1 = 0xAF W = 0xB5 After Instruction REG1 = 0x1A W = 0xB5 70 SEP.2007 VER 1.0

73 NOTES SEP.2007 VER

74 5. CLOCK CIRCUIT The MC71PD506 microcontroller has two oscillator circuits: a main clock and a sub clock circuit. The CPU and peripheral hardware is operated on system clock frequency supplied through these circuits. The maximum CPU clock frequency of the MC71PD506 is determined by CPUCLK register settings. 5.1 SYSTME CLOCK CIRCUIT The system clock circuit has the following components: - External crystal, ceramic resonator, RC oscillation, or an external clock source - Oscillator stop and wake-up functions - Programmable frequency divider for the CPU clock (fxx divided by 1, 2, 8, or 16) - CPU clock control register, CPUCLK - Oscillator select register, OSCSEL 72 SEP.2007 VER 1.0

75 5.1.1 MAIN OSCILLATOR CIRCUITS XIN XOUT C1 C2 Figure 5-1. Crystal/Ceramic Oscillator (fx) XIN XOUT Figure 5-2. External Oscillator (fx) XIN XOUT R Figure 5-3. RC Oscillator (fx) NOTE: fx means main oscillator clock. SEP.2007 VER

76 5.1.2 SUB OSCILLATOR CIRCUITS XTIN XTOUT C1 C2 Figure 5-4. Crystal Oscillator (fxt) XTIN XTOUT Figure 5-5. External Oscillator (fxt) NOTE: fxt means sub oscillator clock. 74 SEP.2007 VER 1.0

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

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

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

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

PIC 16F84A programming (II)

PIC 16F84A programming (II) 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

More information

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

S3 Family 8-Bit Microcontrollers S3F8S19/S3F8S15 Product Specification

S3 Family 8-Bit Microcontrollers S3F8S19/S3F8S15 Product Specification S3 Family 8-Bit Microcontrollers S3F8S19/S3F8S15 PRELIMINARY Copyright 2013 Zilog, Inc. All rights reserved. www.zilog.com ii Warning: DO NOT USE THIS PRODUCT IN LIFE SUPPORT SYSTEMS. LIFE SUPPORT POLICY

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

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

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

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

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

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

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

21-S3-C9484/C9488/F USER'S MANUAL. S3C9484/C9488/F bit CMOS Microcontroller Revision 1

21-S3-C9484/C9488/F USER'S MANUAL. S3C9484/C9488/F bit CMOS Microcontroller Revision 1 21-S3-C9484/C9488/F9488-092003 USER'S MANUAL 8-bit CMOS Microcontroller Revision 1 PRODUCT OVERVIEW 1 PRODUCT OVERVIEW S3C9-SERIES MICROCONTROLLERS Samsung's SAM88RCRI family of 8-bit single-chip CMOS

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

PRODUCT OVERVIEW OVERVIEW

PRODUCT OVERVIEW OVERVIEW PRODUCT OVERVIEW 1 PRODUCT OVERVIEW OVERVIEW The S3C70F2/C70F4 single-chip CMOS microcontroller has been designed for high-performance using Samsung's newest 4-bit CPU core, SAM47 (Samsung Arrangeable

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

PRODUCT OVERVIEW OVERVIEW DEVELOPMENT SUPPORT0 S MSUNG ELECTRONICS

PRODUCT OVERVIEW OVERVIEW DEVELOPMENT SUPPORT0 S MSUNG ELECTRONICS PRODUCT OVERVIEW 1 PRODUCT OVERVIEW OVERVIEW The single-chip CMOS microcontroller has been designed for high-performance using Samsung's newest 4-bit CPU core, SAM47 (Samsung Arrangeable Microcontrollers).

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

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

Product Overview. Address Spaces. Addressing Modes. Memory Map. SAM47 Instruction Set

Product Overview. Address Spaces. Addressing Modes. Memory Map. SAM47 Instruction Set Product Overview Address Spaces Addressing Modes Memory Map SAM47 Instruction Set PRODUCT OVERVIEW 1 PRODUCT OVERVIEW OVERVIEW The S3C72N2/C72N4 single-chip CMOS microcontroller has been designed for high

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

Chapter 3 BRANCH, CALL, AND TIME DELAY LOOP

Chapter 3 BRANCH, CALL, AND TIME DELAY LOOP Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 3022: Embedded Systems Discussion Chapter 3 BRANCH, CALL, AND TIME DELAY LOOP Eng. Eman R. Habib February, 2014 2 Embedded

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

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

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

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

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

ALU and Arithmetic Operations

ALU and Arithmetic Operations EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 6th February 2002 CLR Part IV ALU and Arithmetic Operations There are several issues connected with the use of arithmetic

More information

PIC10F200/202/204/206

PIC10F200/202/204/206 6-Pin, 8-Bit Flash Microcontrollers Devices Included In This Data Sheet: PIC0F200 PIC0F202 PIC0F204 PIC0F206 High-Performance RISC CPU: Only 33 Single-Word Instructions to Learn All Single-Cycle Instructions

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

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

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

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

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

PIC12C5XX. 8-Pin, 8-Bit CMOS Microcontroller. CMOS Technology: Devices included in this Data Sheet: High-Performance RISC CPU: Pin Diagram

PIC12C5XX. 8-Pin, 8-Bit CMOS Microcontroller. CMOS Technology: Devices included in this Data Sheet: High-Performance RISC CPU: Pin Diagram This document was created with FrameMaker 404 8-Pin, 8-Bit CMOS Microcontroller PIC12C5XX Devices included in this Data Sheet: PIC12C508 and PIC12C509 are 8-bit microcontrollers packaged in 8-lead packages.

More information

Chapter 7 Central Processor Unit (S08CPUV2)

Chapter 7 Central Processor Unit (S08CPUV2) Chapter 7 Central Processor Unit (S08CPUV2) 7.1 Introduction This section provides summary information about the registers, addressing modes, and instruction set of the CPU of the HCS08 Family. For a more

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

16.317: Microprocessor-Based Systems I Fall 2012

16.317: Microprocessor-Based Systems I Fall 2012 16.317: Microprocessor-Based Systems I Fall 2012 Exam 2 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

16.317: Microprocessor Systems Design I Fall 2015

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

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

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

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

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture Department of Electrical Engineering Lecture 4 The 8051 Architecture 1 In this Lecture Overview General physical & operational features Block diagram Pin assignments Logic symbol Hardware description Pin

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

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

Microcontroller. Instruction set of 8051

Microcontroller. Instruction set of 8051 UNIT 2: Addressing Modes and Operations: Introduction, Addressing modes, External data Moves, Code Memory, Read Only Data Moves / Indexed Addressing mode, PUSH and POP Opcodes, Data exchanges, Example

More information

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, CISC and RISC processors etc. Knows the architecture and

More information

Designed to GO... Universal Battery Monitor Using the bq2018 Power Minder IC. Typical Applications. Features. Figure 1. bq2018 Circuit Connection

Designed to GO... Universal Battery Monitor Using the bq2018 Power Minder IC. Typical Applications. Features. Figure 1. bq2018 Circuit Connection Designed to GO... Practical and Cost-Effective Battery Management Design Examples by Benchmarq Series 2018, Number One Universal Battery Monitor Using the bq2018 Power Minder IC Features Counts charge

More information

C51 Family. Architectural Overview of the C51 Family. Summary

C51 Family. Architectural Overview of the C51 Family. Summary Architectural Overview of the C51 Family C51 Family Summary 1. Introduction............................................................ I.1. 1.1. TSC80C51/80C51/80C31.................................................................

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

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

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

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

16.317: Microprocessor Systems Design I Spring 2015

16.317: Microprocessor Systems Design I Spring 2015 16.317: Microprocessor Systems Design I Spring 2015 Exam 2 Solution 1. (16 points, 4 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by

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

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

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller 1 Salient Features (1). 8 bit microcontroller originally developed by Intel in 1980. (2). High-performance CMOS Technology. (3). Contains Total 40 pins. (4). Address bus is of 16 bit

More information

ECE 354 Introduction to Lab 2. February 23 rd, 2003

ECE 354 Introduction to Lab 2. February 23 rd, 2003 ECE 354 Introduction to Lab 2 February 23 rd, 2003 Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system supervisors

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

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

PIC16C433 Data Sheet. 8-Bit CMOS Microcontroller with LIN bus Transceiver Microchip Technology Inc. Advance Information DS41139A

PIC16C433 Data Sheet. 8-Bit CMOS Microcontroller with LIN bus Transceiver Microchip Technology Inc. Advance Information DS41139A Data Sheet 8-Bit CMOS Microcontroller with LIN bus Transceiver 2001 Microchip Technology Inc. Advance Information DS41139A All rights reserved. Copyright 2001, Microchip Technology Incorporated, USA. Information

More information

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 2. PIC and Programming

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 2. PIC and Programming Laboratory: Introduction to Mechatronics Instructor TA: Edgar Martinez Soberanes (eem370@mail.usask.ca) 2015-01-12 Lab 2. PIC and Programming Lab Sessions Lab 1. Introduction Read manual and become familiar

More information

Micro-Controller: PIC16C74 < Part 5: Interrupt >

Micro-Controller: PIC16C74 < Part 5: Interrupt > Micro-Controller: PIC16C74 < Part 5: Interrupt > I. Overview Introduction PIC16c74 can have many sources of interrupt. These sources generally include one interrupt source for each peripheral module, though

More information

PIC16C62X Data Sheet. EPROM-Based 8-Bit CMOS Microcontrollers Microchip Technology Inc. DS30235J

PIC16C62X Data Sheet. EPROM-Based 8-Bit CMOS Microcontrollers Microchip Technology Inc. DS30235J Data Sheet EPROM-Based 8-Bit CMOS Microcontrollers 2003 Microchip Technology Inc. DS30235J Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification

More information

PIC16C433 Data Sheet. 8-Bit CMOS Microcontroller with LIN Transceiver Microchip Technology Inc. Preliminary DS41139B

PIC16C433 Data Sheet. 8-Bit CMOS Microcontroller with LIN Transceiver Microchip Technology Inc. Preliminary DS41139B Data Sheet 8-Bit CMOS Microcontroller with LIN Transceiver 2002 Microchip Technology Inc. Preliminary DS41139B Note the following details of the code protection feature on Microchip devices: Microchip

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

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core TKT-3500 Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core Erno Salminen Copyright notice Some figures by Robert Reese, from supplementary CD of the course book from PIC18F8722 Family

More information

16.317: Microprocessor Systems Design I Fall 2014

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

More information