Write an instruction sequence to generate a 1000 Hz square wave and 40% duty cycle from PWM5 and use center-aligned mode. Assume that the E clock frequency is 24 MHz, and the orescale factor is 16. Assume it is 16-bit mode, stop PWM in wait and freeze mode. Set PWM5 output to start with low level.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

this is hcs12 assembly 

I need a detailed desription of how to achieve the answers below the question listed is already answered i just need to see detailed steps for every answer so i can study the steps needed to achieve said answer. The blue is the solution.

**EEEN 3449 - Test #3 - Spring 2021**

**Name:_____________**

Please PRINT your name clearly. If I cannot read it, I cannot record your score.

---

1. **Instruction Sequence:**

   Write an instruction sequence to generate a 1000 Hz square wave and 40% duty cycle from PWM5 and use center-aligned mode. Assume that the E clock frequency is 24 MHz, and the prescale factor is 16. Assume it is 16-bit mode, stop PWM in wait and freeze mode. Set PWM5 output to start with low level.

   **Fill in the blanks for the following:**

   ```
   movb #$20,   PWME
   movb #0,     PWMPOL
   movb #0,     PWMCLK
   movb #$40,   PWMPRCLK
   movb #$20,   PWMCAE
   movb #$4C,   PWMCTL
   movw #750,   PWMPER4
   movw #450,   PWMDTY4
   ```

2. **Explanations:**

   - **E clock** is at 24 MHz, assume the prescaler = 16  ⇒  Clock B is @ 1.5 MHz.

   - **Waveform frequency** = 1000 Hz, then the period = \( \frac{1}{1000} \) s.

   - **# of counts for clock B** in the period is \( \frac{1}{1000} \times 1.5 \times 10^6 = 1500 \).

   - **Calculations:**

     \[
     \text{[PWMPER2]} = 750 \quad \text{and} \quad \text{[PWMDTY2]} = 750 \times (1 - 40\%) = 450
     \]
Transcribed Image Text:**EEEN 3449 - Test #3 - Spring 2021** **Name:_____________** Please PRINT your name clearly. If I cannot read it, I cannot record your score. --- 1. **Instruction Sequence:** Write an instruction sequence to generate a 1000 Hz square wave and 40% duty cycle from PWM5 and use center-aligned mode. Assume that the E clock frequency is 24 MHz, and the prescale factor is 16. Assume it is 16-bit mode, stop PWM in wait and freeze mode. Set PWM5 output to start with low level. **Fill in the blanks for the following:** ``` movb #$20, PWME movb #0, PWMPOL movb #0, PWMCLK movb #$40, PWMPRCLK movb #$20, PWMCAE movb #$4C, PWMCTL movw #750, PWMPER4 movw #450, PWMDTY4 ``` 2. **Explanations:** - **E clock** is at 24 MHz, assume the prescaler = 16 ⇒ Clock B is @ 1.5 MHz. - **Waveform frequency** = 1000 Hz, then the period = \( \frac{1}{1000} \) s. - **# of counts for clock B** in the period is \( \frac{1}{1000} \times 1.5 \times 10^6 = 1500 \). - **Calculations:** \[ \text{[PWMPER2]} = 750 \quad \text{and} \quad \text{[PWMDTY2]} = 750 \times (1 - 40\%) = 450 \]
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Fundamentals of Computer System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education