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

Hyperterminal Intelligence !

Dear All,

Who know how hyperterminal identifies input state of cpu connected to PC via serial port ?
For example when codes in CPU reaches to scanf() func. the hyperterminal switches to input situation and is ready to receive data from user without any extra data exchanging .

Regards.
Majid

Parents
  • "But when cpu run an input command , we can see what we are typing and with an Enter key , our chars transferred to CPU"

    This is because scanf() calls getchar() to receive data from the UART. getchar() in turn calls putchar() to echo those characters back out through the UART. Hyperterminal displays those echoed characters. If the 'CPU' is doing something else you won't see the characters you type appear in the hyperterminal window.

    Most of the format specifiers you use with scanf() delimit their input when a character that is inappropriate for that specifier is received. For instance:

    scanf("%d",&someint);

    If you type '123[Enter]' scanf will return control to the calling function when the enter key is pressed, because that character is not valid as part of an integer. Every time a key is pressed that key will be echoed back to hyperterminal. Note that hyperterminal is completely dumb, it just displays characters received by the PC UART and transmits characters you type out through the PC UART.

Reply
  • "But when cpu run an input command , we can see what we are typing and with an Enter key , our chars transferred to CPU"

    This is because scanf() calls getchar() to receive data from the UART. getchar() in turn calls putchar() to echo those characters back out through the UART. Hyperterminal displays those echoed characters. If the 'CPU' is doing something else you won't see the characters you type appear in the hyperterminal window.

    Most of the format specifiers you use with scanf() delimit their input when a character that is inappropriate for that specifier is received. For instance:

    scanf("%d",&someint);

    If you type '123[Enter]' scanf will return control to the calling function when the enter key is pressed, because that character is not valid as part of an integer. Every time a key is pressed that key will be echoed back to hyperterminal. Note that hyperterminal is completely dumb, it just displays characters received by the PC UART and transmits characters you type out through the PC UART.

Children
No data