We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi there I have problem with keil (even with AD code) example of UART
//****************************************** unsigned char memory_pool[0x400]; int main (void) { int iIterator; int iUserVar1 = 0; int *iArray;
GP1CON = 0x011; // Setup tx & rx pins on P1.0 and P1.1 // Start setting up UART at 9600bps COMCON0 = 0x80; // Setting DLAB COMDIV0 = 0x93; COMDIV1 = 0x00; COMCON0 = 0x07; // Clearing DLAB
// initialize memory pool init_mempool (memory_pool, sizeof(memory_pool));
// create an array big enough to hold 10 integers iArray = malloc (10*sizeof(int));
if(iArray == NULL) { printf("Malloc failed!\n"); } else { for(iIterator = 0; iIterator<10; iIterator++) { iArray[iIterator] = iIterator*2; } }
// demonstrate user input via scanf // an alternative to scanf is gets and sscanf printf("please enter a number: "); scanf("%i", &iUserVar1); printf("\nUser Input: %i\n", iUserVar1);
while (1); }
//****************************************** When I configure My Hyper terminal (as it should be 9600/2stop/no parity ) he displays that: I can't open my COM port !?!? When I change setting, example: 4800/2stop/no parity there's no bad information, and something is transmiting to my PC- I see a "ee..##.e# ....etc.)
What is the problem? regards and happy NEW YEAR
The normal reasons for failing to open the serial port is that it is already open by another program or that you have specified a missing port (such as com2 on a computer that only have com1 installed).