Question: Problem 1: You got hired as the rooky embedded system design engineer by the ABC Innovations, Inc. Respond to the following simple queries to show


Problem 1: You got hired as the rooky embedded system design engineer by the ABC Innovations, Inc. Respond to the following simple queries to show some understanding of C programming on CodeWarrior and system development using HCS12 microcontroller. 1. Show how to load proper values to the two registers associated with PORT J to enable LEDs without affecting any other operations of the port. [5 points) SOLUTION: DDRJ = ?; PTJ &= ?; // Set PORT J pin 1 to be the output // Enable LEDs by connecting PJl to ground II. Show how to load proper values to the two PORT B registers to turn ON alternate LEDs (7,5, 3, and 1). Note that LED7 anode is connected to the pin PB7. [5 points] SOLUTION: DDRB = ?; PTB = ?; // Set PORT B for output // Turn ON alternate LEDs III. The following program fragment exhibits the variable "int sum" to become larger than 32767, whereby Data:1 or Data:2 subwindow of the Debug window exhibits a negative value (or a smaller positive value). What change would you make to your program fragment and why so that the exact "sum" value gets displayed? [10 points) int i, sum = 0; for (j = 0; j
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
