Question

In: Computer Science

You have to write an ARM Assembly M4 program for SLTB004A Thunderboard Sense 2. Write an...

You have to write an ARM Assembly M4 program for SLTB004A Thunderboard Sense 2.

Write an assembly program that blinks the red LED to send out a SOS Morse code (... --- ...). The dot duration must be 1/4 second and the dash one - 1/2 sec. Duration between dots and dashes is 1/4 second. After displaying SOS the program must delay for 2 seconds and then loop back to blink out SOS again. Use LETIMER for generating all time intervals.

Write an assembly program that controls the brightness of the green RG LED on the demo board. Pressing the BUTTON0 should increase the LED brightness while pressing BUTTON1 should decrease it. Implement 32 grades of brightness. Initial LED duty cycle must be 50%. Use LETIMER for generating PWM and CRYOTIMER for buttons debouncing.

Write an assembly program that first asks the user to enter initial time string in format hh:mm:ss (military time hours:minutes:seconds, 2 digits for each with leading zeros, if needed and colons as separators). After this by pressing BUTTON0 the program should start countdown from this time down to 0 and display valid time. Every press of BUTTON1 should postpone the countdown which can be further continued by pressing BUTTON0 from the time it was stopped before. The program should update time and display it in TeraTerm console window (every time in a new line) with 1 second period. Use RTCC to generate 1-sec events. No button debouncing is required.

Design assembly program that takes two numbers from the user input: n and m with n < m. Then it sets RTCC_CNT register with n and RTCC_CC0_CCV register with m and starts the RTCC. Reaching the alarm moment must be indicated by turning on the red LED.

Solutions

Expert Solution

First of all downlod the ardiono IDE.
(IDE is a peripheral that communicates between the hardware and the
software interface having a very user friendly User interface. It has it's necessary command
arranged in a graphical way to make it easy and interesting for beginners )

At the initial stage we have to blink a LED . so to program the board I used my ISP through ardiono IDE. I opend the blink code from file-->examples-->basics-->blink.

// constants wont change. They're used here to set pin umbers:

const int buttonPin = PA2; // the number of the pushbutton pin

const pin ledPin = PA7; // the number of the LED pin

// variables will change :

int buttonState = 0; // variable for reading the push button status vois setup(){

// initialize the led pin as an output :

pinMode(ledPin, OUTPUT);

// initialize the pushbutton pin as an input :

pinmode(buttonPin,INPUT);

}

void loop(){

//read the state of the pushbutton value:

buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed. if it is, the buttonState is High :

if(buttonState == HIGH){

// turn LED on :

digitalWrite(ledpin,HIGH);

}

else{

//turn LED off;

Then I connected the ISP to my echo-hello board with the jumpper wires. and then I connected the ISP to my laptop.

After that I changed few configurations in ardiuno IDE. following steps I did.:
1. Changed the baord to ATtiny 24/44/84
2. Processor I select ATtiny 44 becouse I have used that in my board.
3. Clock I changed to 8 MHz.
4. I select the port where I was connected the ISP.
5. Then I selected programmer as USBtiny ISP
After that I clicked on burn bootloader and burned the bootloader. and before clicking on verify I changed the and verified the code and clicked on update.

Blink

Turns on LED on for one seconf, them off for one second , repeatedly.

Most Ardunios have an on-board LED you can control. On the UND, MEGA and ZERO it is attached to digital pin 13 l on MCR1000 on pin6. LED_BUILTIN is set to the correct LED pin independent of which board is used.

if you want to know what pin the on-board LED is connected to on your arduino model .

// the setup function runs once when you press reset or power the board

void setup(){

// initialize digital pin LED_BUILTIN as an output.

pinMode(z,OUTPUT);

}

// the loop function runs over and over again forever

void loop() {

digitalWrite{

digitalWrite(z, HIGH); // turn the LED on

delay(1000); // wait for a second

digitalWrite(z,LOW); // turn the LED off by making the voltage LOW

delay(1000); // wait for a second

}

the LED started blinking all the way!!

After this I wanted to run a button code I went to File -> Examples -> Digital -> Button, becouse I wanted to run the button program.

This program is a connecting the button to the LED via micro controller.



Related Solutions

**Add comments to existing ARM code to explain steps** Write an ARM assembly program to convert...
**Add comments to existing ARM code to explain steps** Write an ARM assembly program to convert temperatures from Celsius to Fahrenheit or from Fahrenheit to Celsius. Here are the two formulas for your reference. Use variable to read and store values. C= 5* (F - 32) / 9 F = (9 * C / 5 ) + 32 My code below: TempConvert.s LDR R8,=temperature LDR R1,[R8] LDR R8,=unit LDRB R2,[R8] LDR R8,=celsius LDRB R3,[R8] LDR R8,=fahrenheit LDRB R4,[R8] MOV R6,#9...
Write an arm assembly program that will multiply two arrays (index by index) and store the...
Write an arm assembly program that will multiply two arrays (index by index) and store the result in a third array. Declare an array: .data Arr1: .quad 10    #index 0             .quad 4      #index 1          ….. Arr2: .quad 2,5,6…. Arr3: .quad 0,0,0…. To load array pointer address:      Movq $Arr1, %rdx   #stores address of Arr1 index 0 in rdx To move to the next index of an array:     Addq $8,%rdx To retrieve data: Movq (%rdx), %rcx         # will...
Write the below C program using ARM assembly language and compile for Cortex A53. #include<stdio.h> void...
Write the below C program using ARM assembly language and compile for Cortex A53. #include<stdio.h> void quicksort(int number[25],int first,int last){ int i, j, pivot, temp; if(first<last) { pivot=first; i=first; j=last; while(i<j) { while(number[i]<=number[pivot]&&i<last) i++; while(number[j]>number[pivot]) j--; if(i<j){ temp=number[i]; number[i]=number[j]; number[j]=temp; } } temp=number[pivot]; number[pivot]=number[j]; number[j]=temp; quicksort(number,first,j-1); quicksort(number,j+1,last); } } int main() { int i, count, number[25]; printf("Enter some elements (Maximum 25): "); scanf("%d",&count); printf("Enter %d elements: ", count); for(i=0;i<count;i++) scanf("%d",&number[i]); quicksort(number,0,count-1); printf("The Sorted Order is: "); for(i=0;i<count;i++) printf(" %d",number[i]); return...
Coding Problem 1: In this program, you are asked to write a program in assembly (MIPS)...
Coding Problem 1: In this program, you are asked to write a program in assembly (MIPS) which works as a simple calculator. The program will get two integer numbers, and based on the requested operation, the result should be shown to the user. a. The program should print a meaningful phrase for each input, and the result. i. “Enter the first number” ii. “Enter the second number” iii. “Enter the operation type” iv. “The result is” b. The user should...
Convert the following C++ statements to an ARM assembly language program: const int size = 10;...
Convert the following C++ statements to an ARM assembly language program: const int size = 10; int x[size] = {8, 2, 9, 6, 7, 0, 1, 3, 5, 4}; int y[size] = {399, -87, 12, 0, 42, -367, 57, 92, -1000, 25}; for i = 0; i < size; i++) if (x([ i ] > y[ i ]) z[ i ] = 0 else z[ i ] = 1;
Write an MSP430 assembly language program that implements the following 2 algorithms: 2) a macro called...
Write an MSP430 assembly language program that implements the following 2 algorithms: 2) a macro called "vdot" that calculates the "dot product" of two vectors "a" and "b", implemented as “arrays” (following the “C” language convention), of 3 elements. the macro should receive 2 pointers to the first element of each vector and return the result in R13.
Write in ARM assembly language the following operations without using multiplication instruction: a) A * 17...
Write in ARM assembly language the following operations without using multiplication instruction: a) A * 17 b). A * 23
Write the following code in ARM assembly code g=12, h=8, i=2, j=5; f = (g +...
Write the following code in ARM assembly code g=12, h=8, i=2, j=5; f = (g + h) - (i + j); Your program displays the message: f = (g + h) – (i + j) = 13 Note that 13 should be calculated, not hardcoded
Q1: A. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO EXCHANGE 16-BIT NUMBERS B. WRITE AN ASSEMBLY LANGUAGE...
Q1: A. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO EXCHANGE 16-BIT NUMBERS B. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO SOLVE THE EQUATION Z=A+B-(C/D)+E please write the answer separately part A its own code and part B its own code this is microprocessor the ASSEMBLY LANGUAGE emu8086 should be written like this EX: mov ax,100h mov bx,200h etc
Write an assembly language program to calculate score = (num1 + num2) /2 i.e input two...
Write an assembly language program to calculate score = (num1 + num2) /2 i.e input two numbers num 1 and num 2 and divide it by 2 to display score.Test your program for the Pep/9 computer.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT