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 code that uses javafx where the feauture are. 1. like with menubar that allows...
i need code that uses javafx where the feauture are. 1. like with menubar that allows to save and open file 2. when it has to save file it has own file type like for example s.suv 3. it should be able to open that file s.suv and lets add more icon into it
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++){...
Hi, I need the HTML5 code for the below. About Me **Would like to add a...
Hi, I need the HTML5 code for the below. About Me **Would like to add a image of a plane or something related to travel here. Mia Jo I am taking this class to earn my Computer programmer CL1. Things I Like to Do: Spend time with family Traveling People Watch Places I Want to Go or Have Visited: Dubai- December'18 Enjoyed shopping and the desert safari the most. Cuba- August '18 Enjoyed learning about the culture and history. China-...
I need my code output values edited to be formatted to two decimal places (i believe...
I need my code output values edited to be formatted to two decimal places (i believe using setprecision), i will need you to edit my code toformat each menu option to 2 decimal places: provided is my code #include <iostream> #include <iomanip> using namespace std; int main() {    double radius;    double base;    double height;    double length;    double width;    double Area;    const double PI = 3.14159;    int choice;    // display menu   ...
Can you please tell me why my code isn't working? It won't calculate the values I...
Can you please tell me why my code isn't working? It won't calculate the values I have using my input file. /******************************************************************************* AUTHOR SECTION ENGR 200.07 DATE: 10/23/2020 PROGRAM: ******************************************************************************** PROGRAM DESCRIPTION This program takes a pre-made .txt file’s input values, and calculates the kinetic energy wind farms produce from moving air into electrical energy. Using 3 different formulas this program calculates the available power in the wind, the maximum available power that can be produced, and the amount of...
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
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT