Question

In: Electrical Engineering

I need code for the HCS12 Dragon trainer plus 2 that allows me to read values...

I need code for the HCS12 Dragon trainer plus 2 that allows me to read values from its built in temperature sensor and displays those values on the seven segment displays .

Solutions

Expert Solution

a) After deleting everything in the main.c,
b) Then you have to copy and paste the program into the main.c,
c) to make F7 to download F5 and to run F5 and then execute it

#include <hidef.h>   //--com. define, macros 
#include "derivative.h"      // --derivative-specific-definitions 
void MSdelay(unsigned int);
void main(void) {
    DDRB = 0xFF;    //--PORTB as o/p
    DDRJ = 0xFF;    //--PTJ as o/p for Dragon12+ LEDs
    PTJ=0x0;        //--Allow these LEDs. to. dsiplay. data. on. PORTB. pins.
    ATD0CTL2 = 0x80;     //--Turn on ADC,..No... ..Intr
    MSdelay(5);
    ATD0CTL3 = 0x08;  //--one. conversion., there. is. no. FIFO.
    ATD0CTL4 = 0xEB;  //--8-bit resolution, 16-clock. for. 2 phase.,
                      //--prescaler of 24 for the Conversion of Frequency=1MHz  
    for(;;)
    {
    ATD0CTL5 = 0x85;  //--Channel-5 (right-justified, unsigned&single-conver,one-chan only)
   while(!(ATD0STAT0 & 0x80));
    PORTB = ATD0DR0L;  //--dump it on the LEDs
   MSdelay(2);   //--optional
   }
    
 
  }
 
 void MSdelay(unsigned int itime)
  {
    unsigned int k; unsigned int l;
    for(k=0;k<itime;k++)
      for(l=0;l<4000;l++);
  }

Related Solutions

hi i need a code that will give me this output, For the multiply_list, the user...
hi i need a code that will give me this output, For the multiply_list, the user will be asked to input the length of the list, then to input each element of the list. For the repeat_tuple, the user is only asked to enter the repetition factor, but not the tuple. Your program should take the list created before and convert it to a tuple. output expected: (**user input**) ******Create your List ****** Enter length of your list: 3 ******...
I need to fix this code, and could you please tell me what was the problem...
I need to fix this code, and could you please tell me what was the problem options 1 and 9 don't work #include <stdio.h> #include <time.h> #include <stdlib.h> // generate a random integer between lower and upper values int GenerateRandomInt(int lower, int upper){     int num =(rand()% (upper - lower+1))+lower;     return num; } // use random numbers to set the values of the matrix void InitializeMatrix(int row, int column, int dimension, int mat[][dimension]){     for(int i =0; i<row; i++){...
I need a full java code. And I need it in GUI With the mathematics you...
I need a full java code. And I need it in GUI With the mathematics you have studied so far in your education you have worked with polynomials. Polynomials are used to describe curves of various types; people use them in the real world to graph curves. For example, roller coaster designers may use polynomials to describe the curves in their rides. Polynomials appear in many areas of mathematics and science. Write a program which finds an approximate solution to...
this is a python code that i need to covert to C++ code...is this possible? if...
this is a python code that i need to covert to C++ code...is this possible? if so, can you please convert this pythin code to C++? def main(): endProgram = 'no' print while endProgram == 'no': print # declare variables notGreenCost = [0] * 12 goneGreenCost = [0] * 12 savings = [0] * 12 months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] getNotGreen(notGreenCost, months) getGoneGreen(goneGreenCost, months) energySaved(notGreenCost, goneGreenCost, savings) displayInfo(notGreenCost, goneGreenCost, savings, months)...
I need the code in SAS and R and outputs please 2. The data below come...
I need the code in SAS and R and outputs please 2. The data below come from a study investigating a method of measuring body composition, and give the body fat percentage (% fat), age and sex for 18 adults aged between 23 and 61 years. Source: Mazess, R.B., Peppler, W.W., and Gibbons, M. (1984) Total body composition by dual-photon (153GD) absorptiometry. American Journal of Clinical Nutrition, 40, 834-839. age % fat sex 23 9.5 male 23 27.9 female 27...
can someone make me a shopping cart for me ? i need to make a shopping...
can someone make me a shopping cart for me ? i need to make a shopping cart ,but i have no idea about how to do this i have made 3 line of items , this is one of the pruduct line line 1 ------------------------------------- <!DOCTYPE html> <html lang="en"> <head> <style> .div1 { border: 2px outset red; background-color: lightblue; text-align: center; } </style> </head> <!-- body --> <body style="background-color:silver; "class="main-layout position_head"> <!-- loader --> </li> </ul> </section> </nav> </section> </header>...
I need 2 Pages Typed on this. Opportunity Cost (or lost)    Read and think about the 10...
I need 2 Pages Typed on this. Opportunity Cost (or lost)    Read and think about the 10 Commandments from a Money Talks News Website. Go to Commandment #8 called “Always Consider Opportunity Cost”. Follow the instructions to review all the items in your home and garage, etc. that you have not touched in several months.      Figure out how much money you have spent and, by using the formula supplied by the author, figure how much money you could have had in...
i need a survey in organization about personality and values .
i need a survey in organization about personality and values .
C Code! I need all of the \*TODO*\ sections of this code completed. For this dictionary.c...
C Code! I need all of the \*TODO*\ sections of this code completed. For this dictionary.c program, you should end up with a simple English-French and French-English dictionary with a couple of about 350 words(I've provided 5 of each don't worry about this part). I just need a way to look up a word in a sorted array. You simply need to find a way to identify at which index i a certain word appears in an array of words...
Need to read the article from the link I provided and need to come up with...
Need to read the article from the link I provided and need to come up with a 2-3 page summary and critique and providing real life examples. https://motherboard.vice.com/en_us/article/qkv5a3/apocalypse-neuro-why-our-brain-cant-process-the-planets-gravest-threats or https://www.islamicboard.com/general/134342488-apocalypse-neuro-brains-dont-process-gravest-threats-humanity.html
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT