2 - 1. Write a MIPS assembly program to generate a 1 ms...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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 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) 1. #include <p32xxxx.h> .global main /*define all global symbols here*/ /************************************************************************* * main(). This is where the PIC32 start-up code will jump to after initial
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 06/24/2011.

Page1 / 4

2 - 1. Write a MIPS assembly program to generate a 1 ms...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online