Answered step by step
Verified Expert Solution
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
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 waveformStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started