HW2 - n seconds delay. Where n is an integer parameter....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Ve373 Design of Microprocessor Based System Homework 2 Assigned: April 21, 2011 Due:April 28, 2011, at 10:00 am. The homework should be submitted electronically to SAKAI. Submission should include a word document as well as all the source codes. 1. Write a MIPS assembly program to generate a 1 ms delay. Assume the system clock = 80MHz. Simulate your program by using MPLAB IDE and measure the time with virtual Logic Analyzer or Stopwatch. Hint: you may use loop and “nop” instructions. (30 points) 2. Write a C function called genSec() to generate an approximate
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n seconds delay. Where n is an integer parameter. Hint: you may use regular loop statements or you may use inline assembly instruction in your C code by function asm() , e.g. asm(“NOP”) ;. (30 points) 3. Show how __PORTDbits_t is defined in the header file for PIC32MX795F512L MCU. What’s the relationship between __PORTDbits_t and PORTDbits? (10 points) 4. Write a C program to turn on port 0 of PORTD for 2 seconds and turn it off for 1 second, then repeat. Use the virtual Logic Analyzer to measure the accuracy of your program. (30 points)...
View Full Document

This document was uploaded on 06/24/2011.

Ask a homework question - tutors are online