📄 test2407.c
字号:
#include "f2407_c.h"
#define LED port40
volatile ioport unsigned int port40;/*LED*/
extern unsigned int adc_res[8]; /*8 ADCs result*/
/****************************** MAIN ROUTINE ***************************/
void main(void)
{
unsigned int data_input;
*WDCR = 0x00E8;
*SCSR1 = 0x00fd;
*SCSR2 = (*SCSR2 | 0x000B) & 0x000F;
//WSGR = 0x0049;
WSGR = 0x01c0;
*MCRA = 0x0003; /* group A pins */
*MCRB = 0xFEDC; /* group B pins */
*MCRC = 0x0000; /* group C pins */
asm(" setc INTM");
*IMR = 0x0000; /* clear the IMR register */
*IFR = 0xffff; /* clear any pending core interrupts */
*WDKEY =0x5555;
*WDKEY =0xaaaa;
*IMR = 0x0001;
//asm(" CLRC XF");
//while(1);
/* Read 16bit external data test,result is saved in "data_input"
use watch windows to see the value in "data_input" */
data_input= Read_Xdata();
/* Here the instruction below is offer for the user to set breakpoit to see
the value of "data_input" in Watch window*/
asm(" nop");
/*Xint1 triger ADC0~ADC7,the ADC result stored in "adc_res" which can been
seen in watch window*/
asm(" CLRC INTM");
test_adc();
/* SCI test: DSP send the same data it reveived for its 232 port*/
test_sci();
while(1);
} /* end of main() */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -