打印

DSP28335编程问题:正弦波查找表中相位值不更新

[复制链接]
739|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
demons123|  楼主 | 2024-4-24 11:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
*
* main.c
*
*  Created on: 2023年10月30日
*      Author: DELL
*/

#include "DSP2833x_Device.h"     // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h"   // DSP2833x Examples Include File
#define TABLE_SIZE 128 // 查找表的大小
#define TABLE_SCALE 32767 // 查找表的缩放因子
typedef unsigned long ulong;
float b;
float c;
float phase=20;
float sin=0;
int sin_table[TABLE_SIZE] = {
0, 1608, 3212, 4808, 6393, 7962, 9512, 11039, 12539, 14010,
15446, 16846, 18204, 19519, 20787, 22005, 23170, 24279, 25329,
26319, 27245, 28105, 28898, 29621, 30273, 30852, 31356, 31785,
32137, 32412, 32609, 32728, 32767, 32728, 32609, 32412, 32137, 31785,
31356, 30852, 30273, 29621, 28898, 28105, 27245, 26319, 25329, 24279,
23170, 22005, 20787, 19519, 18204, 16846, 15446, 14010, 12539, 11039, 9512,
7962, 6393, 4808, 3212, 1608,0, -1608, -3212, -4808, -6393, -7962, -9512, -11039,
-12539, -14010, -15446, -16846, -18204, -19519, -20787, -22005, -23170,
-24279, -25329, -26319, -27245, -28105, -28898, -29621, -30273, -30852, -31356,
-31785, -32137, -32412, -32609, -32728, -32767, -32728, -32609, -32412, -32137, -31785,
-31356, -30852, -30273, -29621, -28898, -28105, -27245, -26319, -25329, -24279, -23170, -22005, -20787, -19519,
-18204, -16846, -15446, -14010, -12539, -11039, -9512, -7962, -6393, -4808, -3212, -1608
};
void main()
{
      while(1)
         {int a=phase;
          sin=sin_table[a] ;

          }
}
各位,问大家个问题。我用ccs的watch expression功能在线修改phase得值时,sin值并不会随着改变。哪里有问题吗?

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