我写了一个串品通信的程序可是没有一点点的反映!这是为何啊,请各位高手帮我看下
#define rULCON1 (*(volatile unsigned *)(0x7F005400))
#define rUCON1 (*(volatile unsigned *)(0x7F005404))
#define rUFCON1 (*(volatile unsigned *)(0x7F005408))
#define rUMCON1 (*(volatile unsigned *)(0x7F00540C))
#define rUTRSTAT1 (*(volatile unsigned *)(0x7F005410))
#define rUERSTAT1 (*(volatile unsigned *)(0x7F005414))
#define rUFSTAT1 (*(volatile unsigned *)(0x7F005418))
#define rUMSTAT1 (*(volatile unsigned *)(0x7F00541C))
#define rUTXH1 (*(volatile unsigned *)(0x7F005420))
#define rURXH1 (*(volatile unsigned *)(0x7F005424))
#define rUBRDIV1 (*(volatile unsigned *)(0x7F005428))
#define rUDIVSLOT1 (*(volatile unsigned *)(0x7F00542C))
#define rUINTP1 (*(volatile unsigned *)(0x7F005430))
#define rUINTSP1 (*(volatile unsigned *)(0x7F005434))
#define rUINTM1 (*(volatile unsigned *)(0x7F005438))
#define rGPACON0 (*(volatile unsigned *)(0x7F008000))
static void init_uart0(void);
static void Tx(char word);
static char Rx();
static void delay(unsigned int z);
static void put_word(char *s);
static void get_word(char *s);
int _start(void)
{
init_uart0();
while(1){
Tx(0x33);
put_word("hello word \n");
}
return 0;
}
static void init_uart0(void)
{
rGPACON0 = (rGPACON0 & ~(0xFFFFU<<16)|(0x2222U<<16)); //set GPACON to UART1
rULCON1 = (rULCON1 & ~(0xFFU)|(0x3U)); //set word length 8 bit
rUCON1 = (rUCON1 & ~(0xFU)|(0xAU)); //set transmit/receive mode DMA request
// rUFCON1 = (rUFCON1 & ~(0xFU<<4)|(0x6U<<4)); //set Tx/Rx FIFO Trigger Level 16 bit
rUBRDIV1 = (rUBRDIV1 & ~(0xFFFFU)|(0x0014U)); //set baud rate
rUDIVSLOT1 = (rUDIVSLOT1 & ~(0xFFFFU)|(0xDDD5U)); //select the slot where clock generator divide clock source
}
static void Tx(char word) {
if((rUTRSTAT1 & (0x2U))!=0x2U)
rUTXH1 = word;
}
static char Rx() {
char word;
if((rUTRSTAT1 & 0x1)==0x1) {
word = rURXH1;
}
return word;
}
static void delay(unsigned int z) {
unsigned int x,y;
for(x=z;x>0;x--)
for(y=1000;y>0;y--);
}
static void put_word(char *s) {
while(*s){
Tx(*s);
s++;
}
}
static void get_word(char *s) {
unsigned char words;
while(1) {
words=Rx();
if(words == '\r'||words == '\n'){
*s = 0;
break;
}
*s = words;
*s++;
}
}