2 Functions of 68HC11 Microprocessor Providing tuning and control signal for all elements of microcomputerFetching instruction and data from memoryTransferring data from memoryDecoding instructionPerforming arithmetic and logic operations called for by instructionsResponding to I/O generated control signals such as reset and interrupt
3 68 HC MPU 5 16 bit registers 2 8 bit accumulators 8 bit condition code registersControl bus signals are expandable
4 Timing and control section Control Bus signalAS signalE clockReset
5 Functions of resetFetches the content of ROM address FFFE and loads into PCHFetches the content of ROM address FFFF and load it into PC1 so that (PC) is now 2AC6Begin fetching and executing instruction at address 2AC6
6 Microprocessor common function Initialize MPU registersInitialize I/O device control registersPerform test on system RAMCheck status of I/O devicesSend messages to output devices
7 Instruction registerWhen the MPU fetches an instruction word from memory it sends to the IR
8 Program Counter (PC)Contains in the memory address of the next instruction code that the MPU is to fetch.
9 AccumulatorRegister that takes part in most of the operations performed by the ALUIt is also the register in which the result are being placed after most ALU operationsThe source of the operand and destination of the result
10 Data Address Register Memory address register Address latching registerUsed when executing ADD instruction
11 General Purpose register GPR the accumulators can perform the function of a general purpose register in many programming situations.
12 Common GPR instruction access codes Load GP from memory [M] > [GP]Store GP in memory [GP] > [M]Transfer contents of one GP register to another GP register : [GP1] > [GP2]Increment GP by 1: [GP +1 ] > [GP]Decrement GP by 1: [GP-1] > [GP]
13 If [GP] not = 0 branch back to 2 This set [GP] = COUNTStart1Load [GP] with value = COUNTFron the memoryProgram Loop2Instruction Sequence to beExecuted a number of times= COUNT3Decrement [GP][GP -1] > [GP]If [GP] not = 0 branch back to 24Is [GP] = 0?Yes5If [GP] =0 go to the next instruction in sequenceNext portion ofprogram
14 Index register68HC11 has two 16 bit index register (index register Y and index register X)Similar to general purpose registerIts operation is called index addressingIt holds address base C for X and Y index register
15 Offset instruction illustration for register X AddressInstruction codeMnemonicDescriptionC000A6LDAA $04,XLoad accumulator A from address [X]+04.C00104Offset byteEffective Address = offset + [X]= 04 + C450= C454
17 Important process during the operation Accumulator A and B are cleared to zero before any ADD operation occursIndex register [X] is initially loaded with the number 2067Accumulator B is initially loaded with 07 which the number of memory locations to be added. ACCB is being used to count down the number of times that blocks 5-8 are executedBlocks 5-8 are executed a total of seven times before ACCB is decrement to 00 program goes to block 9 to store the final sum in memory location 2068The ADD operation (block 5) are executed using data from different address each time starting with 2067 and ending with 2061.this means the data is now loaded to the accumulator
18 Start1Clear [ACCA]2Clear [ACCB]3Load [X] with Value 20674Load [ACCB] with value 07Add data stored ataddress [X] +00 to [ACAA]5Decrement [X]697Decrement ACCBNo10Store [ACCA] inmemorylocation 2068Is [ACCB]=0?HALT8
19 Condition Code register Consist of individual bitsEach bits is called FlagsThis is the 68HC11code registerb7b6b5b4b3b2b1b0SXHINZVC
20 Condition Code functions C – Carry flag reflects the carry status of arithmetic operation.V – the overflow use to indicate overflow whenever signed numbers are being added or subtractedZ – zero flag is automatically set to 1N – negative used to indicate any sign result of any arithmetic data manipulationI- interrupt mask flag is used to indicate effects on the IRQH – Half carry flag is change only by addition instructionX – X interrupt mask used to indicate not XIRQS – stop disable flag is used to prevent the stop instruction
21 Conditional branching It examine the value of the zero flagIf zero flag is = 0The next instruction will be taken at a normal sequenceIf zero flag is = 1The program will branch into new address for the next instructionIf carry clear (BCC) or set booth will examine the carry flag
Your consent to our cookies if you continue to use this website.