For more classes visit
www.snaptutorial.com
Laboratory Title: Introduction to Memory Map
Submittal Date:Click here to enter a date.
Objectives:
The objective of this lab is familiarize ourselves with different factor for memory such as memory decoding
1. ECET 330 Week 1 iLab Part 1 Introduction to
Memory Map
For more classes visit
www.snaptutorial.com
Laboratory Title: Introduction to Memory Map
Submittal Date:Click here to enter a date.
Objectives:
The objective of this lab is familiarize ourselves with different factor for
memory such as memory decoding and memory mapping
Give two differences between EEPROM and Flash memory.
Indicate the use of each memory in the microcontroller. In other words,
state which one is used for code, program variables, and variables that
must remain when the power is turned off.
State the number of address and data pins for 32Kx8 SRAM.
tate the number of address and data pins for 8Kx8 SRAM memory.
**********************************************************
2. ECET 330 Week 1 iLab Part 2 Introduction to
Assembly and Machine Language
For more classes visit
www.snaptutorial.com
Laboratory Number: 1 (Part 2)
Laboratory Title: Introduction to Assembly and Machine Language
Submittal Date:Click here to enter a date.
Objectives:
The objectives of this part of lab 1 are to become familiarized with the
cpu function as well as being exposed to basic assembly language and
understanding machine language.
**********************************************************
ECET 330 Week 2 Homework
For more classes visit
3. www.snaptutorial.com
1. Write a simple program in which the value, $55, is added three time
2. Which of the following instructions is (are) illegal?
I. LDAA #500
II. LDAA #50
III. LDAA #$255
IV. STAA #50
V. STAA $50
VI. LDAA 6, X
3. Identify the addressing mode for each of the following.
I. STAA $2005
II. LDAA #$55
III. STAA $55
IV. CLRA
V. ADDA 0, X
4. Show the status of C and Z flags after each of the following codes.
I. LDAA #$54
ADDA #$C4
II. LDAA #01
4. ADDA #$FF
5. Show the status of H and N flags after the following code.
LDAA #$A1
ADDA #$0F
6. Define a byte-size and word-size variable starting at address $2000.
Initialize both variables to $55. You should use ORG, DC.B, and DC.W
directives.
**********************************************************
ECET 330 Week 2 iLab Introduction to
CodeWarrior
For more classes visit
www.snaptutorial.com
Objectives:
To Install CodeWarrior
Explore the CodeWarrior IDE and the operations
5. Become familiar with how an assembly language program is entered and
simulated using CodeWarrior
To learn how to generate a list file
Assume that the value of Register A is $FF and Register B is 00. What
will be the value of zero flag, carry flag, Register A, Register B, and
Register D after executing the instruction?
Assume that the value of Register A is $FF and Register B is 00. What
will be the value of zero flag, carry flag, Register A, Register B, and
Register D after executing the instruction?
Assume that the value of Register A is $FF and Register B is 00. What
will be the value of zero flag, carry flag, Register A, Register B, and
Register D after executing the instruction?
Assume that the value of Register D is $00FF. What will be the value of
Registers A, B, and D after executing the instruction?
**********************************************************
ECET 330 Week 3 iLab Introduction to Loops
and Subroutines in Assembly
For more classes visit
www.snaptutorial.com
6. Objectives:
To become familiar with conditional branch instructions
Understanding how to write loops
Understanding how to write subroutines
What does the CPU do (in terms of register contents and stack) when it
executes a JSR instruction?
What does the CPU do (in terms of register values and stack) when it
executes a RTS instruction?
**********************************************************
ECET 330 Week 4 Homework
For more classes visit
www.snaptutorial.com
1. Write a program to get eight-bit data from PORTA and send it to
PORTB and PORTC. Make sure to define each port as input or output
7. 2. Write a program to toggle all bits of PORTA continuously by sending
$55 and $AA to it
3. Write a program to toggle PB3, PB7, and PB5 continuously without
disturbing the rest of the bits. Assume that there is a delay procedure that
you can call.
4. Write a program to monitor Bit PJ3, which is connected to a switch.
When it is HIGH, send 55H to the output port, PORTB. You also need
to define the PJ3 bit as an input port, and PORTB as an output port
5. Eight switches are connected to PORTB and eight LEDs are
connected to PORTA. We would like to monitor the first two least
significant bits of PORTB (use masking technique). Whenever both of
these bits are set, switch all LEDs of Port A on for one second. Assume
that the name of the delay subroutine is DELAY. You do not need to
write the code for the delay procedure.
**********************************************************
ECET 330 Week 4 iLab Introduction to Tower
Module
For more classes visit
www.snaptutorial.com
8. Objectives:
1.To set up the Tower System
2.Become familiar with programming and using the Tower Module
3. Become familiar with I/O port programming
Results:
I learned how to Set up the Tower Module and connect it to the PC.
Conclusions:
The Module tower has four green LEDs connected to Port T. Each LED
is configured for active low operation. As this is done, it turns the LED
on, when a 0 is sent to it. I also became familiar with programming and
using the Tower Moduleto program I/O ports.
**********************************************************
ECET 330 Week 5 Homework
For more classes visit
www.snaptutorial.com
9. 1. Show the value of the register and the carry after the execution of
the ASLA instruction
Given the original content of Register A and carry flag 0
1 0 0 1 0 1 0 1
C
C = Register A =
2. Show the value of the register and the carry after the execution of
the LSLB instruction.
Given the original content of Register B and carry flag 0
1 0 0 1 0 1 0 1
C
C = Register A =
3. Show the value of the register and the carry after the execution of
theASRB instruction.
Given the original content of Register B and carry flag 1 0
1 0 0 1 0 1 0
C
C = Register A =
4. Show the value of the register and the carry after the execution of
theRORA instruction.
Given the original content of Register A and carry flag 1
1 0 1 1 1 1 1 0
C
10. C = Register A =
5. Show how to perform 77 x 34 in the HCS12. Store the result in a
WORD-size variable called var1.
6. Show how to perform 77 / 3 in the HCS12. Store the quotient in a
WORD-size variable called result, and the remainder in a WORD-size
variable called remainder.
7. How are the following decimal-signed numbers represented in
HCS12?
**********************************************************
ECET 330 Week 5 iLab Data Manipulation in
Assembly Language
For more classes visit
www.snaptutorial.com
Objectives:
Given an arithmetic equation or data conversion, develop an assembly-
language algorithm to implement the correct sequence of operations.
11. Learn how to design assembly-language programs that require decision
logic in order to accomplish their tasks.
Results
It was quite difficult to design the program because it was hard to
remember all the codes.
Conclusions:
In conclusion, I now know how to write a program using assembly
language when given an arithmetic equation or data conversion.
**********************************************************
ECET 330 Week 6 Homework
For more classes visit
www.snaptutorial.com
1. Write a program to continuously read the DIP switches connected to
PORTA and send it to PORTB.
2. Assume that eight DIP switches are connected to PORTB and eight
LEDs are connected to PORTC. Assume that the switch values are
12. normally high. Turn all of the LEDs on and wait in a loop until one of
the switches becomes zero. At that time, send 0x55 to PORTC
3. Write a C program to declare two character arrays called list1 and
list2. Initialize list1 with your first and last name. Write the main code to
copy list1 to list2.
4. Write a function to convert a character to uppercase (if it is lowercase)
and return the character. Hint: Subtracting 0x20 from the ASCII code of
a lowercase character makes it an uppercase
5. Write a C program to convert a packed BCD at Port B to ASCII and
display the bytes on PORTC and PORTD.
**********************************************************
ECET 330 Week 6 iLab Embedded C
Programming Part I
For more classes visit
www.snaptutorial.com
Objectives:
To learn how to write a C program using CodeWarrior IDE
13. To learn how to program I/O instructions in C language
To learn how to organize a C program to read data from input ports,
process the data, and display the result on a simple output device
To learn how to write inline assembly language in C
When we write a C program, in some cases, we need to write some part
of the code in assembly language. What do we call an assembly-
language code written in a C program? Describe a situation where
assembly-language code is preferred over C.
Discuss the reason why we used unsigned char for a loop counter of
Problem 4 as opposed to int.
**********************************************************
ECET 330 Week 7 Homework
For more classes visit
www.snaptutorial.com
1. Is it possible to interface an IC with a different technology such as
TTL to HCS12 ports? What are the conditions in terms of electrical
parameters that need to be satisfied for this purpose?
14. 2. Given an LED with a forward drop of 1.5V and an operating current
of 10 mA, design the interface to the HCS12 showing your calculations
3. Bit 4 of Port B is connected to a switch that normally outputs a zero.
Monitor this switch to detect a change from zero to one. Immediately
when it becomes one, call a function to toggle Bit 5 of Port B, which is
connected to an LED. Use an exclusive-OR operation to toggle PB5 two
times. After the function call, the code should branch to the line that
monitors PB4
4. Write a program to create an array initialized with Hex digits in the
ROM space. The main code should copy this array to a different array in
the RAM space
5. What is the function of the enable control input of a tri-state buffer? If
the output of two or more tri-state buffers is connected to each other,
what is the restriction on enable control input lines? What does happen
when this restriction is violated?
**********************************************************
ECET 330 Week 7 iLab Embedded C
Programming Part II
For more classes visit
www.snaptutorial.com
15. Objectives:
To become familiar with enabling internal pull-up resistors and reading
an input port
To learn how to wait for a pushbutton press
To learn how to organize a C program to read data from input ports,
process the data, and display the result on a simple output device
To learn how to use the ROM program space for data
Describe the code statement:
while ((PT1AD & 0xF0) != 0xF0);
What does this code do? Do we need the inner parenthesis for the
code to work? Why?
When we define an array in the program ROM space, we use a const
keyword. What does this keyword do? What does happen if we remove
this keyword?
**********************************************************