EE-3362

Microcontrollers

IIC Bus

Used for talking to devices like SD card on board, over short distances at high speeds. You have to have an interface fast enough for a "Real Time Interface." So for MP3 player you need a speed factor of about 10x.

Assignment #5 / Project #2: Serial IO

Due: Oct. 28, 2008

Homework #5

Write a program to take single byte input data in the range of $00…$0F and print the corresponding character on the serial port. Print only one character from 0….F. In order to accomplish this, you have to include a routine to convert the input byte into the corresponding ASCII code.

Project #2

Include that routine into the keypad scan routine such that (the ASCII code representing) the key that is pressed get’s printed on the serial port.

Interrupts

Real Time Interrupt (RTI)

The RTI can be used to generate a hardware interrupt at a fixed periodic rate. If enabled (by setting RTIE=1), this interrupt will occur at the rate selected by the RTICTL register. The RTI timer runs with OSCCLK. See Figure 40. The RTIF bit is set to one at the end of the RTI time-out period.

Assignment #4 / Project #1: Multiplexed Display

For your homework, modify the “Display_Speed.asm” program by incorporating the timing routines from the “Ping_Pong Precise Timing.asm” program and show another character on the 4-digit display every 4 ms at a constant rate. (Do not speed up the display sequence).

Then, for your Project credit, run the program on the boards in the Computer lab and demonstrate to the TA. Then increase the time delay between characters by 1 ms at a time and note when the display starts noticeably flickering.

Assignment #3 Create A Time Delay

Objective

Write a subroutine that creates a 1ms delay by decrementing the X register in a loop for a processor frequencies of 8MHz, 16MHz & 24MHz. Since the program uses the X register, save it to the stack at the beginning of the routine and restore it from the stack at the end of the routine.

General Notes On Developing in Assembly For the 68HCS12

Addressing Modes

Before getting too involved in trying to develop in assembly or for the HCS12 it might be a good idea to review addressing methods.

Assignment #2 Overview and General Class Notes

Objective

Due September, 16th 2008

Write a program that swaps the upper and lower 4 bits in a byte. For example if the input byte has a value of $D8 the result should be $8D. The input byte should be loaded into Accu A and the result should also be contained in Accu A. Write the program like a subroutine ending in RTS like the block fill examples. Look at the command set of the HC12 processor in particular bit-shift operations to accomplish the task. Each entry must be an individual contribution.

Syndicate content