TR28335 SW 회로도

 

 

<<스위치 SW1, SW2>>

 

 

<<LED TR28335>>

 

 

기능

 1. SW1 스위치 선택시 ON/OFF 점멸.

 2. SW2 스위치 선택시 LED 쉬프트.

 

 

 

 

#include "DSP28x_Project.h"      

#define usec_delay 100000

Uint16 SW1, SW2;

void main(void)
{
 DINT;
 InitSysCtrl();
 EALLOW;
 GpioCtrlRegs.GPAMUX1.bit.GPIO12 = 0;
 GpioCtrlRegs.GPAMUX2.bit.GPIO27 = 0;
 GpioCtrlRegs.GPADIR.bit.GPIO12 = 0; 
 GpioCtrlRegs.GPADIR.bit.GPIO27 = 0; 
 GpioCtrlRegs.GPAMUX1.all = 0;
  GpioCtrlRegs.GPADIR.all = 0x00003F;
 EDIS;
 
 GpioDataRegs.GPADAT.all = 0x00003F;

 EINT;   // Enable Global interrupt INTM
 ERTM;   // Enable Global realtime interrupt DBGM

 for(;;)
 { 
  SW1 = GpioDataRegs.GPADAT.bit.GPIO12;
  SW2 = GpioDataRegs.GPADAT.bit.GPIO27;
  
  if(SW1 == 1)
  {
   GpioDataRegs.GPATOGGLE.bit.GPIO0 = 1;
   GpioDataRegs.GPATOGGLE.bit.GPIO1 = 1;
   GpioDataRegs.GPATOGGLE.bit.GPIO2 = 1;
   GpioDataRegs.GPATOGGLE.bit.GPIO3 = 1;
   GpioDataRegs.GPATOGGLE.bit.GPIO4 = 1;
   GpioDataRegs.GPATOGGLE.bit.GPIO5 = 1;
   DELAY_US(usec_delay); 
  }
  
  if(SW2 == 1)
  {  
   GpioDataRegs.GPATOGGLE.bit.GPIO0 = 1;
   DELAY_US(usec_delay);
   GpioDataRegs.GPATOGGLE.bit.GPIO1 = 1;
   DELAY_US(usec_delay);
   GpioDataRegs.GPATOGGLE.bit.GPIO2 = 1;
   DELAY_US(usec_delay);
   GpioDataRegs.GPATOGGLE.bit.GPIO3 = 1;
   DELAY_US(usec_delay);
   GpioDataRegs.GPATOGGLE.bit.GPIO4 = 1;
   DELAY_US(usec_delay);
   GpioDataRegs.GPATOGGLE.bit.GPIO5 = 1;
   DELAY_US(usec_delay);
  } 
 }
}

 

 

 

 

 

 

'DSP(28335) > 기초다치기..' 카테고리의 다른 글

TR28335 Volt_ADC  (0) 2014.07.09
TR28335 SW1, SW2 LED 기능  (0) 2014.07.08
LED ON, OFF 및 Shift  (0) 2014.07.05
Code Composer Studio4 설치방법  (0) 2014.07.02
TR28335 트레이닝 키트  (0) 2014.07.01
DSP320F28335를 이용한 GPS 파싱.  (0) 2013.07.27
Posted by 숭덕이