You are on page 1of 9

DSP HOW-TO GUIDE

Interfacing LEDs With


TMS320F2812 DSP

Contents at a Glance
TMS320F2812 EVALUATION BOARD .......................................... 3
LED ........................................................................................... 3
Interfacing LED with TMS320F2812 ........................................... 3
Circuit Diagram to Interface LED with TMS320F2812 ................. 4
C Program to On/OFF LED using TMS320F2812 KIT .................... 5

Join the Technical Community Today!


http://www.pantechsolutions.net

TMS320F2812 EVALUATION BOARD


The TMS320F2812 EVALUATION BOARD is specially
desgined for developers in dsp field as well as beginners. The
F2812 kit is designed in such way that all the possible features of
the DSP will be easily used by the everyone.
The kit supports in Code Composer Studio3.1 and later, with
XDS100 v1 USB Emulator which is done USB port.
LED
A Light Emitting Diodes (LEDs) are the most commonly used
components, usually for displaying pins digital states.
Interfacing LED with TMS320F2812
The TMS320F2812 EVB board has Eight LED Connected with Dsp
general purpose I/O pins. The Anode of each LED connects to
ground and Cathode of each LED connects port via 220 resistor.
To light an individual LED, drive the associated port signal to High.

Join the Technical Community Today!


http://www.pantechsolutions.net

Circuit Diagram to Interface LED with TMS320F2812

In TMS320F2812 KIT., F2812 processor port b is connected to


the led(portb0, portb1,.........portb7).

Join the Technical Community Today!


http://www.pantechsolutions.net

C Program to On/OFF LED using TMS320F2812 KIT


******************************************************
Title: Program to Blink LEDs (main.c)
******************************************************
#include "DSP281x_Device.h"
#include <stdio.h>
void Delay_1ms(long);
void main(void)
{
EALLOW;
SysCtrlRegs.WDCR= 0x0068;

// Setup the watchdog

// 0x0068 to disable the Watchdog , Prescaler = 1


// 0x00AF to NOT disable the Watchdog, Prescaler = 64
SysCtrlRegs.SCSR = 0;
RESET

// Watchdog generates a

Join the Technical Community Today!


http://www.pantechsolutions.net

SysCtrlRegs.PLLCR.bit.DIV = 10;
multiply by 5

// Setup the Clock PLL to

SysCtrlRegs.HISPCP.all = 0x1;
Prescaler to divide by 2

// Setup Highspeed Clock

SysCtrlRegs.LOSPCP.all = 0x2;
Prescaler to divide by 4

// Setup Lowspeed CLock

GpioMuxRegs.GPAMUX.all = 0x0; // all GPIO port Pin's to I/O


GpioMuxRegs.GPBMUX.all = 0x0;
GpioMuxRegs.GPADIR.all = 0x0; // GPIO PORT as input
GpioMuxRegs.GPBDIR.all = 0x00FF;
B7-B0 output

// GPIO Port B15-B8 input ,

EDIS;
while(1)
{
GpioDataRegs.GPBDAT.all = 0xFF;
Delay_1ms(1000);
second delay

//value 1000 for one

GpioDataRegs.GPBDAT.all = 0x0;
Join the Technical Community Today!
http://www.pantechsolutions.net

Delay_1ms(1000);
second delay

//value 1000 for one

}
}
void Delay_1ms(long end)
{
long i;
for (i = 0; i <(9000 * end); i++);
}

Join the Technical Community Today!


http://www.pantechsolutions.net

Did you enjoy the read?


Pantech solutions creates information packed technical
documents like this one every month. And our website is a rich
and trusted resource used by a vibrant online community of
more than 1,00,000 members from organization of all shapes and
sizes.

Join the Technical Community Today!


http://www.pantechsolutions.net

What do we sell?
Our products range from Various Microcontroller
development boards, DSP Boards, FPGA/CPLD boards,
Communication Kits, Power electronics, Basic electronics,
Robotics, Sensors, Electronic components and much more . Our
goal is to make finding the parts and information you need easier
and affordable so you can create awesome projects and training
from Basic to Cutting edge technology.

Join the Technical Community Today!


http://www.pantechsolutions.net