Chapter
Chapter
//
//
//
//
//
//
//
//
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 :
Now here first we have included DSP28x_Project.h Click on it Press F3 to see files Which
includes in it are F2802x_Device.h and f2802x_examples.h..
#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.
Now We have to Access GPIO for it first we have to access GpioCtrlRegs in which select
GPAMUX1 and set GPIO 0 and 2 as general purpose GPIO.
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.