![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
When I press enter on my keyboard, does it generate a <CR> or a <LF>? or both? And in what order? I am writing some PIC and PC stuff for them to communicate with each other over the UART, but I also need to make the PIC compatible with a regular hyperterminal window where users can manually enter things. | |
| |
| | #2 | |
| Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | #3 |
|
use PortMon software to debug communication with Com ports. Created by Sysinternals and TOOK OVER by microsoft. No surprise there. http://technet.microsoft.com/en-us/s.../bb896644.aspx Get very good with this software or any com port debugging software. ODOA is pushed out the comport for every Enter key pressed. CR first LF second. Last edited by donniedj; 30th March 2008 at 09:06 PM. | |
| |
| | #4 |
|
I agree with Futz--it's not determined by the keyboard but by the terminal program. File -> Properties -> Settings -> ASCII Setup in Hyperterminal. The keyboard itself just sends 0x1c to the PC. I can't think of any reason you'd want to send the LF but maybe you have one. If sent it's always CR/LF, not LF/CR. Torben [Edit: Forgetting my PC hardware in my old age. Keyboard sends 0x5a; BIOS translates to 0x1c. Dang.] Last edited by Torben; 30th March 2008 at 09:45 PM. | |
| |
| | #5 | |
| Quote:
It's really all based on paper printers (probably teletypes), but terminal programs are designed to emulate those - generally they are configurable to accept just CR and internally add a LF as well. If you have the terminal program configured in that way, sending the normal CR/LF will produce double-spacing. Back in the DOS days I wrote various terminal and communication prgrammes, including my own Packet Radio program I used to use. | ||
| |
| | #6 | |
| Quote:
About 17 years ago my .sig read 'Real programmers use "copy con progname.exe"'. ![]() Torben | ||
| |
| | #8 | |
| Quote:
I remember that story--always loved it. I'd never compare myself to that guy. And I never knew anyone who actually did a 'copy con progname.exe' but I did have fun with writing short debug scripts in hex. It was the geek equivalent of what the jocks were doing in the gym: building skills (but really just showing off). Torben | ||
| |
| | #9 |
|
Just printing CR on its own is often handy on a terminal because it can be used to move the cursor back to the beginning of the line and overwrite the display.
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | |
| |
| | #10 |
|
Back in the teletype days a CR without a LF was quite handy for printing password fields. You would print something like #$@*OM on top of itself (with each character repeated for each character position) for the password field leaving a dark box. Then when you typed in your password, no one could read what you typed. The automatic linefeed was a pain because you would have to tear your password out of the paper so it would not be found in the trash. Another neat trick was to space out several characters and print the last character on the line, two backspaces, then the next to the last character, etc., to print a line backwards. And don't forget control-G (BEL) and RUBOUT. Linefeed could also be used by itself to advance the paper without returning the carriage so you don't need a bunch of blanks at the beginning of a line. (I think I got off topic.) Dale | |
| |
| | #11 | |
| Quote:
Never had to code for a teletype myself, though. Torben | ||
| |
| | #12 |
|
I made a comment the other day when there was aproblem with a printer that maybe copy con to printer could be used to bypass the driver ..... DOS whats that
| |
| |
| | #13 | |
| Quote:
| ||
| |
| | #14 |
|
If you did that on an NT machine, then it would just pass it to the printer dirver. I think it's quite silly that the processing has moved from the printer to the PC, when the reverse has happened with sound and graphics cards. I'd rather pay more for my printer, have the print jobs print faster without slowing down my PC and be able to use it under any operating system without installing a driver.
__________________ I do not answer private messages asking for help because no one else can: benefit from advice I may give or correct me if I'm wrong. Please ask on the open forum if you have a question and I'll be happy to help, if I know the answer. | |
| |
| | #15 | |
| Quote:
| ||
| |
|
| Tags |
| <cr>, <lf>, enter, hyperterminal, key |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| PIC keypad (i'm newbie) | 11max11 | Micro Controllers | 44 | 19th December 2007 11:58 PM |
| LCD display and Hyperterminal communication with 16F877 | peter83 | Micro Controllers | 2 | 16th May 2004 07:28 AM |