Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Micro Controller Systems 4

MCS400S
Assessment 1
23 March 2012
60 Minutes
You are to configure a dsPIC33 to run at 40MIPS using an external 20MHZ crystal
oscillator. Clock switching is not required. If a function is not mentioned here, you may
assume it is not being used. Determine the binary values of the following registers:
1.1 OSCCON = ______________
1.2 CLKDIV = ______________
1.3 PLLFBD = ______________
1.4 FOSCSEL = ______________
1.5 FOSC = ______________

In addition to the above you are also to configure Timer 2 as a timebase in Timer
Mode. The internal clock of the dsPIC must be used and prescaled by a factor 1:8.
Determine the binary values of the following registers:
2.1 T2CON = _______________
2.2 If the timer has a PR1 value of 12, what will happen after the timer reaches a
count of 11?
_____________________________________________________________
_____________________________________________________________
2.3 Which Timer Mode should be used when you want to make a frequency counter
using a dsPIC?
_____________________________________________________________

NAME and STUDENT
NUMBER
You need to tie the OC1 module to Timer 2. OC1 must operate in Toggle mode. OC1
must toggle every time Timer 2 reaches a count of 6. The initial OC1 pin state is high.
Determine the binary values of the following registers:
3.1 OC1CON = _______________
3.2 Which register can be used to adjust the OC1 interrupt priority level?
______________________________________________________
Finally you need to configure the SPI1 interface to operate in Master mode, using a data
clock of 1MHz. Communication is word-wide. Input data must be sampled at the end of
the data output time. You may make any further valid assumptions you wish. Determine
the binary values of the following registers:
4.1 SPI1STAT = _______________
4.2 SPI1CON1 = _______________
4.3 SPI1CON2 = _______________
4.4 How do you start an SPI data transfer?
________________________________________________________________

14 x 2 marks = 28









END

You might also like