Home > other >  DSP dual dynamic digital tube display
DSP dual dynamic digital tube display

Time:09-17

Dynamic display of requirements: from 1 to 100
Phenomenon: the dynamic display of digital tube only two zero
# include "DSP280x_Device. H"
# include "DSP280x_Examples. H"
Char table []={x5b x3f 0, 0 x06, 0, 0, x4f x66 0, 0 x6d, 0 x7d, 0 x07, 0 x7f, 0 x6f};
Int main (void)
{
InitSysCtrl ();
InitPieCtrl ();
EALLOW;
GpioCtrlRegs. GPAMUX1. All=0 x0000;
GpioCtrlRegs. GPADIR. All=0 x000fffff;
GpioCtrlRegs. GPAPUD. All=0 x00000000;
GpioCtrlRegs. GPBMUX1. Bit. GPIO32=0;
GpioCtrlRegs. GPBDIR. Bit. GPIO32=0;
GpioCtrlRegs. GPBPUD. Bit. GPIO32=0;
GpioCtrlRegs. GPBQSEL1. Bit. GPIO32=0 x00000002;
GpioCtrlRegs. GPBCTRL. Bit. QUALPRD0=0 x00000001;
EDIS;
int count=0;
While (1)
{
GpioDataRegs. GPADAT. All=table [10] count % | 0 x00001000;
DELAY_US (10000);
GpioDataRegs. GPADAT. All=table [10] count/| 0 x00010000;
DELAY_US (10000);
If (GpioDataRegs GPBDAT. Bit. GPIO32==0)
count++;
If (count==100)
Count=0;
}
}

CodePudding user response:

GPIO32 is an external signal input? Output a low level can Count Count plus one
  • Related