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++){...
Write a C program that allows: Three integer values to be entered (read) from the keyboard,...
Write a C program that allows: Three integer values to be entered (read) from the keyboard, Display the sum of the three values on the computer screen as follows: The integers that you have entered are: a b c The sum of a , b & c is ______ Thank you! C Code: Output screen:
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...
What do I need to implement this code. I need an ADT //--------------------------------------------- // This would...
What do I need to implement this code. I need an ADT //--------------------------------------------- // This would be the Student.h file //--------------------------------------------- #include <iostream> #include <cassert> using namespace std; // each student have a name, an ID (100000000~999999999), and three grades class Student { private: public: Student(); Student(); setName(); setId(); setGrade (); getName(); getId(); getGrade() ; printAll() ; }; //--------------------------------------------- // This would be the Student.cpp file //--------------------------------------------- //====================== YOUR CODE STARTS HERE ====================== Student::Student() //default constructor { } Student::Student(string aName,...
In the following code, what values could be read into a number to terminate the while...
In the following code, what values could be read into a number to terminate the while loop? PRINT "Enter a number: READ user input number ← user input WHILE (number < 1 or number > 10) PRINT "Enter another number: " READ user input number ← user input END WHILE A) Numbers in the range 0 - 9 B) Numbers in the range 1 - 10 C) Numbers greater than 10 D) Numbers less than 1
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)...
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 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...
Hi there, I need mpx2100ap arduino code do I need an amplifier to make this work...
Hi there, I need mpx2100ap arduino code do I need an amplifier to make this work ?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT