02.LED 8개 0.1초 마다 깜빡이기

안양진·2023년 2월 1일

DSP

목록 보기
2/3
post-thumbnail
#include "DSP28x_Project.h"

void main(void)
{
    InitSysCtrl();

    EALLOW;
    GpioCtrlRegs.GPCMUX1.all=0x00000000;
    GpioCtrlRegs.GPCDIR.all=0x000000FF;
    GpioCtrlRegs.GPCPUD.all=0x00000000;
    EDIS;

    while(1)
    {
         GpioDataRegs.GPCCLEAR.all=0x00ffffff;// turns on the led;(1 means  turn on,0 means turns off)
         DELAY_US(100000); //turns off after a delay of 1000000 microseconds
         GpioDataRegs.GPCSET.all=0x00ffffff; // turns off the led (1 means  turn off,0 means turns on)
         DELAY_US(100000); //turns on after a delay of 1000000 microseconds
    }
}

연습사마 테스트를 위해 기능이 가장적은 GPIO C 부분의 65~71번 핀을 사용하였다

--이하 추가 예정--

0개의 댓글