楼主你好,我用了一下你的程序,不会显示,很苦恼
#include "DSP28x_Project.h" // Device Headerfile and Examples Include File
#define SID_on GpioDataRegs.GPASET.bit.GPIO19 //SID
#define SID_off GpioDataRegs.GPACLEAR.bit.GPIO19 //
#define SCLK_on GpioDataRegs.GPASET.bit.GPIO12 //SCLK
#define SCLK_off GpioDataRegs.GPACLEAR.bit.GPIO12 //
unsigned char table1[]={"二零一三"};
unsigned char table2[]={"EE更给力"};
unsigned char i;
void Gpio_Init(void);
void LCD_Init(void);
void write_data(unsigned char data);
void write_com(unsigned char com);
void Sendbyte(unsigned char data1);
void main(void)
{
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2802x_SysCtrl.c file.
InitSysCtrl();
// Step 2. Initalize GPIO:
// This example function is found in the DSP2802x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// InitGpio(); // Skipped for this example
// For this example use the following configuration:
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT; //屏蔽中断
// Initialize PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the DSP2802x_PieCtrl.c file.
InitPieCtrl(); //初始化中断控制寄存器
// Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000; //中断使能寄存器,某一位是1表示使能中断
IFR = 0x0000; //中断标志寄存器,某一位是1表示产生中断标志
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).//中断服务程序是ISR
// This will populate the entire table, even if the interrupt
// is not used in this example. This is useful for debug purposes.
// The shell ISR routines are found in DSP2802x_DefaultIsr.c.
// This function is found in DSP2802x_PieVect.c.
InitPieVectTable();//初始化中断向量表,把向量表复制到指定RAM段,防止非法中断的产生
// Step 4. Initialize all the Device Peripherals:
// This function is found in DSP2802x_InitPeripherals.c
// InitPeripherals(); // Not required for this example
// Step 5. User specific code:
MemCopy(&RamfuncsLoadStart,&RamfuncsLoadEnd,&RamfuncsRunStart);
Gpio_Init();
LCD_Init();
//************************The first line**********************//
write_com(0x80);
write_data(0x03);
write_data(0x03);
while(1);
}
void Gpio_Init(void)
{
EALLOW;
//GpioCtrlRegs.GPAPUD.all=0xff;
GpioCtrlRegs.GPAMUX1.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPAMUX2.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPBMUX1.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPADIR.all = 0xFFFFFFFF; // All outputs
GpioCtrlRegs.GPBDIR.all = 0x0000000F; // All outputs
EDIS;
}
//******************Datas sending function*************//
void Sendbyte(unsigned char data1)
{
unsigned int i;
for(i=0; i
详情回复
发表于 2013-7-16 10:37
楼主你好,我用了一下你的程序,不会显示,很苦恼
#include "DSP28x_Project.h" // Device Headerfile and Examples Include File
#define SID_on GpioDataRegs.GPASET.bit.GPIO19 //SID
#define SID_off GpioDataRegs.GPACLEAR.bit.GPIO19 //
#define SCLK_on GpioDataRegs.GPASET.bit.GPIO12 //SCLK
#define SCLK_off GpioDataRegs.GPACLEAR.bit.GPIO12 //
unsigned char table1[]={"二零一三"};
unsigned char table2[]={"EE更给力"};
unsigned char i;
void Gpio_Init(void);
void LCD_Init(void);
void write_data(unsigned char data);
void write_com(unsigned char com);
void Sendbyte(unsigned char data1);
void main(void)
{
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2802x_SysCtrl.c file.
InitSysCtrl();
// Step 2. Initalize GPIO:
// This example function is found in the DSP2802x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// InitGpio(); // Skipped for this example
// For this example use the following configuration:
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT; //屏蔽中断
// Initialize PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the DSP2802x_PieCtrl.c file.
InitPieCtrl(); //初始化中断控制寄存器
// Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000; //中断使能寄存器,某一位是1表示使能中断
IFR = 0x0000; //中断标志寄存器,某一位是1表示产生中断标志
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).//中断服务程序是ISR
// This will populate the entire table, even if the interrupt
// is not used in this example. This is useful for debug purposes.
// The shell ISR routines are found in DSP2802x_DefaultIsr.c.
// This function is found in DSP2802x_PieVect.c.
InitPieVectTable();//初始化中断向量表,把向量表复制到指定RAM段,防止非法中断的产生
// Step 4. Initialize all the Device Peripherals:
// This function is found in DSP2802x_InitPeripherals.c
// InitPeripherals(); // Not required for this example
// Step 5. User specific code:
MemCopy(&RamfuncsLoadStart,&RamfuncsLoadEnd,&RamfuncsRunStart);
Gpio_Init();
LCD_Init();
//************************The first line**********************//
write_com(0x80);
write_data(0x03);
write_data(0x03);
while(1);
}
void Gpio_Init(void)
{
EALLOW;
//GpioCtrlRegs.GPAPUD.all=0xff;
GpioCtrlRegs.GPAMUX1.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPAMUX2.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPBMUX1.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPADIR.all = 0xFFFFFFFF; // All outputs
GpioCtrlRegs.GPBDIR.all = 0x0000000F; // All outputs
EDIS;
}
//=========================================================================
// No more.
//=========================================================================