ECE 383 - Microcomputers
Fall 2009 – Homework 4 Solutions
[1]
Given the following codes, what will the resulting values be at the break points for the memories and
registers? (All the breakpoints are independent with each other)
#include ECE383_Dragon12plus_register.inc
ORG $1000
DIGIT_PATTERN DC.B $3F, $06, $5B, $4F, $66, $6D, $7D, $07,
$7F, $6F, $77, $7C, $39, $5E, $79, $71
MAX_DUTY EQU 99
MIN_DUTY EQU 1
$3E4C
$30
$0F
$FF
$00
$00
$01
0
1
0
0
1
0
1
1
DDRA
x
1
0
1
x
1
1
1
0
0
1
1
0
0
1
0
PWMSCLB
PWMSCLA
PWMPRCLK
DDRP
DDRJ
DDRH
DDRB
ORG $2000
MAIN:
BSET PUCR, PUCR_PUPAE
MOVW #ISR1, UserPortH
BCLR PPSH, #$0F
BSET PIFH, #$0F
BSET PIEH, #$0F
CLI
MOVB #$0F, DDRA
MOVB #$FF, DDRB
MOVB #0, DDRH
BSET DDRP, #%00000001
BSET PORTP, #%00000001
BSET PWME, #%10000000
BSET PWMPOL, #%10000000
BSET PWMCLK, #%10000000
MOVB #$57, PWMPRCLK
MOVB #50, PWMSCLA
MOVB #75, PWMSCLB
MOVB #100, PWMPER7
MOVB #50, PWMDTY7
[A BREAK POINT HERE, FILL IN THE VALUES
FOR THE REGISTERS ON THE LEFT ]
LOOP1:BSET PORTA, #%00001111
BCLR PORTA, #%00000001
NOP
BRSET PORTA, #%00110000, *
LDAA PORTA
COMA
CMPA #$11
BNE QUO
This
preview
has intentionally blurred sections.
Sign up to view the full version.
PORTA
PWMDTY7
X
Y
A
$EE
$32
$0005
$0000
$3F
REM:
LDAB PWMDTY7
LDAA #0
LDX #10
IDIV
TFR D, Y
LDAA DIGIT_PATTERN, Y

This is the end of the preview.
Sign up
to
access the rest of the document.
- Spring '08
- Staff
- Pulse-width modulation, BSET PORTP, BSET BSET BSET
-
Click to edit the document details