Hi all,
I'm brand new at this. I'm in microVision coding for an ADuC7026 eval board from Analog. I have some preexisting code that works fine. However, I need to add a UART interface to this. Pulling the block of lines right out of a working (and tested) example from the manufacturer, I place it into my code (at the beginning of my main function, as it is in the example). I copy the entire routine for Setting up the correct tx/rx pins and just initializing the UART connection. Taking a UART example that includes a printf hello world function, the code does not compile. I end up with syntax errors marked starting at the preexisting code (what comes right after what I've inserted). I end up with the following errors all over the place:
CAVITY.C(47): error C25: syntax error near 'unsigned' CAVITY.C(54): error C25: syntax error near 'volatile' CAVITY.C(54): error C25: syntax error near ')'
And so on. I have no idea what this is trying to tell me. The string 'volatile' isn't even in my code. This just won't work. This is the code I've inserted:
// Setup tx & rx pins on P1.0 and P1.1 GP1CON = 0x011; // Start setting up UART at 9600bps COMCON0 = 0x080;// Setting DLAB COMDIV0 = 0x088;// Setting DIV0 and DIV1 COMDIV1 = 0x000; COMCON0 = 0x007;// Clearing DLAB GP4DAT = 0x04000000; printf ("Hello World\n");
Again, this is taken straight from a working example. Any insight would be GREATLY appreciated. Thanks.