USING CODEWARRIOR AND C LANGUAGE. Combine the external interrupt and RTI softwar
ID: 2989743 • Letter: U
Question
USING CODEWARRIOR AND C LANGUAGE.
Combine the external interrupt and RTI software codes in compliance to the following requirements: your last name to appear on LCD row 1, the interrupt counter count number between 0 and 99 displayed on row 2, and on row 3, the value generated by the RTI.
A.
// Your name and data accomplished
// This is a simple demonstration of RTI interrupt.
// The RTI clock is default to internal oscillator running at 1 MHz.
// Writing 0x7f to CPUMRTI sets the clock divider to 16 x 2^16 = 1,048,576.
#include /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
/******* Global Variables *******/
unsigned char cCount;
/******* main *******/
void main(void) {
cCount = 0xf0; // for timing measurement
DDRT = 0xf0; // upper nibble of Port T configured as outputs
PTT = cCount;
CPMURTI = 0x7f; // set RTI clock divide to do 0.953 Hz
CPMUINT_RTIE = 1; // enable RTI
EnableInterrupts;
for(;;) //infinite for loop
Explanation / Answer
// Your Name and Date accomplished
// Displaying messages on the 3 x 16 LCD
// PORT C7
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.