⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sci_rxd.txt

📁 DSP关于F240的实例程序
💻 TXT
📖 第 1 页 / 共 2 页
字号:
/*********************************************************************
* Filename: example_c.c                                              *
*                                                                    *
* Author: David M. Alter, Texas Instruments Inc.                     *
*                                                                    *
* Last Modified: 03/14/01                                            *
*                                                                    *
* Description: This program illustrates basic initialization and     *
* operation of the LF2407 DSP.  The following peripherals are        *
* exercised:                                                         *
*  1) Timer 2 is configured to generate a 250ms period interrupt.    *
*  2) The quad LED bank on the LF2407 EVM is sequenced in the        *
*     Timer2 ISR.                                                    *
*  3) The IOPC0 pin is toggled in the Timer2 ISR.                    *
*  4) Timer 1 is configured to drive 20KHz 25% duty cycle symmetric  *
*     PWM on the PWM1 pin.                                           *
*                                                                    *
*********************************************************************/

/*********************************************************************
* THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR        *
* REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,             *
* INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS       *
* FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR             *
* COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE.         *
* TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET         *
* POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY                *
* INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR         *
* YOUR USE OF THE PROGRAM.                                           *
*                                                                    *
* IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL,        *
* CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY          *
* THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED         *
* OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT         *
* OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM.        *
* EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF          *
* REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS        *
* OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF          *
* USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S             *
* AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF         *
* YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS                *
* (U.S.$500).                                                        *
*                                                                    *
* Unless otherwise stated, the Program written and copyrighted       *
* by Texas Instruments is distributed as "freeware".  You may,       *
* only under TI's copyright in the Program, use and modify the       *
* Program without any charge or restriction.  You may                *
* distribute to third parties, provided that you transfer a          *
* copy of this license to the third party and the third party        *
* agrees to these terms by its first use of the Program. You         *
* must reproduce the copyright notice and any other legend of        *
* ownership on each copy or partial copy, of the Program.            *
*                                                                    *
* You acknowledge and agree that the Program contains                *
* copyrighted material, trade secrets and other TI proprietary       *
* information and is protected by copyright laws,                    *
* international copyright treaties, and trade secret laws, as        *
* well as other intellectual property laws.  To protect TI's         *
* rights in the Program, you agree not to decompile, reverse         *
* engineer, disassemble or otherwise translate any object code       *
* versions of the Program to a human-readable form.  You agree       *
* that in no event will you alter, remove or destroy any             *
* copyright notice included in the Program.  TI reserves all         *
* rights not specifically granted under this license. Except         *
* as specifically provided herein, nothing in this agreement         *
* shall be construed as conferring by implication, estoppel,         *
* or otherwise, upon you, any license or other right under any       *
* TI patents, copyrights or trade secrets.                           *
*                                                                    *
* You may not use the Program in non-TI devices.                     *
*********************************************************************/


/*** Address Definitions ***/
#include        "f2407_c.h"


/*** Constant Definitions ***/

#define         pwm_half_per  1000    /* period/2, 10KHz symmetric PWM with
                                           a 40MHz CPUCLK */
volatile int sci_numble;
void Start_SPWM(void);
void sci_init(void);
interrupt void sciint(void);                                         
/*** Global Variable Definitions ***/

//unsigned int 	phase = 200;					/* Sine_Wave phase */

/*********************** Sin_Table 600*16 ******************************/

unsigned int sin_tab[400]={
      990,
      989,
      989,
      989,
      989,
      988,
      987,
      987,
      986,
      985,
      983,
      982,
      981,
      979,
      978,
      976,
      974,
      972,
      970,
      968,
      966,
      963,
      961,
      958,
      955,
      952,
      949,
      946,
      943,
      940,
      936,
      933,
      929,
      925,
      921,
      917,
      913,
      909,
      905,
      900,
      896,
      891,
      887,
      882,
      877,
      872,
      867,
      862,
      857,
      851,
      846,
      840,
      835,
      829,
      824,
      818,
      812,
      806,
      800,
      794,
      788,
      781,
      775,
      769,
      762,
      756,
      749,
      742,
      736,
      729,
      722,
      715,
      708,
      701,
      694,
      687,
      680,
      673,
      665,
      658,
      651,
      644,
      636,
      629,
      621,
      614,
      606,
      599,
      591,
      584,
      576,
      569,
      561,
      553,
      546,
      538,
      530,
      523,
      515,
      507,
      500,
      492,
      484,
      476,
      469,
      461,
      453,
      446,
      438,
      430,
      423,
      415,
      408,
      400,
      393,
      385,
      378,
      370,
      363,
      355,
      348,
      341,
      334,
      326,
      319,
      312,
      305,
      298,
      291,
      284,
      277,
      270,
      263,
      257,
      250,
      243,
      237,
      230,
      224,
      218,
      211,
      205,
      199,
      193,
      187,
      181,
      175,
      170,
      164,
      159,
      153,
      148,
      142,
      137,
      132,
      127,
      122,
      117,
      112,
      108,
      103,
      99,
      94,
      90,
      86,
      82,
      78,
      74,
      70,
      66,
      63,
      59,
      56,
      53,
      50,
      47,
      44,
      41,
      38,
      36,
      33,
      31,
      29,
      27,
      25,
      23,
      21,
      20,
      18,
      17,
      16,
      14,
      13,
      12,
      12,
      11,
      10,
      10,
      10,
      10,
      10,
      10,
      10,
      10,
      10,
      11,
      12,
      12,
      13,
      14,
      16,
      17,
      18,
      20,
      21,
      23,
      25,
      27,
      29,
      31,
      33,
      36,
      38,
      41,
      44,
      47,
      50,
      53,
      56,
      59,
      63,
      66,
      70,
      74,
      78,
      82,
      86,
      90,
      94,
      99,
      103,
      108,
      112,
      117,
      122,
      127,
      132,
      137,
      142,
      148,
      153,
      159,
      164,
      170,
      175,
      181,
      187,
      193,
      199,
      205,
      211,
      218,
      224,
      230,
      237,
      243,
      250,
      257,
      263,
      270,
      277,
      284,
      291,
      298,
      305,
      312,
      319,
      326,
      334,
      341,
      348,
      355,
      363,
      370,
      378,
      385,
      393,
      400,
      408,
      415,
      423,
      430,
      438,
      446,
      453,
      461,
      469,
      476,
      484,
      492,
      499,
      507,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -