Custom Search


How to Write a Resume

Programming the Motorola 68HC11 Lab


Objectives:

1. To become familiar with programming the Motorola 68HC11 microcontroller, timing diagrams, machine cycles, state diagrams and prepare the student for parallel bus processing.


Materials:
1. Logic Analyzer
2. 68HC11 Trainer


Procedure:

1. Code in the following program using the following steps. Use the Increment Contents of Memory source statement machine language program below as a guide.

mm EF00

EF0C
Data

Data

2. Block fill memory with 00, so you have the following: BF C100, C1FF, 00

3. Dump the memory locations to check and verify the data stored in: MD C100, C1FF

4. Modify the memory locations with: (MM 20 C1 and MM 21 01)

5. Now set the break points at: BR EF0C and set the break instructions to the last memory location

6. Run the program: g EF00, make sure you start the program at the beginning of the programmed sequence.

Figure 1: 68HC11 Pinout




Increment Contents of Memory Source Statement

Program Description:
Fills a 256 byte block of memory with incremented values. The lowest address (START_ADR) of the block contains '00', the next higher address contains '01', and so on. Note: START_ADR is variable; it is initialized in RWM before execution.

Results:
(START_ADR) = '00', (START_ADR + 1) = '01' ... (START_ADR + FE) = 'FE' (START_ADR + FF) = 'FF'

Alters:
ACCB, IX, SP, CCR


EF00
EF03
EF05
EF06
EF08
EF09
EF0A
EF0C

8E 00 F0
DE 20
5F
E7 00
08
5C
26 FA
20 FE

INC_MEMORY
WR_AGAIN
FINISHED

LDS
LDX
CLRB
STAB
INX
INCB
BNE
BRA

#$00F0
START_ADR
0,X
WR_AGAIN
FINISHED

(SP) ← $00F0 Initialize SP away from program and data memory
IXH ← (START_ADR) = ($20), IXL ← (START_ADR +1) = ($21) Initialize IX with the starting address of the block to be filled. IX will always point at teh next address to fill.
ACCB will contain the next value to write out to memory. The first value written is '00'. ACCB ← '00'
Write the next value out to the next address of the block (IX) ← (ACCB)
Point IX at the next address to write to IX ← (IX + 1)
ACCB contains the next value to write to memory ACCB ← (ACCB + 1)
If (ACCB) ≠ then all values have not been written, so branch and write another. If ACCB ≠ 0 then PC ← WR_AGAIN otherwise (PC) = FINISHED
If get here then all 256 bytes are written, stay here.




7. Demux 68HC11 Bus Format Notes:


- Master Clock J↓
- Slave Clock K↓
- Pod 1 = Clock
- Pod 2 = Master/Slave (demux)

Lables:
ADR
ADDR
DATA

Pod 1:
7 .. 0
7 .. 0
xxxxxxxx

Pod 2:
15 .. 8 (hi byte)

xxxxxxxx


Lab Notes
Lab Notes Page 1
Lab Notes Page 2

Lab Data
Figure 2: Timing Waveform, EF00 - EF07
Figure 3: Timing Waveform, EF06 - EF0A
Figure 4: Timing Waveform, EF0A - END
Figure 5: Machine State List


Electrical Engineering lab key words: Microcontroller programming, memory stack, ROM, 68HC11, 68HC11A1, 68HC12, memory configuration, timing diagram, machine cycle, state machine, state diagram, data bus, machine language, code, data locations, pin out, sequential, byte, bit, LSB, MSB, addressing, operation, clock cycle.

Home | Search | Blog | Site Index | Contact Us
Terms & Conditions of Use | Copyright 2007-2010. All Rights Reserved.
ELECTRICAL ENGINEERING | BUSINESS | PHYSICS | CHEMISTRY | REFERENCES