I need this in assembly language please. Use Dragon12-Light (or Dragon12-Plus2) Evaluation Board and the CodeWarrior IDE to develop the following programs.The first one is to write a program that implements an 8 bit up counter on the 8 LEDs. Increment the counter every second.The second one is to write a program that generates a noise of 500Hz on the speaker on your board.Thank you so much!
Code for the implementation of 8 bit up counter on the 8 LED,
/* source: https://www.electroschematics.com/9809/arduino-8-bit-binary-led/ */
int button = 2; // pin to connect the button
int presses = 0; // variable to store number of presses
long time = 0; // used for debounce
long debounce = 100; // how many ms to "debounce"
const byte numPins = 8; // how many leds
int state; // used for HIGH or LOW
// pins to connect leds
byte pins[] = {5, 6, 7, 8, 9, 10, 11, 12};
void setup()
{
/* we setup all led pins as OUTPUT */
for(int i = 0; i < numPins; i++) {
pinMode(pins[i], OUTPUT);
}
pinMode(button, INPUT);
/* use pin 2 which has interrupt 0 on Arduino UNO */
attachInterrupt(0, count, LOW);
}
void loop()
{
/* convert presses to binary and store it as a string */
String binNumber = String(presses, BIN);
/* get the length of the string */
int binLength = binNumber.length();
if(presses <= 255) { // if we have less or equal to 255 presses
// here is the scary code
for(int i = 0, x = 1; i < binLength; i++, x+=2) {
if(binNumber[i] == '0') state = LOW;
if(binNumber[i] == '1') state = HIGH;
digitalWrite(pins[i] + binLength - x, state);
}
} else {
// do something when we reach 255
}
}
/* function to count the presses */
void count() {
// we debounce the button and increase the presses
if(millis() - time > debounce) presses++;
time = millis();
}
I need this in assembly language please. Use Dragon12-Light (or Dragon12-Plus2) Evaluation Board and the CodeWarrior...
Use HCS12 assembly
language only!
Write a program sequence to interface with seven-segment display and the RGB LED on the Dragon12- Light board. Your program should display digit '2' on the DIGI and blue light on the RGB LED the m should digplay digi 2
Write a program sequence to interface with seven-segment display and the RGB LED on the Dragon12- Light board. Your program should display digit '2' on the DIGI and blue light on the RGB LED the...
Use HCS12 assembly language only - not C code Using CodeWarrior to create a new project that uses assembly language. Write an assembly program that turns on the red LED at the beginning. It switches to off 2 seconds later and switches back to on after three more seconds. (That is, it stays on for 2 seconds and off for 3 seconds.) This switching process lasts forever. Use a loop (or nested loops) for each of the 2/3-second delay where...
Please use Assembly Language to write:
Write a program that draws an 8 times 8 chess board, with alternating gray and white squares. You can use the SetTextColor and Gotoxy procedures from the Irvine32 library. Avoid the use of global variables, and use declared parameters in all procedures. Use short procedures that are focused on a single task. (A VideoNote for this exercise is posted on the Web site.) This exercise extends Exercise 9. Every 500 milliseconds, change the color...
Lab 1-Lab Portion Part I Copy the Blink program from Figure 1-13 (page 17) in the textbook and run it on your Arduino. After verifying that the Blink program works, modify the program to make the on-board LED attached to pin #13 blink out "SOS" in Morse code. Use a 2 750 millisecond for long pulses. 50 millisecond for short pulses and a Part 2, Write a program that uses two pushbuttons to increase or decrease the brightness of the...
MIPS ASSEMBLY LANGUAGE Write MIPS code to convert binary to decimal: (01110001)2 to (113)10 .data binary_digit: .word 0 1 1 1 0 0 0 1 # is 113 in decimal .globl main main: # Load arguments to argument registers # Call convert() # Print return value # (it's in $v0, make sure to copy it before overwriting to print) # Properly end program convert: # This label is where conversion of the current...
(f) and (g) please
f and g please
letters Question 2 Indirect addressing mode in assembly language is sanilar to pointers in C. Answer the following questions: (1 point) a) How many 8-bit registers can a FSR access in the PICI8F452 MCU? b) Write the assembly language command to load the address of the variable with name: PVal into one of the FSR? (2 points) (2 points) (2 points) c) What is the meaning of: movf PREINC2, F? d) What...
I am having an issue with this practice problem. I understand
the concept of given step, but I am lost to figure out how to setup
in the main program in CodeWarrior software. Using the HCS12
Microcontrollers and Embedded Systems, 1st Edition, I was able to
understand the instruction appendix, but I was not able to
construct it in the main program. I need help to solve these steps
and it is due today.
Modify the Main program section of...
how to write assembly language for x86 and where do I
put the code under as? please give me answer as soon as
possible.
ZOOMt COSC 2325.S01 Kxtra Credit l'rogram Problem: Starting wilh the following C+program #includes iostream > using cspace sld; cxlem'C" long Average (long, long LD; void main long Arrayl Г 101-1, 2, 3. 4, 5, 6, 7, 8. 9. 103; long Aray2 111」 {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; coul <'': "Average...
i
posted device what i use
Introduction Project 1 is designed to increase famiarty with Amel Studia, the Atmel Software Framework, and te N ELVIS Il electrical test and measurement บnten. In addeen, it as LEDs vd pushbumons (overs concepts such as de-bouncing pushb.nors, ล"d sina ig and sorong with a microcontroler Materials 1 SAMD21 or SAMN25 Xpuined Pro Evaluation Board 2 LED 3300 resistor 4) 10k resistor S Push buttorn hamper wees Breadboar 8 SAMD21 Datasheet Equipment NI ELVIS...