ECPC Assignment 2 - With Ans
ECPC Assignment 2 - With Ans
Date: Time:
Software:
280ns (page 7)
15. How many DAC are there? What is the bit size?
3 (page 1)
16. How many PWM channels are available?
24 (page 1)
17. How many UART, SPI, I2C, CAN and USB are available?
4,3,2,2,1 (Page 1)
18. Which connector and the pin no XCLKOUT is available on the Launch Pad?
J9 pin 37 (GPIO73), Launch Pad user manual, p.19 Fig.10
19. Name the various registers of Watch dog timer(WDT) Module?
p.220, TRM
20. Which register and bits to be made zero or one to disable the WDT?
p.224, TRM
Laboratory work
Part-I
1. Down load TMS320F28379D data sheet, Technical Reference Manual, Launch pad user manual
etc from following using following links: -
CCS down load link:
o https://software-dl.ti.com/ccs/esd/documents/ccs_downloads.html
Data sheet:
o https://www.ti.com/lit/ds/sprs880n/sprs880n.pdf?ts=1611811065345&ref_url=https
%253A%252F%252Fwww.ti.com%252Ftool%252FLAUNCHXL-F28379D
Launch pad user guide:
o https://www.ti.com/lit/ug/sprui77c/sprui77c.pdf?ts=1611749004806&ref_url=https
%253A%252F%252Fwww.ti.com%252Fsitesearch%252Fdocs%252Funiversalsearch.tsp
%253FsearchTerm%253DLAUNCHXL%2BF28379D
USN
Part-II
Setting up the system clock : Find the page where a step by step procedure is given in the TRM to set
[SPRUHM8H] to set up the clock. Configure the bits of relevant registers to implement the steps outline
below. Use the format Family_name.Register_name.bit_name = X. The clock configuration registers
family name is ClkCfgRegs. We want to set the system clock to 120MHz. If the register is software
protected, write it between these two instructions, EALLOW and EDIS.
Solution:
#include "F28x_Project.h"
int i;
void main()
{
EALLOW;
ClkCfgRegs.CLKSRCCTL1.bit.OSCCLKSRCSEL=0; // primary oscillator select
ClkCfgRegs.SYSPLLCTL1.bit.PLLCLKEN=0; // bypass pll
for(i=0;i<120;i++); //wait for 120 oscillator cycle, this is mntnd in silicon errata documrnt
ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV=0;
for(i=0;i<=4;i++) // lock PLL 5 times
{
ClkCfgRegs.SYSPLLCTL1.bit.PLLEN= 0; // lock PLL
ClkCfgRegs.SYSPLLMULT.bit.IMULT=12; // 120Mhz PLL raw clock
ClkCfgRegs.SYSPLLMULT.bit.FMULT=0; //0.0 fractional mult
while(ClkCfgRegs.SYSPLLSTS.bit.LOCKS != 1);
}
ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV=1; //Desired+1
ClkCfgRegs.SYSPLLCTL1.bit.PLLCLKEN=1; // switch to PLL
ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV=0; //divides by 1, 162Mhz clock
ClkCfgRegs.LOSPCP.bit.LSPCLKDIV=1; // 80Mhz LSP clock
EDIS;
}