Question


Consider the following assembly language code. The clock frequency is 4 MHz- and all initialization steps have been done correctly (like setting up digital I/O, the oscillator configuration, etc.) Constants Bit Pattern EQU HP20 Loopctr EQU HP21 Max Count EQU .23 Main program loop MainLoop cLRF BitPattern CALL Output BSF Bit Pattern, 1 CALL Output RRF Bit Pattern CALL Output BSF Bit Pattern, 1 CALL Output GOTO MainLoop Output MOVF Bit Pattern, W MOVWF PORTB MOVLW MaxCount MOVWF LoopCtr NOP Loop DECFSZ LoopCtr GOTO Loop NOP RETURN a. What sequence of numbers appears in BitPattern (hex or decimal is fine, just make sure it is clear which one you are doing!) b. From the start of one of the CALL instructions to the end of the subsequent RETURN instructino, how many cycles are taken? c. Sketch the waveforms you would see if oscilloscope probes are attached to the pins associated with PORTBKO> and PORTB<1>. Indicate both the vertical and horizontal scales (voltes/div and time/div).
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution: a. The sequence of numbers appearing in BitPattern . In main loop, CLRF BitPattern would clear BitPattern and hen

Add a comment
Know the answer?
Add Answer to:
Consider the following assembly language code. The clock frequency is 4 MHz- and all initialization steps...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Determine exactly how many instruction cycles the delay loop in the code below (between the comment...

    Determine exactly how many instruction cycles the delay loop in the code below (between the comment lines Begin Delay Loop and End Delay Loop) takes as a function of the variables Count1 and Count2. **Please Explain** MaxCount EQU H'0A Equates are good for defining literals CBLOCK H'20 Count1 Count2 Scratch A CBLOck defines a sequential regio:n ; Count1 is in location H'20 ; Count2 is in location H'21 ; Scratch is in lication H'22 ; ENDC ends the definition block...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT