This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem with example problem UART output

From keil code examples

C:\ADuC_Beta702x\Code\Keil Code Examples\UART\UART1

#include <ADuC7026.h>

extern int write (int file, char * ptr, int len); // Functions used to
extern int getchar (void); // to output data
extern int putchar(int); // Write character to Serial Port


int main (void) {
unsigned char jchar = 0x30;

char output1[13] = "Hello World\n";

// Setup tx & rx pins on P1.0 and P1.1
GP1CON = 0x011;

// Start setting up UART at 9600bps
COMCON0 = 0x080; // Setting DLAB
COMDIV0 = 0x093; // Setting DIV0 and DIV1 to DL calculated
COMDIV1 = 0x000;
COMCON0 = 0x007; // Clearing DLAB

GP4DAT = 0x04000000; // P4.2 configured as an output. LED is turned on

while(1)
{

GP4DAT ^= 0x00040000; // Complement P4.2
write(0,output1,13); // Output Data
jchar = getchar(); // RX Data, Single Byte
write(0,&jchar,1); // Output Rxed Data
}
}

so this one is the program which isnt giving any output.

Thanks

0