and put it in your hotlist/bookmarks.
2
Assignment 2
Write a program for the 6811 which will do the following:
- store the value $01 in a byte variable named one
store the value $02 in a byte variable named two
store the value $FD in a byte variable names three
- find the sum of the variables one, two, and three and store
the result in a double byte variable named sum.
- ensure that the variables one, two, three, and sum are located
at memory locations $0000, $0001, $0002, and $0003
respectively.
- get the value stored in the double byte variable sum into
a register using only one op code.
- use the indexed addressing mode with the value of $1000 as
your index, and store the value $88 in memory locations
$1000, $1003, $1004, $1008, and $100E.
- use the direct addressing mode to accomplish the same task
as in 5) but storing the value $44.
Use a 6811 simulator to verify your program's operation.
Questions
- Where in the Memory Map is the Miniboard's RAM memory
In MC68HC11E2 how much memory is available for variables?
What other things besides variables may consume this same
RAM memory area?
Is it possible to store variables somewhere other than in RAM in
the Miniboard?
- In a double byte variable, should the low order nibble be stored in
the lowest memory locations or the highest?
What range of values can a byte variable represent? A double byte?
What op codes are suitable for moving double byte information
to/from memory?
- Where in the Memory Map of the Miniboard are the Special
Function Registers?
Which Special Function Registers are at memory locations
$1000, $1003, $1004, $1008, and $100A?
What happens on a Miniboard when you store values at these
Locations? When you read values from these locations?
- Comparing methods used to store data in d) and e) of the
assignment which method was the most code-space efficient?
The most time efficient?
3
Assignment 3
Write a Miniboard program that will read the low order nibble of
the digital port and reflect that information in the high order
nibble of the digital port. That is read PORTC bits 0 through 4 and
what ever value (0 or 1) you read on PORTC bit 0, write that value
to PORTC bit 4... likewise for reading PORTC bits 1, 2 and 3 and
writing them to PORTC bits 5, 6 and 7.
On a Miniboard, you may "see" the values you write to the digital
port bits by using an LED. You may force a 1 or a 0 to be present
for reading by either grouning or tieing high the signal pin of the
PORTC bit.
Assemble your program, and verify it by using the simulator.
Download your program into the Miniboard and observe that it
works.
Questions
- How does the Miniboard know where its very first instruction is
to be found?
- What defines weather a digital port pin will be used as an input
or an output?
- What limits the ability of a digital port pin to be used as an input or
an output at different times in the same program?
- You probably designed this program as an infinite loop. Should any
program you download into the Miniboard ever exit?
- If you press the 'Reset' button, what happens?
- If you interupt power to the Miniboard during program execution and
then restore power, what happens?
Extra requirement:
Rewrite this program so that it runs as a background task. You will
need to use interupts. Instead of locking the Miniboard into an
infinte loop which does nothing but examine PORTC, have an interupt
occur at certian time intervals and look at PORTC only during those
times.
Question:
Is this new program written in an infite loop? Will it ever exit?
4
Assignment 4
Write a Program for the Miniboard which will count seconds and display the count on LEDs in PORTC.
Questions:
- Would it be best to use a Real Time Interrupt, an Input Capture
Timer, an Output compare timer, or a Pulse Accumulator?
- Could this program be written without the use of interrupts?
- After you answered Question #1, how many choices of timers did
you still have left to implement the program with.
- How many interrupts are needed for this program to operate as
a background task.
5
Assignment 5
Acquire a copy of Fred Martin's minilib. Build some type of analog
sensor for your Miniboard. Use the minilib's "analog()" function to
read a value from several an analog port. Show the value on LED's in
PORTC. compare the reading of your program to the results of using
the MON program to read the analog value.
Questions:
- What values and in what order, and of what size, need to be passed
on the stack to the minilib analog() function?
- Does the minilib analog() function convert one channel continuously,
or convert a bank of four channels once each, or convert one
convert one channel exactly four times?
- Where in the minilib is the AD system powered up?
- How long does a call to the analog() routine take?
- Where are the results returned from the analog() lib call?
6
Assignment 6
Write a Miniboard program that will
- engage Motor #1 forward
- wait for 5 seconds
- engage Motor #2 reverse
- wait for 4.5 seconds
- engage Motor #3 reverse
- wait for 2 1/3 seconds
- engage Motor #2 forward.
Questions:
- Does how you write the program depend upon if you use DC motors or
stepper motors?
- If a motor stalls, what happens to the current drain on your Miniboard
and what effect would this likely have? What is the maximum current load
that the motor driver ships are rated for? What can be done to protect your
Miniboard? What can be done to increase the current handling capacity of
the Motor Driver circuits?
- Are there minilib or libmb function calls that would assist in this
program?
7
Assignment 7
Build a Robot!
ieeecs@hal.elee.calpoly.edu
Back to Table of Contents