Question

In: Computer Science

14.6 A- Fill in the Blanks for the required C instructions, and also fill in the...

14.6 A- Fill in the Blanks for the required C instructions, and also fill in the missing comments

/*******************************************************************

This program outputs 30 kHz square wave on

port T, bit-0 using timer channel 0 interrupts and the

output compare bit operations.

*******************************************************************/

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

#define HALF_P 133 /* Number clocks per 1/2 period */

/******************************************************************/ void interrupt 8 OC0_isr (void);

/******************************************************************/ void main(void) {

   /******************************************************************/

      /* Initialize I/O */

     

      ___________________ = 1; /* Enable the timer */

                               /*which Register, Which Flag bit */

     

      TIOS_IOS0 = _________;   /* Enable output compare channel 0 */

     

      /* Set up TC0 */

      _________________ = TCNT;

     

      /* Now have ~ 8 ms to set up the system without an interrupt */

      TFLG1 = TFLG1_C0F_MASK;/* Clear C0F flag */

     

      __________________ = 1; /* Enable the interrupt */

     

     /* Set up the output compare action to toggle

      * port T, bit-0. (DDRT does not need to be set.)

      */

      TCTL2_OM0 = 0;

      TCTL2_OL0 = 1;

      EnableInterrupts; /* Unmask interrupts */

      /* DO */

     

      for(;;) {

      }

      /* FOREVER */

}

/******************************************************************* * The interrupt service routine simply sets up the TC0

* for the next interrupt time.

*******************************************************************/ void interrupt 8 OC0_isr ( void ){

   /******************************************************************/

      /* Set up TC0, How? Need to add what Register? */

      TC0 += _______________________;

     

      

   TFLG1 = TFLG1_C0F_MASK; /* ______________________________________ */

}

Solutions

Expert Solution

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

#define HALF_P 133 /* Number clocks per 1/2 period */

/******************************************************************/ void interrupt 8 OC0_isr(void);

/******************************************************************/ void main(void) {

   /******************************************************************/

      /* Initialize I/O */

     

      ______TSCR1_____________ = 1; /* Enable the timer */

                               /*which Register, Which Flag bit */

     

      TIOS_IOS0 = _____0x00____;   /* Enable output compare channel 0 */

     

      /* Set up TC0 */

      ______________TC5___ = TCNT;

     

      /* Now have ~ 8 ms to set up the system without an interrupt */

      TFLG1 = TFLG1_C0F_MASK;/* Clear C0F flag */

     

      _______________TIE___ = 1; /* Enable the interrupt */

     

     /* Set up the output compare action to toggle

      * port T, bit-0. (DDRT does not need to be set.)

      */

      TCTL2_OM0 = 0;

      TCTL2_OL0 = 1;

      EnableInterrupts; /* Unmask interrupts */

      /* DO */

     

      for(;;) {

      }

      /* FOREVER */

}

/******************************************************************* * The interrupt service routine simply sets up the TC0

* for the next interrupt time.

*******************************************************************/ void interrupt 8 OC0_isr( void ){

   /******************************************************************/

      /* Set up TC0, How? Need to add what Register? */

      TC0 += _________________HiCnt______;

     

      

   TFLG1 = TFLG1_C0F_MASK; /* ______Clear COF flag________________________________ */

}


Related Solutions

