Led blinking using TMS320C6745
-
Upload
pantech-prolabs-india-pvt-ltd -
Category
Education
-
view
788 -
download
6
Transcript of Led blinking using TMS320C6745
![Page 1: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/1.jpg)
Blinking LEDUsingTMS320C6745
https://www.pantechsolutions.net/products/dsp-dsc-boards/tms320c6745-tyro
![Page 2: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/2.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Features of GPIO
The GPIO peripheral consists of the following features
• Separate input/output registers
• All GPIO signals can be used as interrupt sources
• All GPIO signals can be used to generate events to the EDMA.
![Page 3: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/3.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Led Connection to C6745
![Page 4: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/4.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
GPIO Registers
![Page 5: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/5.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
GPIO Address
![Page 6: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/6.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
GPIO Direction Registers (DIRn)
By default, all the GPIO pins are configured as inputs(bit value = 1)
1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0F 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1F F F F
0xF000FFFF
![Page 7: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/7.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
GPIO Output Data Registers (OUT_DATAn)
0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 10 F F F
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0
0x0FFF00000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0
0x00000000
![Page 8: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/8.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
STEPS FOR LED BLINKING
Declare two pointer variables for GPIO Direction register and GPIO Data Register
Set Byte Address for GPIO Direction register and GPIO Data Register
Configure GPIO as output in GPIO Direction Register
Configure Required Blinking data in GPIO Data Register
![Page 9: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/9.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Set Base Address
• gpio_dir01 = (Uint32 *)0x01E26010;• gpio_out_data01 = (Uint32 *)0x01E26014;
Configure Direction register as Output*gpio_dir01 = 0xF000FFFF;
Configure Data register as Output
*gpio_out_data01 = 0x0FFF0000;
![Page 10: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/10.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Program#define Uint32 unsigned int
void DelayMs(Uint32 Ms);
void main()
{
Uint32 *gpio_dir01,*gpio_out_data01;
gpio_dir01 = (Uint32 *)0x01E26010;
gpio_out_data01 = (Uint32 *)0x01E26014;
*gpio_dir01 = 0xF000FFFF;
while(1)
{
*gpio_out_data01 = 0x0FFF0000;
DelayMs(100);
*gpio_out_data01 = 0x00000000;
DelayMs(100);
}
}
void DelayMs(Uint32 Ms)
{
Uint32 i;
while(Ms>0)
{
for(i=0;i<300000;i++);
Ms--;
}
}
![Page 11: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/11.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
DIP SWITCH INTERFACE
![Page 12: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/12.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
GPIO Input Data Registers (IN_DATAn)
![Page 13: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/13.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Program#define Uint32 unsigned int
Uint32 Value,i;
void DelayMs(Uint32 Ms);
void main()
{
Uint32 *gpio_in_data01,*gpio_out_data01,*gpio_dir01;
gpio_in_data01 = (Uint32 *)0x01E26020;
gpio_dir01 = (Uint32 *)0x01E26010;
gpio_out_data01 = (Uint32 *)0x01E26014;
*gpio_dir01 = 0xF000FFFF;
while(1)
{
Value = *gpio_in_data01;
*gpio_out_data01 = Value<<16;
DelayMs(100);
}
}
void DelayMs(Uint32 Ms)
{
Uint32 i;
while(Ms>0)
{
for(i=0;i<30000;i++);
Ms--;
}
}
![Page 14: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/14.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
?
![Page 15: Led blinking using TMS320C6745](https://reader035.fdocuments.in/reader035/viewer/2022082203/55a6a8b01a28abfb6a8b45bc/html5/thumbnails/15.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
For more details
– www.pantechsolutions.net
– http://www.slideshare.net/pantechsolutions
– http://www.scribd.com/pantechsolutions
– http://www.youtube.com/pantechsolutions