Assembly CODE HSC12 Dragon Board Assembly CODE HSC12 Dragon

Assembly CODE HSC12 Dragon Board

Assembly CODE HSC12 Dragon Board

Write a program that will wait for the user to press the switch labelled PA7 on your DRAGON12 Board. When the user presses the switch, Your program should print in %40 duty cycke to the TSCR2 value at any given time in the interrupt. Test the accuracy of your time by holding the button and counting the number or outputs in 10 seconds.

1. Wite a program that will wait for the user to press the switch labelled PA7 on your DRAGON12 board When the user presses the switch, your program should print in a 40% duty cydle the TSCR2 value at any given time in the interrupt Test the accuracy of your time by holding the button and counting the number of outputs in 10 seconds

Solution

#include <hidef.h>      /* common defines and macros */

#include <mc9s12dp256.h>     /* derivative information */

#pragma LINK_INFO DERIVATIVE \"mc9s12dp256b\"

/* This is used in the 7-seg decoder function */

unsigned char segs[16];

unsigned char num[8];

unsigned char max_value;

unsigned char min_value;

void seg7_out(short int);

void main(void) {

EnableInterrupts;

DDRM = 0x00; /* Buttons on */

DDRH = 0xFF; /* Display on */

/* These are required to set up the 7-seg display function (Common Cathode) */

/* CodeWarrior does not like declaring the following globally */

segs[0] = 0x3f;

segs[1] = 0x06;

segs[2] = 0x5b;

segs[3] = 0x4f;

segs[4] = 0x66;

segs[5] = 0x6d;

segs[6] = 0x7d;

segs[7] = 0x07;

segs[8] = 0x7f;

segs[9] = 0x6f;

segs[10] = 0x77;

segs[11] = 0x7c;

segs[12] = 0x39;

segs[13] = 0x5e;

segs[14] = 0x79;

segs[15] = 0x71;

/* Find the max and min values */

/* Now loop for the buttons */

}

/*

   This function will take in an unsigned char (you can think it as

   an 8-bit integer value) and display it on the 7-segment display.

   This depends on the segs[] array being defined first.

*/

void seg7_out(unsigned char value) {

/* Code goes here. Please see ASM version of the routine for hints */

};

Assembly CODE HSC12 Dragon Board Assembly CODE HSC12 Dragon Board Write a program that will wait for the user to press the switch labelled PA7 on your DRAGON12
Assembly CODE HSC12 Dragon Board Assembly CODE HSC12 Dragon Board Write a program that will wait for the user to press the switch labelled PA7 on your DRAGON12

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site