Hi. Where can I find the correct settings for aplications using Phytec KC-161 eval board? Because the arrays are not initialized when the device is running without debug. I'm a biginer and i tryed the following simple code at blinky project from \Boards directory, and the result in Hyper Terminal is not I expect. Thank you.
#include <reg161.h> #include <stdio.h> #include <string.h> void setup_serial(); void main (void) { unsigned int vector[6]; unsigned int cnt; setup_serial(); for(cnt=0; cnt<6; cnt++){ vector[cnt] = 1; if(vector[cnt] != 1) putchar('!'); else putchar('1'); //in hyper terminal is displaying six of '!', WHY? //it must be six of '1'! } while (1) { } } void setup_serial(){ /* init physical memory model */ BUSCON0 |= 0x003F; /*; 0 Wait no Delay */ /* initialize the serial interface */ P3 |= 0x0400; /* SET PORT 3.10 OUTPUT LATCH (TXD) */ DP3 |= 0x0400; /* SET PORT 3.10 DIRECTION CONTROL (TXD OUTPUT) */ DP3 &= 0xF7FF; /* RESET PORT 3.11 DIRECTION CONTROL (RXD INPUT) */ S0TIC = 0x80; /* SET TRANSMIT INTERRUPT FLAG */ S0RIC = 0x00; /* DELETE RECEIVE INTERRUPT FLAG */ S0BG = 0x19; /* SET BAUDRATE TO 19200 BAUD AT 16MHZ */ S0CON = 0x8011; /* SET SERIAL MODE */ }