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

SSC Port (Second Port) Programming of C167

Hello:

I am working on interfacing(connecting) the mini-Module 167 to dSpace system through RS-485.
For this purpose I have to use the second serial port of the evaluation board of the mini-Module 167.
The controller number is C167CR-LM.

Taking a reference what was mentioned in previous forum (
C166: USING 2ND SERIAL PORT (ASC1) ON INFINEON XC16X DEVICES, http://www.keil.com/support/docs/2601.htm).
I modified the putcahr.c & getkey.c files in order to suit my controller settings and register names.

If I select (#define USE_ASC 0) every thing will go well, but if i select 1 to use the second port, the compiler will compile the code without any errors but no output on the simulator, even no output on the controller itself.

Please find my code below:

#include <reg167.h>
#include <stdio.h>
#define USE_ASC   1
void main (void) {
#ifndef Monitor         /* do not initialize if you use Monitor-166      */

#if (USE_ASC == 0)
  P3  |= 0x0400;                        /* set port 3.10 output latch (TXD) */
  DP3 |= 0x0400;                        /* configure port 3.10 for output   */
                                        /* operation. ( TXD output)         */
  DP3 &= 0xF7FF;                            /* configure port 3.11 for input    */
                                        /* operation. ( RXD input)          */
  S0TIC = 0x80;                         /* set transmit interrupt flag      */
  S0RIC = 0x00;                         /* delete receive interrupt flag    */
  S0BG  = 0x40;                         /* set baudrate to 9600 baud        */
  S0CON = 0x8011;                       /* set serial mode                  */

#else
  P3  |= 0x0200;        /* 0x0200 SET PORT 3.0[3.9] OUTPUT LATCH (TXD)               */
  DP3 |= 0x0200;        /* 0x0200 SET PORT 3.0 [3.9] DIRECTION CONTROL (TXD OUTPUT)   */
  DP3 &= 0xFEFF;        /* 0xFEFF RESET PORT 3.1[3.8] DIRECTION CONTROL (RXD INPUT)  */
  SSCTIC = 0x80;        /* SET TRANSMIT INTERRUPT FLAG                   */
  SSCRIC = 0x00;        /* DELETE RECEIVE INTERRUPT FLAG                 */
  SSCBR  = 0x0009;      /* 0x0009 SET BAUDRATE TO 1MB BAUD @ 20MHz             */
  SSCCON = 0x8011;      /* 0xC057 SET SERIAL MODE                               */

#endif

#endif




while (1) {
printf("E\n");
}
}

Of course I have included the modified putchar.c & getkey.c in my project.
Also, in the simulator, I have assigned WIN2 to receive from SSCIN & SSCOUT, but still no output.

Would you please tell me what is wrong in my code.

Thank you in advance for your advise.

Best Regards,