Write A Program of C2000 (TMS320F28027) Launchpad Evaluation Kit To GPIO Toggling On GPIO Port 0,1,2 and 3 To Blink LED
Write A Program of C2000 (TMS320F28027) Launchpad Evaluation Kit To GPIO Toggling On GPIO Port 0,1,2 and 3 To Blink LED
//
//
//
//
//
//
//
//
0=GPIO, 1=EPWM2A,
1=OUTput, 0=INput
0=GPIO, 1=EPWM2A,
1=OUTput, 0=INput
0=GPIO, 1=EPWM2A,
1=OUTput, 0=INput
0=GPIO, 1=EPWM2A,
1=OUTput, 0=INput
2=Resv, 3=Resv
2=Resv, 3=Resv
2=Resv, 3=Resv
2=Resv, 3=Resv
= 1;
= 1;
= 1;
= 1;
GUIDE :
In this we can see declaration of PLL clock value and divide select
value.
#define DSP28_DIVSEL 2 // Enable /2 for SYSCLKOUT
For DIVSEL 0 and 1 SYSCLKOUT is /4 for DIVSEL 2 is /2 and for DIVSEL 3
is /1.
#define DSP28_PLLCR 12
// for 60 MHz devices [60 MHz = (10MHz * 12)/2]
In declaration of main()
Here the register which we are going to access are EALLOW Protected, so for
getting access we have to give EALLOW at beginning.
Then we have to give direction as Output to get LED Blink on that port
GpioCtrlRegs.GPADIR.bit.GPIO0 = 1; By using this we have given direction as
output.
The use infinite while Loop for LED blink on GPIO port 0 and 2.
Here we have set toggle bit as 1 of GPIO 2 then some delay then set toggle
bit as 1 of GPIO 0 then delay.
NOTE :
Delay_US function will not perform if we have not disable the
watchdog.
Here We have to initialize all GPIO and turn it off by
GpioDataRegs.GPASET.bit.GPIO0 =1; at starting so it we not blink
during the run.