HW#16
Assign Fri 4/24
Due Wed 4/29 |
- Read Huang Chapter 6.5-6.11
(Interrupts, Clocking, Modes).
- Work Huang Chapter 10
problems
E10.[3,4] and write instruction sequences, not complete
programs, for each, using SPI0. Notes:
- E10.3: Write assembly code.
- E10.4: Write C code, using polling. Draw a logic
diagram of this system.
- Write a complete interrupt-driven program in
assembly code for the Dragon12 that
sends an array of bytes out through SPI0. It will consist of a main
background routine and one or more ISRs as follows:
- The main routine should initialize everything and
then check for completion flags from the ISRs as needed to sequentially
send 2 separate arrays through SPI0, then terminate the program. These
arrays are NOT character strings, but data bytes, so a byte count needs
to be provided for each array.
- The ISRs need to send out one complete data
array, whose size is given by a byte count, without any further help
from the main code, after they are started by the main code. After
completion, the ISRs stop running until restarted by the main code to
send another array.
- This program does NOT need to be executed on the Dragon12
board. Use the standard
header files as needed. Document the program properly,
including pseudocode. Follow the normal
Program Format for the ISR subroutines.
- 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\HW16\.
|
HW#15
Assign Wed 4/15
Due Mon 4/20 |
- Read Huang Chapter 10-10.9
(Serial Peripheral Interface - SPI).
- Work Homework #15
(Stack, Subroutines).
|
HW#14
Assign Mon 4/6
Due Mon 4/13 |
- Read Huang Chapter 4-4.9, 4.11-4.12
(Arrays, Strings, Stack, Subroutines).
- Write a complete interrupt-driven program in
EGNU C for the Dragon12 that
reads the value of the analog potentiometer and sends its value through
the serial port to the D-Bug12 terminal window on the PC monitor. No
polling for I/O or delays is allowed. It will consist of a main
background routine and several ISRs that do the following in a
continuous loop, repeating once per second (until Reset is pressed):
- Convert a sequence of 4 consecutive sample values
from the analog pot.
- Convert all values to actual voltages, accurate
to a tenth of a volt.
- Send a string to the serial port containing the 4
sample voltages plus their average in the following example decimal
format:
2.9, 3.1, 3.0, 3.1, = 3.0 Volts average <CR>
- Notes:
- Refer to Huang Example 12.8.
- The main routine should initialize everything and
then check for completion flags from the ISRs for every step (as
needed). All the ISRs must be initiated from main code.
- Write, compile, download and execute on the Dragon12
board. Test it over the full range of the
potentiometer. Use the standard
header files but none of the library I/O routine files. Document the program properly,
including pseudocode and timelines. Use subroutines as appropriate
for good practice.
- Print and submit a copy of the source file and
D-Bug12 log file. Copy all your files to your ClassDrop folder at
\\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW14\.
|
HW#13
Assign Mon 3/30
Due Mon 4/6 |
- Read Huang Chapter 9
(Serial Communication Interface - SCI).
- Work Huang Chapter 8
problems
E8.[2,5] 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, including pseudocode. Use
subroutines as appropriate for good design.
- E8.2: Write a main routine and a subroutine. The subroutine should return the duty cycle
as an unsigned 8-bit integer percentage. Write it in assembly code
only. Use simple register parameter passing in the assembly
code 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 GNU C code only. To keep it
simple, use polling (no interrupts).
- Due to the nature of these programs, do NOT
download or execute these on the Dragon12 board. Print and submit a copy of the source files (and
listing file for the Assembly code [but omitting all included files]). Copy all your files to your ClassDrop folder at
\\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW13\.
- 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#12
Assign Wed 3/25
Due Mon 3/30 |
- Read Huang Chapter 12-12.5.
(Analog-to-Digital Converter).
- Write a complete program in EGNU 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
without any flicker. 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 in binary. The main routine should initialize everything and then
enter an infinite loop doing nothing or WAI. Timer Output-Compare
operations should be
used to cause interrupts at an appropriate rate to activate the ISRs
which handle all delays, counting, and displays. No polling for I/O or
delays is allowed.
- Write, compile, download and execute on the Dragon12
board. Use the standard
header files and I/O routine files (library) as needed to simplify your
work. Document the program properly. 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\HW12\.
|
HW#11
Assign Fri 3/20 |
- Read Huang Chapter 8.5-8.6
(Timer Input Capture, Output Compare).
|
HW#10
Assign Wed 3/18
Due Mon 3/23 |
- Read Huang Chapter 6-6.4.3
(Interrupts).
- Read Huang Chapter 8-8.4
(Timer Subsystem Intro).
- Work Huang Chapter 7
problem
L7.5
as a complete program in EGNU C, as follows.
Notes:
- Write, compile, download and execute on the Dragon12
board. Use the standard
header files and I/O routine files (library) as needed to simplify your
work. Document program properly.
- Example 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, written in C instead
of assembly. 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 in the
example, using
subroutines.
- 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\HW10\.
|
HW#9
Assign Fri 3/6
Due Wed 3/18 |
- Read Huang Chapter 7-7.10
(Parallel Ports).
- Work Huang Chapter 5 problem E5.13. Note:
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. Copy all your files to your ClassDrop folder at \\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW9\.
|
HW#8
Assign Mon 3/2
Due Fri 3/6 |
- Read Huang Chapter 5 (C
Programming).
- Work Homework #8
(Branching, Shifting, Logical).
|
HW#7
Assign Fri 2/13 |
- Read the articles about Real-time System
Programming and Embedded Systems linked on our
References page.
|
HW#6
Assign Mon 2/9
Due Fri 2/13 |
|
HW#5
Assign Wed 2/4
Due Mon 2/9 |
- 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 and executed on
our Dragon12 board. Follow
all our Program Format guidelines for
complete programs.
- 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 these problems, use only the basic instructions
and arithmetic instructions that have been taught in class, but no looping operations
yet.
- Copy all your files for problems 6,7,9 to your
ClassDrop folder at \\athena.pclab.tntech.edu\classdrops\ECE\ECE6110-Haggard\your-name\HW5\.
|
HW#4
Assign Wed 1/28
Due Mon 2/2 |
- Read Huang chapter 3-3.8
(HCS12 Development Tools).
- Read Huang chapter 2-2.5
(HCS12 Directives and Arithmetic Instructions).
- Work Huang problems
3.[1,2,3,5,6]
(Using the 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 4 consecutive memory bytes at $1000 to $1003
and then verify them all.
- 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.
|
HW#3
Assign Wed 1/21
Due Mon 1/26
Due Wed 1/28 |
- 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 (values must differ from all class & book examples and
differ from each other).
- 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 Fri 1/16 |
- Read Huang chapter 1.4-1.12
(Intro to HCS12 assembly code).
|
HW#1
Assign Thu 1/15 |
- Read Huang chapter 1-1.3
(Intro to microcomputers).
- Review basic microcontroller information:
|
|