C++ Fill in the blanks please You are required to fill in the blanks in this...
C++ Fill in the blanks please You are required to fill in the blanks in this program. Consider that: -In main, the variables price and quantity were given the names of p (double) and q (int), respectively. -In the getData function, the parameters associated with the main variables p and q were called pp and pq, respectively. // Prototype: Do not include the names // of the variables in the prototype void getData (FILLTHEBLANK , FILLTHEBLANK); int main () {...
Fill in the following blanks: a. ____________ is also referred to as glucose b._____________ is often...
Fill in the following blanks: a. ____________ is also referred to as glucose b._____________ is often used to remove the bitter flavor from caramelization reactions. c. ____________ is the protein found in eggs d. ____________ and __________are the proteins found in wheat, while ___________is the protein found in corn
Fill in the blanks in the following tables: Instructions: If you are entering any negative numbers...
Fill in the blanks in the following tables: Instructions: If you are entering any negative numbers be sure to include a negative sign (-) in front of those numbers. Real Interest Rate Nominal Interest Rate Expected Inflation a. 5 2 b. 3 4 c. 3 6 d. 5 1 Instructions: If you are entering any negative numbers be sure to include a negative sign (-) in front of those numbers. Real Interest Rate Nominal Interest Rate Expected Inflation a. 9...
fill in the blanks.1. the statement of financial position is also knownas a(n) ?...
fill in the blanks.1. the statement of financial position is also known as a(n) ?2. the inventory account is found on the ?3. net sales less cost of goods sold yields ?4. prepaid expenses are a ?5. which of the following accounts represents the market value of the company ?6. capital stock is found on the ?7. the wages accrual adjusting entry credits a liability account and debits.8. if a liability increases, then.9. if an owners equity account increases then...10....
Fill in the blanks: Consider the following equilibrium and fill in the blanks with either increase...
Fill in the blanks: Consider the following equilibrium and fill in the blanks with either increase or decrease. I2(s) + 5F2(g) ⇌ 2IF5(g) A decrease in volume results in a Blank 1 in pressure which will Blank 2 the amount of IF5.
using lunix or C programming to answer this lab please fill in the blanks with the...
using lunix or C programming to answer this lab please fill in the blanks with the answere being highlighted, so i can understand. First, type the following command:             sort employee What is the order that employee is sorted in? ___________________________________________ Give a brief description of how the file is sorted. _____________________________________________________________________________________________________________________________________________________________________________________________________ Now, sort on the field for last name.         sort +1 employee Look at the sorted file. Are all the names sorted in alphabetical order? ______________________ Give a brief description...
Fill in the blanks on the following table
 Fill in the blanks on the following tableE&pshareholder basisdistributiondividendreturn of capitalcapital gain20,000300,00080,000120,00010,000170,000220,000100,000170,00020,000080,000<20,000>50,000170,000
Fill in the Blanks a) Polysaccarides______. A) are glycans. B)have a fixed length. C) are never...
Fill in the Blanks a) Polysaccarides______. A) are glycans. B)have a fixed length. C) are never branched. D) must be homopolysaccharides. b) Glycoproteins _______. A)are always intracellular.   B) are a small fraction of the total number of proteins in a human cell.   C)contain unbranched oligosaccharides.  D)have oligosaccharides covalently attached to aspartate residues. c) Oligosaccharides are _______. A)never attached to hormones. B) never found in mucins. C)classified as N- or O-linked when found in gangliosides. D) found in bacterial lipopolysaccharides. d) Lectins...
Problem C. Fill True or False in the blanks for the following statements. True 1) _...
Problem C. Fill True or False in the blanks for the following statements. True 1) _ __ Operating system defines the ways in which the system resources are used to solve the computing problems of the users. 2) _ _ Operating system (OS) controls and coordinates use of hardware among various applications and users. 3) ______ System daemons are the first programs to be loaded and executed when powering-up or rebooting a computing system. 4) ______ When an OS runs...
For each of the questions that follow, fill in the blanks. Blanks are denoted by --[N.]--,...
For each of the questions that follow, fill in the blanks. Blanks are denoted by --[N.]--, where N is an upper-case Roman numeral. (a) Complete the following code so that the loop executes 10 times (3) int j = −−[I.]−−; int i=1; while ( −−[II.]−− ) { i = i + −−[III.]−−; } (b) Complete the following function which sorts C-strings into alphabetic order. (4) Page 4 void bubbleSort( char names[ ][COLS] , int count) { int pass , index...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT