Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE USE ASSEMBLY LANGUAGE TO CODE WITH LITTLE EXPLANATION OF WHATS GOING ON. Project 4-Looping Reading assignment: Please do this very thoroughly since the into

image text in transcribed

PLEASE USE ASSEMBLY LANGUAGE TO CODE WITH LITTLE EXPLANATION OF WHATS GOING ON.

Project 4-Looping Reading assignment: Please do this very thoroughly since the into h Finally SKIM: Book Chap. 2,3,4 (emphasis on 2.6, 2.7,3.8,3.9) Use Loop Time whose details have not yet been discussed in class. It provides you here is critical ata Sheet: pages 40-41 and at the back explanations for instructions: DECPS DECE,BNZ,COM Notes in class are critical with a 10msec delay of the processor whenever you call it Th e assignment is about using basic concepts learned in class to create subroutines and processor delays Create two counters BIG Counter & Small Counter with initial values of 0 each. The program's flow will be controlled from a toggle switch in the CADET which will be connected to pin RE2 on the PIC board. Each time the toggle switch is set the following should happen: The numbers are added (with no carry) .The BCD representation of the upper nimble 4-bits of the added number is displayed on the seven- segment display that will be provided .A delay of 1 second is created .The BCD representation of the lower nimble 4-bits of the added number is displayed on the above seven-segment display If the addition creates a number lower or equal to 50 the right LED lights up for I second and then turns off at the same time the nimbles are displayed . A delay of 2 seconds is created . The seven-segment display is turned off (reset) . BIG COUNTER increments by 3 .SMALL COUNTER increments by 2 BIG COUNTER gets to 60 and recycles to 0 SMALL COUNTER gets to 38 and recycles to 0 ROGRAM THEN REPEATS THE ABOVE DISPLAY INDEFINITELY When either counter recycles, then the ALIVE LED flashes for I second and the program continues . . As long as the toggle switch is set the above keeps repeating. The process halts only when the toggle switch is brought back to zero and it continues where it was left off when the toggle switch is set again NOTEI: you should write your program using as many subroutines as possible so that it has a good structure. Choose the proper 4-pins for the output (that input to the seven-segment display) according to your discretion and based on what we learned so far including the lab we did in ssion 1. Suggested output pins are: B2 .. .B5 NOTE2: Test each subroutine separately. DO NOT WRITE THE WHOLE PROGRAM AND THEN TRY TO DEBUG IT. YOU WILL NOT BE VERY SUCCESSFULL! NOTE3: Make a little table with the numbers that are being added and the result. That way when you debug your program, you are able to see what is happening. Show at least 10 numbers as an example on your test table NOTE4: You might need the daw command for BCD so either read about it or take notes in class NOTE 5: Use the command sequence repeat btfss PORT x, bit y bra repeat To have a software trap and to test the toggle switch when it is turned on. This command was explained in detail in class Project 4-Looping Reading assignment: Please do this very thoroughly since the into h Finally SKIM: Book Chap. 2,3,4 (emphasis on 2.6, 2.7,3.8,3.9) Use Loop Time whose details have not yet been discussed in class. It provides you here is critical ata Sheet: pages 40-41 and at the back explanations for instructions: DECPS DECE,BNZ,COM Notes in class are critical with a 10msec delay of the processor whenever you call it Th e assignment is about using basic concepts learned in class to create subroutines and processor delays Create two counters BIG Counter & Small Counter with initial values of 0 each. The program's flow will be controlled from a toggle switch in the CADET which will be connected to pin RE2 on the PIC board. Each time the toggle switch is set the following should happen: The numbers are added (with no carry) .The BCD representation of the upper nimble 4-bits of the added number is displayed on the seven- segment display that will be provided .A delay of 1 second is created .The BCD representation of the lower nimble 4-bits of the added number is displayed on the above seven-segment display If the addition creates a number lower or equal to 50 the right LED lights up for I second and then turns off at the same time the nimbles are displayed . A delay of 2 seconds is created . The seven-segment display is turned off (reset) . BIG COUNTER increments by 3 .SMALL COUNTER increments by 2 BIG COUNTER gets to 60 and recycles to 0 SMALL COUNTER gets to 38 and recycles to 0 ROGRAM THEN REPEATS THE ABOVE DISPLAY INDEFINITELY When either counter recycles, then the ALIVE LED flashes for I second and the program continues . . As long as the toggle switch is set the above keeps repeating. The process halts only when the toggle switch is brought back to zero and it continues where it was left off when the toggle switch is set again NOTEI: you should write your program using as many subroutines as possible so that it has a good structure. Choose the proper 4-pins for the output (that input to the seven-segment display) according to your discretion and based on what we learned so far including the lab we did in ssion 1. Suggested output pins are: B2 .. .B5 NOTE2: Test each subroutine separately. DO NOT WRITE THE WHOLE PROGRAM AND THEN TRY TO DEBUG IT. YOU WILL NOT BE VERY SUCCESSFULL! NOTE3: Make a little table with the numbers that are being added and the result. That way when you debug your program, you are able to see what is happening. Show at least 10 numbers as an example on your test table NOTE4: You might need the daw command for BCD so either read about it or take notes in class NOTE 5: Use the command sequence repeat btfss PORT x, bit y bra repeat To have a software trap and to test the toggle switch when it is turned on. This command was explained in detail in class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions