HW#19
Assign Wed 11/21
Due Wed 11/28 |
- Read Huang Chapter 9-9.4 and 10.2, 10.4, 10.5
(SCI, SPI).
- Work Huang Chapter 12 problems
E12.[8,9,10,13]. Notes:
- E12.8: Also include instructions to start the
conversion.
- E12.10: This means to show which analog input
channels are stored in which result registers during one complete
sequence.
|
HW#18
Assign Wed 11/14
Due Wed 11/21 |
- Read Huang Chapter 12-12.5.
(Analog-to-Digital Converter).
- Work Huang Chapter 8
problems
E8.[2,5,9,10] and write code for each as follows.
Notes:
- Write the subroutines and programs for the Dragon12
board and make sure they assemble/compile properly.
Include
comments to explain your programs. Use the standard
include/header files as needed to simplify your
work, for both languages. No terminal I/O is needed. Document all
code properly as specified in
prior assignments. Include pseudocode for the Assembly code. Use
subroutines as appropriate for good design.
- E8.2: The subroutine should return the duty cycle
as an unsigned 8-bit integer percentage. Write it in
assembly. Use simple register parameter passing in the assembly
code plus stack operations to avoid the use of global variables. To keep it simple, use polling (no interrupts) and assume the
signal period fits within one full TCNT cycle.
- E8.5: Write the program in C only. To keep it
simple, use polling (no interrupts).
- E8.9: Write the program in assembly only.
To keep it simple, use polling (no interrupts).
- E8.10: Write the subroutines in C, not as a
complete program. Return the period in units of microseconds, assuming
it will fit in a 32-bit unsigned word. Measure the period using a
resolution of a microsecond or less. It must be fully interrupt
driven (no polling), including the possibility of multiple TCNT overflow interrupts.
- Print and submit a copy of the source files (and
listing file for the Assembly code [excluding all included files]). Copy all your files to your ClassDrop folder at
\\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW18\.
|
HW#17
Assign Fri 11/9
Due Wed 11/14 |
- Write a complete program in C as follows.
Notes:
- Write an interrupt-driven program that
continuously scans and refreshes the 4 digits and the 8 LEDs in a time-shared fashion. The digits should always
display a 16-bit Hex count from 0000 to FFFF and repeat, incremented 4
times per second. The LEDs should always display the lower 8 bits of
this same count. The main routine should initialize everything and then
enter an infinite loop doing nothing or WAI. The Real-Time Interrupt should be
used to cause an interrupt at an appropriate rate to activate the ISR
which handles all delays, counting, and displays.
- Write, compile, download and execute the
program on the Dragon12 board. Thus all code and data must fit
in our board's RAM space and code execution must end with swi. Include
comments to
help explain your programs. Use the standard
include/header files and I/O routine files as needed to simplify your
work. Document the program properly as specified in prior assignments. Use subroutines as appropriate
for good practice.
- Print and submit a copy of the source file. Copy all your files to your ClassDrop folder at
\\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW17\.
|
HW#16
Assign Fri 11/2
Due Wed 11/7 |
- Read Huang Chapter 8
(Timer Subsystem).
- Work Huang Chapter 6
problems
E6.[1-5,7,8,10,11]. Notes:
- E6.3 - Include everything that you must program and
everything that the CPU must do to setup and process an interrupt, in
general, not just for the HCS12.
- E6.10 - Define and use symbols, not magic
numbers.
|
HW#15
Assign Mon 10/29
Due Mon 11/5 |
- Work Huang Chapter 7
problem
L7.2
as a complete program in both languages, Assembly and C, as follows.
Notes:
- Write, compile, download and execute both
programs on the Dragon12 board. Thus all code and data must fit
in our board's RAM space and code execution must end with swi. Include
comments to
help explain your programs. Use the standard
include/header files and I/O routine files as needed to simplify your
work, for both languages.
- Document all programs properly as specified in
prior assignments. Include pseudocode for the Assembly programs.
- Use subroutines as appropriate. Use the
given hcs12 and lcd_util_dragon12 routines (C and Assembly). Rewrite the
example keypad routine with simpler, shorter, and less repetitive code.
- Extra notes on operation: Include a blinking
cursor and move the cursor after each entry (don't shift). After filling
the second row with text, continue at the first character of the first
row, without clearing the display. Anytime that the F key is entered,
clear the display, reset to the first character position, and continue
allowing keypad entry and display.
- Print and submit a copy of the source files (and
listing file for the Assembly code [excluding all included files]).
- Copy all your files to your ClassDrop folder at
\\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW15\.
|
HW#14
Assign Fri 10/26
|
- Read Huang Chapter 6
(Interrupts and Clock).
|
HW#13
Assign Fri 10/19
Due Fri 10/26 |
- Read Huang Chapter 7.7-7.10
(Parallel Port Interfacing).
- Work Huang Chapter 7 problems
L7.[3,5]
as complete programs in both languages, Assembly and C, as follows.
Notes:
- Write, compile, download and execute all 4
programs on the Dragon12 board. Thus all code and data must fit
in our board's RAM space and code execution must end with swi. Include
comments to
help explain your programs. Use the standard
include/header files and I/O routine files as needed to simplify your
work, for both languages.
- Document all programs properly as specified in
prior assignments. Include pseudocode for the Assembly programs.
- L7.3: File lab07_03.asm on the student CD in the
programs\ch07 folder is similar to this problem, but not quite correct.
Also, you must NOT use a lookup table for the LED patterns - calculate
them as needed.
- L7.5: File shift_7seg.asm on the student CD in
the programs\ch07 folder does exactly what is required for this problem,
but you must write a completely different version. You may use a lookup
table for the 7-segment codes needed for each digit 0-9, but you must
NOT use a lookup table for the entire rotating sequence of digit
patterns and digit selects - calculate them another way. Write a more
general solution, with less repetition in the code than seen here, using
subroutines.
- Print and submit a copy of the source files (and
listing file for Assembly code).
- Copy all your files to your ClassDrop folder at
\\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW13\.
|
HW#12
Assign Fri 10/12
Due Fri 10/19 |
- Read Huang Chapter 7-7.6
(Parallel Ports).
- Work Huang Chapter 5 problems E5.[1,3,13]. Note:
E5.1 and E5.3 are just simple C functions, not complete programs. E5.13
is a complete program, ready to compile and run with EGNU. It must
output the results to the monitor screen in a nice format. Compile,
load, and execute E5.13 using D-Bug12; print the source file and log
file from the execution.
|
HW#11
Assign Mon 10/8
Due Fri 10/12 |
- Read Huang Chapter 5 (C
Programming).
- Work Homework #11
(D-Bug12 Keyboard/Monitor I/O).
|
HW#10
Assign Mon 10/1
Due Mon 10/8 |
|
HW#9
Assign Wed 9/26
|
- Read Huang Chapter 4.6-4.12 (Advanced
Assembly Code: Subroutines, D-Bug12 Routines).
|
HW#8
Assign Fri 9/21
Due Wed 9/26 |
- Read Huang Chapter 4.1-4.5 (Advanced Assembly Code: Stacks, Arrays,
Strings).
- Work Homework #8
(Branching, Shifting, Logical).
|
HW#7
Assign Mon 9/17
Due Fri 9/21 |
|
HW#6
Assign Wed 9/12
Due Mon 9/17 |
- Read Huang Chapter 2.6-2.12
(Most other instructions).
- Work Huang Chapter 2 problems 2.[1-7, 9, x1, x2].
Notes:
- 2.x1: Write an instruction sequence to multiply
the 8-bit unsigned numbers stored at memory locations $1200 and $1201,
and store the unsigned product in $1300:$1301.
- 2.x2: Write an instruction sequence to divide the
32-bit signed number stored at memory locations $1200:$1203 by the
16-bit signed number stored at memory locations $1300:$1301. Store the
signed quotient and remainder at memory locations $1400:$1401 and
$1500:$1501 respectively.
- The answers to problems
6,7,9 must be complete assembly language
source files, that could be
assembled, downloaded, and executed on
our Dragon12 board. Thus all code and data
must fit in our board's RAM space and code execution must end with swi.
Include some comments to
help explain your programs. Include the necessary directives for
addresses and data, initialized with
data values of your choice. Use labels or expressions with labels
(not just "magic numbers" or numerical addresses)
in your code when referring to constants and memory locations.
- In the lab: assemble, download, and execute
problem 9 ONLY. Single-step through the program and show all memory data
values BEFORE starting and AFTER completing program execution. Print and
submit the source file, listing file, and D-Bug12 log file (copied from
the IDE). Use Landscape mode for printing the listing file.
- In all problems, use only the basic instructions
and arithmetic instructions, but no looping operations.
- Copy all your files for problems 6,7,9 to your
ClassDrop folder at \\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW6\.
|
HW#5
Assign Fri 9/7
Due Wed 9/12 |
- Work Huang problems
3.[1,2,3,5,6]
(Using HCS12 tools) in the lab. Notes:
- For each problem, create a D-Bug12 execution log
file by copying everything from the terminal window to a text file and
printing it. You may edit out your mistakes before printing the log file.
- Correction: Problem 1, steps c and d: Set and then
verify 4 consecutive memory bytes at $1000 to $1003.
- Help on Problem 2: You will need to use the
USEHBR D-Bug12 command - see the
D-Bug12 Reference Manual
for details.
- Correction: Problem 5: Trace (single-step) through
only the first complete loop, then let it execute to the end, then examine
the memory word at location $1000.
- For problem 6, also print the listing file
(lab03_6.lst) for your program.
- Read Huang chapter 2-2.5
(HCS12 Directives and Arithmetic Instructions).
|
HW#4
Assign Wed 9/5 |
- Read Huang chapter 3-3.8
(HCS12 Development Tools).
|
HW#3
Assign Fri 8/31
Due Fri 9/7 |
- Work Huang problems
1.[7,12,13,16,17,18,20]
(Basic HCS12 instructions) by hand. Minimize the
number of instructions used in each problem. Use the
format specified in the Homework Policy.
- Work this extra problem. For every applicable
address mode (i.e. immediate, direct, extended, 5-bit offset indexed,
9-bit offset indexed, 16-bit offset indexed, accumulator offset indexed,
auto pre-inc, auto pre-dec, auto post-inc, auto post-dec, 16-bit offset
indexed indirect, accumulator D offset indexed indirect):
- Write an example instruction to load accumulator
A with some data (must differ from all given examples).
- Give the RTN for this instruction.
- Draw the execution diagram showing the
instruction fields and memory map for this instruction, using the
specific values for your instruction instead of generic symbols.
|
HW#2
Assign Wed 8/29
Due Fri 8/31 |
- Read Huang chapter 1
(Intro to HCS12).
- Review basic microcontroller information:
|
HW#1
Assign Mon 8/27
Due Wed 8/29 |
- Review for a prerequisite quiz. Topics:
- Binary/hex number systems
- Combinational and sequential logic
- Standard MSI logic functions and usage
- Computer organization and structure
- Assembly language concepts
- C language basics
|
|