编译环境为CCS5.5,仿真器为XDS100V1,仿真器连接没问题,
调试时出现:Texas Instruments XDS100v1 USB Emulator/C28xx (Suspended),这种显示应该为仿真器连接成功。
程序为:
#include "DSP281x_Device.h"
#include "DSP281x_Examples.h"
#include "DSP281x_Gpio.h"
void main(void)
{
InitSysCtrl();
EALLOW;
// SysCtrlRegs.HISPCP.all=ADC_MODCLK;
InitGpio();
EDIS;
DINT;
InitPieCtrl();
IER=0x0000;
IFR=0x0000;
InitPieVectTable();
ERTM;
GpioDataRegs.GPADAT.bit.GPIOA3=0;
if(GpioDataRegs.GPBDAT.bit.GPIOB12==1)
GpioDataRegs.GPBDAT.all=0x135;
if(GpioDataRegs.GPBDAT.bit.GPIOB12==0)
GpioDataRegs.GPBDAT.bit.GPIOB8=0;
}
DSP281x_Gpio.c的文件为:
void InitGpio(void)
{
// Set GPIO A port pins,AL(Bits 7:0)(input)-AH(Bits 15:8) (output) 8bits
// Input Qualifier =0, none
EALLOW;
GpioMuxRegs.GPAMUX.bit.CAP3QI1_GPIOA10=0;
GpioMuxRegs.GPAMUX.bit.TDIRA_GPIOA11=0;
GpioMuxRegs.GPAMUX.bit.TCLKINA_GPIOA12=0;
GpioMuxRegs.GPAMUX.bit.PWM4_GPIOA3=0;
GpioMuxRegs.GPADIR.bit.GPIOA10=0; // upper byte as output/low byte as input
GpioMuxRegs.GPADIR.bit.GPIOA11=0;
GpioMuxRegs.GPADIR.bit.GPIOA12=0;
GpioMuxRegs.GPADIR.bit.GPIOA3=1;
GpioMuxRegs.GPAQUAL.all=0x0000; // Input qualifier disabled
// Set GPIO B port pins, configured as EVB signals
// Input Qualifier =0, none
// Set bits to 1 to configure peripherals signals on the pins
GpioMuxRegs.GPBMUX.all=0x0000;
GpioMuxRegs.GPBDIR.all=0xFFF;
GpioMuxRegs.GPBQUAL.all=0x0000; // Input qualifier disabled
EDIS;
}
程序在单步执行GpioDataRegs.GPADAT.bit.GPIOA3=0;后,ccs上显示GPIO为的值为0,但万用表测量GPIO的电平为3.3v,全速运行程序时测得GPIOA3的电平为3.3v,该如何解决这个问题。
Eason Wang:
Hi, C2000 有专门论坛讨论,帮你转过去