Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use info below to solve a and b 4.Write an instruction sequence to generate a 1.5 KHz square wave with 40% duty cycle from PWM6

use info below to solve a and b

image text in transcribedimage text in transcribed

image text in transcribed

image text in transcribed

4.Write an instruction sequence to generate a 1.5 KHz square wave with 40% duty cycle from PWM6 output pin and use center-aligned mode. Assume that the E clock frequency is 24 MHz, and the prescale factor is 32. Assume it is 8-bit mode, stop PWM in wait and freeze mode. a) Set PWM6 output to start with low level. b) Set PWM6 output to start with high level. a): Set PWM6 output to start with low level. movb# PWMCLK movb#S PWMPRCLK movb#__, PWMPOL movb# PWMCAE movb#$ , PWMCTL movb# PWMPER6 movb# PWNDTY6 movb# PWMCNT 6 bset PWME S b): Set PWM6 output to start with high level. [PWMPER6] =150; (PWMDTY61=150x409=60 movb# PWMCLK movb#S PWMPRCLK movb#_ PWMPOL movb#__, PWMCAE movb# $ PWMCTL movb# PWMPER6 movb# PWNDTY6 movb #__ PWMCNT 6 bset PWME, S a) PPOL6 - 0 b) PPOL6 = 1 PWMDTY6 PWMDTY6 PWMPER PWMPER6 Period = PWMPER6* 2 PWM center aligned output waveform 4.Write an instruction sequence to generate a 1.5 KHz square wave with 40% duty cycle from PWM6 output pin and use center-aligned mode. Assume that the E clock frequency is 24 MHz, and the prescale factor is 32. Assume it is 8-bit mode, stop PWM in wait and freeze mode. a) Set PWM6 output to start with low level. b) Set PWM6 output to start with high level. a): Set PWM6 output to start with low level. movb# PWMCLK movb#S PWMPRCLK movb#__, PWMPOL movb# PWMCAE movb#$ , PWMCTL movb# PWMPER6 movb# PWNDTY6 movb# PWMCNT 6 bset PWME S b): Set PWM6 output to start with high level. [PWMPER6] =150; (PWMDTY61=150x409=60 movb# PWMCLK movb#S PWMPRCLK movb#_ PWMPOL movb#__, PWMCAE movb# $ PWMCTL movb# PWMPER6 movb# PWNDTY6 movb #__ PWMCNT 6 bset PWME, S a) PPOL6 - 0 b) PPOL6 = 1 PWMDTY6 PWMDTY6 PWMPER PWMPER6 Period = PWMPER6* 2 PWM center aligned output waveform

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Studies Of Company Records (RLE Accounting)1830-1974

Authors: J. R. Edwards

1st Edition

1138983306, 9781138983304

More Books

Students also viewed these Accounting questions