switch & led using tms320c6745 dsp
TRANSCRIPT
![Page 1: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/1.jpg)
LED & Switch Interfaceusing TMS320C6745
https://www.pantechsolutions.net/products/dsp-dsc-boards/tms320c6745-tyro
![Page 2: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/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: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/3.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
Led Connection to C6745
![Page 4: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/4.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
GPIO Registers
![Page 5: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/5.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
GPIO Address
![Page 6: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/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: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/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: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/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: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/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: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/10.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
DIP SWITCH INTERFACE
![Page 11: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/11.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
GPIO Input Data Registers (IN_DATAn)
![Page 12: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/12.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 13: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/13.jpg)
Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd.
?
![Page 14: Switch & LED using TMS320C6745 DSP](https://reader030.vdocuments.mx/reader030/viewer/2022012320/55a6a96c1a28abf16a8b468d/html5/thumbnails/14.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