4818|5

3

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

刚学DSP,用F28335的一块开发板烧程序时,程序编译完成后,下程序是出现图中的报错... [复制链接]

  1. #include "DSP2833x_Device.h"     // DSP2833x Headerfile Include File
  2. #include "DSP2833x_Examples.h"   // DSP2833x Examples Include File

  3. /****************端口宏定义*****************/
  4. #define S1 GpioDataRegs.GPADAT.bit.GPIO12


  5. /****************常量宏定义*****************/

  6. /***************全局变量定义****************/
  7. Uint32 temp;
  8. Uint32 direction;

  9. /****************函数声明*******************/
  10. void Gpio_select(void); //gpio端口配置子程序
  11. void delay_loop(void);
  12. void Scan_Key(void);

  13. void main(void)
  14. {

  15. // Step 1. Initialize System Control:
  16. // PLL, WatchDog, enable Peripheral Clocks
  17. // This example function is found in the DSP2833x_SysCtrl.c file.
  18.    InitSysCtrl();
  19.    
  20. // Step 2. Initalize GPIO:
  21. // This example function is found in the DSP2833x_Gpio.c file and
  22. // illustrates how to set the GPIO to it's default state.
  23. // InitGpio();  // Skipped for this example

  24. // For this example use the following configuration:
  25.    Gpio_select();         

  26. // Step 3. Clear all interrupts and initialize PIE vector table:
  27. // Disable CPU interrupts
  28.    DINT;

  29. // Initialize PIE control registers to their default state.
  30. // The default state is all PIE interrupts disabled and flags
  31. // are cleared.  
  32. // This function is found in the DSP2833x_PieCtrl.c file.
  33.    InitPieCtrl();

  34. // Disable CPU interrupts and clear all CPU interrupt flags:
  35.    IER = 0x0000;
  36.    IFR = 0x0000;

  37. // Initialize the PIE vector table with pointers to the shell Interrupt
  38. // Service Routines (ISR).  
  39. // This will populate the entire table, even if the interrupt
  40. // is not used in this example.  This is useful for debug purposes.
  41. // The shell ISR routines are found in DSP2833x_DefaultIsr.c.
  42. // This function is found in DSP2833x_PieVect.c.
  43.    InitPieVectTable();

  44.         
  45. // Step 4. Initialize all the Device Peripherals:
  46. // This function is found in DSP2833x_InitPeripherals.c
  47. // InitPeripherals(); // Not required for this example
  48.         
  49. // Step 5. User specific code:
  50.    GpioDataRegs.GPBDAT.all    =0x30000000;//GPIO60,61,64,65,66,67,68输出清1,使LED1灯灭
  51.    GpioDataRegs.GPCDAT.all    =0x0000001f;
  52.    direction=0;
  53.    for(;;)
  54.    {
  55.     unsigned int i;
  56.         if(direction%2!=0)//控制流水灯的方向
  57.                 temp=0x10000000;
  58.         else
  59.                 temp=0x20000000;


  60.         while(temp!=0x40000000&&temp!=0x08000000)//轮流点亮GPIO60,61;
  61.         {
  62.                 //delay_loop();
  63.                 GpioDataRegs.GPBCLEAR.all |=temp;
  64.         delay_loop();


  65.                 GpioDataRegs.GPBSET.all |=temp;
  66.                 if(direction%2!=0)//控制流水灯的方向
  67.                 temp<<=1;
  68.                 else
  69.                         temp>>=1;
  70.         
  71.         }
  72.         if(temp==0x40000000)//根据temp值选择GPIO64-GPIO67是从64开始还是从67开始点亮LED
  73.         temp=0x00000001;
  74.         else
  75.                 temp=0x00000010;
  76.         while(temp!=0x00000020&&temp!=0x00000000)//轮流点亮GPIO64-GPIO67;
  77.         {
  78.         //delay_loop();
  79.                         GpioDataRegs.GPCCLEAR.all |=temp;
  80.         delay_loop();

  81.                

  82.                 GpioDataRegs.GPCSET.all |=temp;

  83.                 if(direction%2!=0)//控制流水灯的方向
  84.                                 temp<<=1;
  85.                                 else
  86.                                         temp>>=1;
  87.         
  88.         
  89.         }        
  90.    
  91.    }
  92. }         

  93. void delay_loop()
  94. {
  95.     Uint32      i;
  96.         Uint32      j;
  97.         for(i=0;i<4;i++)
  98.     for (j = 0; j < 100000; j++) {Scan_Key();}
  99. }

  100. /*------------------------------------------*/
  101. /*形式参数:void                                            */
  102. /*返回值:void                                                            */
  103. /*函数描述:扫描键值                                 */
  104. /*------------------------------------------*/
  105. void Scan_Key(void)      
  106. {
  107. Uint32 i,j;
  108.         if(S1==0)//扫描是否按键按下               
  109.         {
  110.           for(i=0;i<10000;i++);    //键盘消抖动
  111.           if(S1==0)
  112.           {
  113.       direction+=1;
  114.           for(i=0;i<32;i++)
  115.       for (j = 0; j < 100000; j++) {}

  116.           /*
  117.              if(direction%2!=0)//第一按下按键LED停止闪烁,下次按下时LED又开始闪烁
  118.          {
  119.           while(S1!=0);
  120.                  }
  121.                  */
复制代码

最新回复

错误的信息需要贴出来这样才能帮到你,看出来你的程序是流水灯网上的教程  详情 回复 发表于 2017-7-10 11:02
点赞 关注
 

回复
举报

6066

帖子

90

TA的资源

裸片初长成(初级)

沙发
 
你的程序在哪里?
 
 

回复

3

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
maylove 发表于 2016-5-6 09:34
你的程序在哪里?

程序放的路径都是对的啊,debug时候总是出错,不知道怎么调试
 
 
 

回复

3

帖子

0

TA的资源

一粒金砂(初级)

4
 
maylove 发表于 2016-5-6 09:34
你的程序在哪里?

#include "DSP2833x_Device.h"     // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h"   // DSP2833x Examples Include File

/****************端口宏定义*****************/
#define S1 GpioDataRegs.GPADAT.bit.GPIO12


/****************常量宏定义*****************/

/***************全局变量定义****************/
Uint32 temp;
Uint32 direction;

/****************函数声明*******************/
void Gpio_select(void); //gpio端口配置子程序
void delay_loop(void);
void Scan_Key(void);

void main(void)
{

// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2833x_SysCtrl.c file.
   InitSysCtrl();
   
// Step 2. Initalize GPIO:
// This example function is found in the DSP2833x_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:
   Gpio_select();          

// 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 DSP2833x_PieCtrl.c file.
   InitPieCtrl();

// Disable CPU interrupts and clear all CPU interrupt flags:
   IER = 0x0000;
   IFR = 0x0000;

// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (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 DSP2833x_DefaultIsr.c.
// This function is found in DSP2833x_PieVect.c.
   InitPieVectTable();

       
// Step 4. Initialize all the Device Peripherals:
// This function is found in DSP2833x_InitPeripherals.c
// InitPeripherals(); // Not required for this example
       
// Step 5. User specific code:
   GpioDataRegs.GPBDAT.all    =0x30000000;//GPIO60,61,64,65,66,67,68输出清1,使LED1灯灭
   GpioDataRegs.GPCDAT.all    =0x0000001f;
   direction=0;
   for(;;)
   {
    unsigned int i;
        if(direction%2!=0)//控制流水灯的方向
                temp=0x10000000;
        else
                temp=0x20000000;


        while(temp!=0x40000000&&temp!=0x08000000)//轮流点亮GPIO60,61;
        {
                //delay_loop();
                GpioDataRegs.GPBCLEAR.all |=temp;
        delay_loop();


                GpioDataRegs.GPBSET.all |=temp;
                if(direction%2!=0)//控制流水灯的方向
                temp<<=1;
                else
                        temp>>=1;
        
        }
        if(temp==0x40000000)//根据temp值选择GPIO64-GPIO67是从64开始还是从67开始点亮LED
        temp=0x00000001;
        else
                temp=0x00000010;
        while(temp!=0x00000020&&temp!=0x00000000)//轮流点亮GPIO64-GPIO67;
        {
        //delay_loop();
                        GpioDataRegs.GPCCLEAR.all |=temp;
        delay_loop();

               

                GpioDataRegs.GPCSET.all |=temp;

                if(direction%2!=0)//控制流水灯的方向
                                temp<<=1;
                                else
                                        temp>>=1;
        
       
        }       
   
   }
}        

void delay_loop()
{
    Uint32      i;
        Uint32      j;
        for(i=0;i<4;i++)
    for (j = 0; j < 100000; j++) {Scan_Key();}
}

/*------------------------------------------*/
/*形式参数:void                                            */
/*返回值:void                                                            */
/*函数描述:扫描键值                                 */
/*------------------------------------------*/
void Scan_Key(void)      
{
Uint32 i,j;
        if(S1==0)//扫描是否按键按下              
        {
          for(i=0;i<10000;i++);    //键盘消抖动
          if(S1==0)
          {
      direction+=1;
          for(i=0;i<32;i++)
      for (j = 0; j < 100000; j++) {}

          /*
             if(direction%2!=0)//第一按下按键LED停止闪烁,下次按下时LED又开始闪烁
         {
          while(S1!=0);
                 }
                 */
 
 
 

回复

2700

帖子

0

TA的资源

五彩晶圆(初级)

5
 
没错误信息啊,把错误信息,和错误信息定位的代码贴出来,你这样好尴尬
个人签名作为一个水军,就是尽量的多回帖,因为懂的技术少,所以回帖水分大,见谅!
EEWORLD开发板置换群:309018200,——电工们免费装β的天堂,商家勿入!加群暗号:喵
 
 
 

回复

2

帖子

0

TA的资源

一粒金砂(初级)

6
 
错误的信息需要贴出来这样才能帮到你,看出来你的程序是流水灯网上的教程
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/6 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表