This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/OMAPL138B-EP:OMAPL138_LCDK:正弦波生成

Guru**** 2538930 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/572309/ccs-omapl138b-ep-omapl138_lcdk-sine-wave-generation

部件号:OMAPL138B-EP
主题:OMAPL138中讨论的其它部件

工具/软件:Code Composer Studio

您好,

我正在将OMAPL138_LCDK与Code Composer Studio 5.5 一起使用.........0。 我正弦波的产生遇到了问题。 我尝试使用查找表和内置'in'函数。 两个都不会发出正确的正弦波。 我使用的编译器是C6000。 我使用的代码是:

使用查找表:

#include "L138_LCDK_aic3106_init.h"
#define LOOPLENGTH 100
#define BUFLENGTH 256
Int16_t sine_table[LOOPLENGTH]=
{0,631.25187249亿 ,3093.68426482亿 ,5365.88637685亿 ,7297.71809844亿 ,8769.05930951亿 ,9699.82992998亿 ,8768.44809771亿 ,9.98992982亿 ,9699.51930905亿 ,7296.85637588亿 ,3092.49187125亿 ,,,5364.82426368亿 ,930.93085085亿,
850.84084084亿,840.84084089亿,890.89089089亿,
890.89089089亿,890.89089089亿,890.89089089亿,890.89089089亿,





//输出样例
sine_ptr =(Sin弦_PTR+1)%LOOPLENGintr;//增量表索引
缓冲区[buf_ptr ]=(Int32_t)(示例);//将样本存储在缓冲区
buf_ptr =(buf_PTR+1)%BUFLENGTH;//增量缓冲区索引
返回;

int main(void)
{ LK_PTR_1b_IN,1%,1d_ING_ADC_ING_ATFS_INPUBL_1%,1%)}_ATFS_1_1%BIN_ATFS_EADC_1_1%BAC_EADC_1%0



使用SIN功能:


#include "L138_LCDK_aic3106_init.h"
#include "math.h"
#define sampling_FREQ 8000
#define PI 3.14159265358979
float frequency = 1000.0 ;
float振幅= 2万.0 ;
float theta_increment;
float theta = 0.0 ;
interrupt void interrupt service例
程{
theta_increment theta4(void)// interrupt服务例{ thet_increment=2*theta_theta*theta=2*pi*theta;sample_theta)
pi_theta= theta= theta;target_theta;target_inttheta=theta)




int main (void)
{
L138_initialize_intr (FS_8000_Hz,ADC_GAN_0dB,DAC_ATTEN_0dB,LCDK_LINE_INPUT);
while (1);
}

输出:


两个代码提供相同的输出。 请帮助我解决问题,因为两个程序在MATLAB中都运行良好。 还可以帮助我设置图形工具的参数。

提前感谢您的参与。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    Gunturu,

    起初我以为这是硬件问题。 但是,我怀疑这是CCS问题。
    我将进入CCS论坛。 如果要查找L138B-EP特定的硬件问题,请返回本论坛。

    此致,
    涉水