WR Home      Topic Home      Chapter:  1  2  3  4 
<Previous Next>

Chapter 04

Developing a Utility Library for the Propeller PCB

Page 3

Questions
onSequence is a 16-bit word, which defines which LEDs will glow
onSeq

Q1 a) What will happen if the following byte-sequence is sent to the ports?
PORTC=0X22; // 0010 0010
PORTB=0X2a; // 0010 1010
PORTD=0Xa2; // 1010 0010
Ans: LEDs will glow in color(s)

Q1 b) Assume that you have a 16-bit variable unsigned int onSequence. The bit interpretation is shown above. What should be the value of the variable onSequence, to represent the above PORT information ?
Ans:

Q2 a) What will happen if the following byte-sequence is sent to the ports?
PORTC=0X2f // 0010 1111
PORTB=0X3f // 0011 1111
PORTD=0Xf3 // 1111 0011
Ans: LEDs will glow in color(s)

Q2 b) Assume that you have a 16-bit variable unsigned int onSequence. The bit interpretation is shown above. What should be the value of the variable onSequence, to represent the above PORT information ?
Ans:

onSequence is a 16-bit word, which defines which LEDs will glow
onSeq

Q3 a) What will happen if the following byte-sequence is sent to the ports?
PORTC=0X3f // 0011 1111
PORTB=0X3f // 0011 1111
PORTD=0Xf3 // 1111 0011
Ans: LEDs will glow in color(s)

Q3 b) Assume that you have a 16-bit variable unsigned int onSequence. The bit interpretation is shown above. What should be the value of the variable onSequence, to represent the above PORT information ?
Ans:

Q4 a) What will happen if the following byte-sequence is sent to the ports?
PORTC=0X35 // 0011 0101
PORTB=0X15 // 0001 0101
PORTD=0X51 // 0101 0001
Ans: LEDs will glow in color(s)

Q4 b) Assume that you have a 16-bit variable unsigned int onSequence. The bit interpretation is shown above. What should be the value of the variable onSequence, to represent the above PORT information ?
Ans:



WR Home      Topic Home      Chapter:  1  2  3  4 
<Previous Next>