EE337_Lab4
EE337_Lab4
1. [20 points] In order to convert an analog signal to a digital signal, the 3 steps to be
followed are sampling, quantization and encoding. In this lab, you will use the board
to read inputs (assume these are the sampled inputs), then quantize and encode the
inputs, and display the encoded digital outputs using the on-board LEDs.
• Use delay 1ms subroutine given in the previous lab to make a subroutines to
generate 4 seconds delay and 8 seconds delay.
• Write a function to take 4 user inputs using pins with the help of 8 seconds
delay function, and store them in 4 memory locations.
Starting Code-
// -- DO NOT CHANGE ANYTHING UNTIL THE **** LINE--//
ORG 0H
LJMP MAIN
ORG 100H
MAIN:
CALL TAKE_INP
CALL QUANT_ENC
CALL LED_DISP
HERE: SJMP HERE
ORG 130H
// *****************
DELAY:
// ADD YOUR CODE HERE
TAKE_INP:
// ADD YOUR CODE HERE
QUANT_ENC:
// ADD YOUR CODE HERE
LED_DISP:
// ADD YOUR CODE HERE
RET
END
TA Checkpoints
1. Check if the student knows how to give inputs from Peripherals → I/O-Ports →
Port 1 and how to verify the outputs in Logic Analyzer in Keil.
2. Check if the delays generated by the student are correct using Logic Analyzer
(4 seconds and 8 seconds).
3. Check if the student knows how to operate Flip/ DFU Programmer, and shows all
the tests mentioned.
4. Check if student knows how to generate the hex file, upload it onto the board,
provide inputs using pins and display outputs on the LEDs.
Page 2
5. Check the working for the following 2 test cases:
Page 3