阅读:1432回复:1
请教68013的串口调试问题
这是程序,KEIL可以编译,但示波器发现串口没波形,不知道是怎么回事?哪位大侠能指点一下.
#define ALLOCATE_EXTERN //分配外部寄存器地址 #include <fx2.h> #include <fx2regs.h> #define uint unsigned int #define uchar unsigned char main() {OEA=0xff; /*initial*/ OEB=0xff; OEC=0xff; OED=0x0f; OEE=0xff; IE=0x80; EIE=0xe8; /*interrupt enable*/ PORTECFG =0x0f; /* PE.3 change to RXD0OUT */ PCON=0x80; SCON0=0x00; /* 串口低速同步,波特率CLKOUT/4 */ while(1) { SBUF0=0xCC; while(TI==0); TI=0;} |
|
沙发#
发布于:2007-12-08 22:05
|
|