Hutan Cosmin

UART1 & UART2 problem for CW 6.0 amd M5213EVB board

Discussion created by Hutan Cosmin on Apr 20, 2007
Latest reply on Apr 23, 2007 by Hutan Cosmin
I can't manage to make this simple program work for UART1 or UART2 (for UART0 it works)

int main()

 int ch; 
 char s[50]="Send message to UART1";
  int uartch=ch;      //UART1 channel to initialize
  int sysclk=80000;  // UART System Clock (in KHz)
  int baud=9600;      // UART baud rate
  int settings=1;    // Initialization parameters

  //115200 Baud,8bits,no parity bit,1stop bit,Autobauding disabled
  uart_init (uartch, sysclk, baud, settings);
  printf("\nSending data [USART1] ....\n\n");
  WriteUARTN(s,strlen(s)+1)    ;
   while(1);    // Idle

where uart_init and WriteUARTN are defined in UART_unity.c
UARTError WriteUARTN(const void* bytes, unsigned long length)
   int count;
   UARTError err= kUARTNoError;

   for (count = 0; count < length; count++) {
   uart_putchar(1, *( ((char *)bytes) + count));
   return err;

The Hyperterminal doesn't show  anything(for UART1 and UART2).
The function defined in UART_unity.c doesn't  work for UART 1 and 2.
Help pls.
CW 6.0 + M5213EVB board

J2MEJediMaster added part and CW version number to header

Message Edited by J2MEJediMaster on 2007-04-23 10:38 AM