Question

FROM The HCS12 / 9S12 (2nd Edition) E4.19 please use C language to write the code...

FROM The HCS12 / 9S12 (2nd Edition) E4.19

please use C language to write the code and submit the code and pictures of the running circuit on the board.

(1) Write an instruction sequence to configure Port A and Port B for input and output,

respectively; read the value of Port A and output the value to Port B.

Homework Answers

Answer #1

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

#include "derivative.h"      /* derivative-specific definitions */

main()

{

DDRA = 0x00     /*Make PORTA as input*/

PORTA = 1;       /*initialize all input with value 1*/   

DDRB = 0xff;     /* Make PORTB output */

PORTB = 0;       /* Start with all off */

while(1)

{

PORTB = PORTA;  /*Assign the values of PORT A(input PORT) to PORT B

}

}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Please write code in c++ using iostream library. Write a function that have to copy one...
Please write code in c++ using iostream library. Write a function that have to copy one char array to other avoiding any not-letter symbols, program have to use pointer. Input: First line contains sequence of chars (size is not more that 100). 1w[a3ter11 output: water
Write an assembly language instruction to program the 82C55 to get data from port A and...
Write an assembly language instruction to program the 82C55 to get data from port A and send it to port B, if PA=IN, PB=OUT, PC0-PC3=IN, and PC4- PC7=OUT and operating in Mode 0. Use port addresses of 300H-303H for the 82C55 chip.
Please complete in MASM (x86 assembly language). Use the code below to get started. Write a...
Please complete in MASM (x86 assembly language). Use the code below to get started. Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). .386 .model flat,stdcall .stack 4096 ExitProcess PROTO,dwExitCode:DWORD .data    ; define your variables here .code main PROC    ; write your assembly code here    INVOKE ExitProcess,0 main...
USE C++ TO WRITE THIS CODE, MUST USE AN ARRAY An unknown number of grades as...
USE C++ TO WRITE THIS CODE, MUST USE AN ARRAY An unknown number of grades as integers, but no more than 30, are to be read from the file grades.dat. You may assume each grade will be a valid value between 0 and 100 (no validation necessary) and all "grades" are out of a maximum 100 points. Output the Number of Grades read in from the file. Calculate and output the Total Points Earned. Calculate and output the Total Possible...
C++ code please: Write a program to count the number of positive and the number of...
C++ code please: Write a program to count the number of positive and the number of negative inputs values. The program will stop when a 0 is input. Ex: If the input is -5.5 568 2.332 0 the output is 2 positive number(s) and 1 negative number(s). Ex: If the input is 153.0 0.534 2.2 5.6 46.584 0.015 5 0 the output is 7 positive number(s) and 0 negative number(s).
Please write the code in Python. Write a program/function in any Object-Oriented programming language that will...
Please write the code in Python. Write a program/function in any Object-Oriented programming language that will implement Queue Abstract Data Type with the following functions/methods.  Any build-in/pre-defined Queue function/library (e.g., java.util.Queue in Java) is NOT allowed to use in your code. push(Element):  insert the input Element (e.g., String or Integer in Java) to the end of the queue. pop(): remove the head element of the queue and print the head element on screen. count():  return the total number of elements in the queue...
1. Please use only the C as the language of programming. 2. Please submit/upload on Canvas,...
1. Please use only the C as the language of programming. 2. Please submit/upload on Canvas, the following les for each of your programs: (1) the client and the server source les each (2) the client and the serve executable les each (3) a brief Readme le that shows the usage of the program. 3. Please appropriately comment your program and name all the identiers suitable, to enable enhanced readability of the code. Problems 1. Write an ftp client that...
C program- using visual studio code. Write a program that asks for an integer and then...
C program- using visual studio code. Write a program that asks for an integer and then prints all the alternative integers from (and including) that value up to (and including) a value larger by 20. (That is, if the input is 5, the output runs from 5 to 25.) Be sure to separate each output value by a space or tab
Code a C file, following these instructions: This lab is about getting the input from a...
Code a C file, following these instructions: This lab is about getting the input from a file. Let’s assume the words are provided in one file, passed as an argument to your program. The names of the files are provided as arguments to your program (i.e., they are copied by the shell in the argv variable), and each file is a text file with lots of words. Open the manual page for open() system call and add to your code...
How would I write this function in C programming language? Function header: int input(int *a, int...
How would I write this function in C programming language? Function header: int input(int *a, int *b, int *c) This function should attempt to input 3 integers from the keyboard and store them in the memory locations pointed to by a, b, and c. The input may not be successful in reading all three values. The function should return the number of values that were successfully read.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT