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

Printf() size, questions?

How many bytes will printf() take up in a non debug-monitor
environment?

Also, is it easy to set up printf() to map to a second UART?
I will need control of the UART ISR so that I can handle receives
appropriately. How will this confict with printf()?

Parents
  • So I just have to have a putchar() somewhere in my code and this will
    automatically override the putchar() that printf() uses?


    Yes, of course. Same for getchar().

    And if I decide not to use printf() can I override the interrupts for UART transmit and receive the same way?

    You can use interrupts with or without printf() being used. It's up to how you implement putchar and getchar. Either way, you are not overriding the interrupts. In a uC you are in complete control. Interrupts are not used by the default putchar/getchar supplied by Keil.

    Also, I need to prove my code works using the uVision2 simulator because we won't have a prototype for some time.

    I can't help you there. I always use an In-Circuit Emulator on a simple board with a RS-232 driver.

    - Mark

Reply
  • So I just have to have a putchar() somewhere in my code and this will
    automatically override the putchar() that printf() uses?


    Yes, of course. Same for getchar().

    And if I decide not to use printf() can I override the interrupts for UART transmit and receive the same way?

    You can use interrupts with or without printf() being used. It's up to how you implement putchar and getchar. Either way, you are not overriding the interrupts. In a uC you are in complete control. Interrupts are not used by the default putchar/getchar supplied by Keil.

    Also, I need to prove my code works using the uVision2 simulator because we won't have a prototype for some time.

    I can't help you there. I always use an In-Circuit Emulator on a simple board with a RS-232 driver.

    - Mark

Children
No data