1. Assignment 1
  2. Assignment 2
  3. Assignment 3
  4. Assignment 4
  5. Assignment 5
  6. Assignment 6
  7. Assignment 7

1

Assignment 1

Acquire
  1. a MC68HC11 assembler
  2. simulator
  3. Miniboard
  4. loader
  5. "Introduction to 6811 Programming" by Fred Martin
  6. "Miniboard 2.0 Technical Reference" by Fred Martin.

Order

  1. "M68HC11 E Series Programmin Reference Guide"
  2. "M68HC11 Reference Manual"
  3. "M68HC11 E Series Technical Data"
from Motorolla.

Subscribe

  • to the news group "comp.robotics"

    Find

  • the "Computer Society's Robotics Resources " web page under
    http://www.elee.calpoly.edu/clubs/ieeecs/
    and put it in your hotlist/bookmarks.


    2

    Assignment 2

    Write a program for the 6811 which will do the following:
    1. 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
    2. find the sum of the variables one, two, and three and store the result in a double byte variable named sum.
    3. ensure that the variables one, two, three, and sum are located at memory locations $0000, $0001, $0002, and $0003 respectively.
    4. get the value stored in the double byte variable sum into a register using only one op code.
    5. 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.
    6. 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

    1. 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?
    2. 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?
    3. 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?
    4. 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

    1. How does the Miniboard know where its very first instruction is to be found?
    2. What defines weather a digital port pin will be used as an input or an output?
    3. 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?
    4. You probably designed this program as an infinite loop. Should any program you download into the Miniboard ever exit?
    5. If you press the 'Reset' button, what happens?
    6. 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:

    1. Would it be best to use a Real Time Interrupt, an Input Capture Timer, an Output compare timer, or a Pulse Accumulator?
    2. Could this program be written without the use of interrupts?
    3. After you answered Question #1, how many choices of timers did you still have left to implement the program with.
    4. 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:

    1. What values and in what order, and of what size, need to be passed on the stack to the minilib analog() function?
    2. 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?
    3. Where in the minilib is the AD system powered up?
    4. How long does a call to the analog() routine take?
    5. Where are the results returned from the analog() lib call?


    6

    Assignment 6

    Write a Miniboard program that will
    1. engage Motor #1 forward
    2. wait for 5 seconds
    3. engage Motor #2 reverse
    4. wait for 4.5 seconds
    5. engage Motor #3 reverse
    6. wait for 2 1/3 seconds
    7. engage Motor #2 forward.


    Questions:

    1. Does how you write the program depend upon if you use DC motors or stepper motors?
    2. 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?
    3. Are there minilib or libmb function calls that would assist in this program?

    7

    Assignment 7

    Build a Robot!

    ieeecs@hal.elee.calpoly.edu
    BackBack to Table of Contents