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

putchar works, printf not

Hello,

I'm programming a OS for C167 and my problem is that the C167 does write with putchar, but when I want to write with printf it only prints the first character of the string.

For example:

void initSerial(void) {
    P3  |= 0x0400;
    DP3 |= 0x0400;
    DP3 &= 0xF7FF;
    S0TIC = 0x80;
    S0RIC = 0x00;
    S0BG = 0x40;
    S0CON = 0x8011;
}

void main (void) {
  int i;

  initSerial();

  while(1) {
    for(i = 0; i < 20; i++) {
      putchar('c');
    }
    for(i = 0; i < 20; i++) {
      printf("s");
    }
  }
}

This code prints 20x 'c' and then a "s" but then nothing, but cursor is still running like the board wants to write space characters.

If I change the Memory Model to "Small" it works, but I want the TinyModel. Userstacksize is 0x1000 which must be enough.

Where is the problem in this code?

Best regards,
Norbert Rastl

0