Board logo

标题: 求救:如何用PE开发串口和用示波器观测 [打印本页]

作者: 文天祥    时间: 2009-1-22 17:02     标题: 求救:如何用PE开发串口和用示波器观测

我用PE开发MC56F8037的板子,发现用示波器观察总看不到信号 程序如下

#include "Cpu.h"
#include "SCI1.h"
/* Include shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"

unsigned char data=127;

void tr(void)
{ unsigned char tr_clear;

while((QSCI0_STAT&QSCI0_STAT_TDRE_MASK)==0);tr_clear=QSCI0_STAT;
QSCI0_DATA=data;
}
void main(void)
{
/* Write your local variable definition here */

/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
QSCI0_CTRL1|=QSCI0_CTRL1_TE_MASK;
/* Write your code here */
SCI1_Init();
for(;;) { tr();
}
}
void isr_re(void)
{

}
void SCI1_Init(void)
{
/* QSCI0_RATE: SBR=0xD0,FRAC_SBR=3 */
setReg16(QSCI0_RATE, 0x0683); /* Set prescaler bits */
/* QSCI0_CTRL1: LOOP=0,SWAI=0,RSRC=0,M=0,WAKE=0,POL=0,PE=0,PT=0,TEIE=0,TIIE=0,RFIE=1,REIE=0,TE=1,RE=0,RWU=0,SBK=0 */
setReg16(QSCI0_CTRL1, 0x28); /* Set the SCI control register */
/* QSCI0_CTRL2: TFCNT=0,TFWM=0,RFCNT=0,RFWM=0,FIFO_EN=0,??=0,LIN_MODE=0,??=0,??=0,??=0 */
setReg16(QSCI0_CTRL2, 0x00); /* Set the SCI control register */
}
谢谢啦,哪位朋友如果也在搞DSP,交个朋友吧,我的QQ:314098539


作者: fjczd    时间: 2009-2-3 14:32

现在正用mc9s12hz64

也正在调串口,






欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0