View previous topic :: View next topic |
Author |
Message |
alexz
Joined: 17 Sep 2004 Posts: 133 Location: UK
|
Return cursor |
Posted: Fri Dec 17, 2004 6:57 am |
|
|
I am sending data through the RS232 and read it using some terminal.
When I read it as a string and send WriteByte('\n');
WriteByte('\r');
the cursor is returned to the begining of the next row.
How can I do the similar thing when reading it as HEX in the terminal? _________________ Alex |
|
![](templates/subSilver/images/spacer.gif) |
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Fri Dec 17, 2004 7:36 am |
|
|
You are doing this the wrong way around. Traditional terminals send the end of line sequence <CR><LF> being carriage return and line feed respectively. Most applications expect a line to be terminated either with a <CR> or a <CR><LF> Lots of applications fail when the <LF> preceeds the <CR>
You should be doing
Code: | WriteByte('\r'); // this is the carriage return <CR>
WriteByte('\n); // this is the line feed <LF>
|
Quote: | How can I do the similar thing when reading it as HEX in the terminal? |
Not sure what you mean. If you mean what is the hex representation of the <CR><LF> characters then this is equivalent to above
Code: | WriteByte(0x0d); // this is the carriage return <CR>
WriteByte(0x0a); // this is the line feed <LF>
|
If you meant how do you get a terminal display that is showing the hex representation of characters to display a carriage return and line feed then the answer is you cannot because in hex mode it will desplay the hex value of these control characters _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
![](templates/subSilver/images/spacer.gif) |
alexz
Joined: 17 Sep 2004 Posts: 133 Location: UK
|
|
Posted: Fri Dec 17, 2004 7:41 am |
|
|
If you meant how do you get a terminal display that is showing the hex representation of characters to display a carriage return and line feed then the answer is you cannot because in hex mode it will desplay the hex value of these control characters[/quote]
Yes, thats what I meant.
Bad news.
Is there a terminal which allows me to do that?
I mean to see numbers in HEX but with returning the carriage after certain amount of sent bytes.
In other words to vombine the HEX view and string together _________________ Alex |
|
![](templates/subSilver/images/spacer.gif) |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Dec 17, 2004 7:59 am |
|
|
Termial by Br@y can display both ASCII and Hex (and binary and decimal) simultaniously.
http://bray.velenje.cx/avr/terminal _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
![](templates/subSilver/images/spacer.gif) |
alexz
Joined: 17 Sep 2004 Posts: 133 Location: UK
|
|
Posted: Fri Dec 17, 2004 9:21 am |
|
|
I have got it, so how can I view both string and hex? _________________ Alex |
|
![](templates/subSilver/images/spacer.gif) |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Dec 17, 2004 9:58 am |
|
|
At the right side of the Receive window there are three check boxes, "Dec", "Hex", and "Bin". Check what you want to see.
Warning: I suspect that if I check them all and the serial data comes in real fast, ie. high baud rate, long strings, small inter-character spacing, on my PC I may miss an occasional character. Therefore don't display all formats if you don't need them.
This is my favorite serial comms program! _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
![](templates/subSilver/images/spacer.gif) |
alexz
Joined: 17 Sep 2004 Posts: 133 Location: UK
|
|
Posted: Fri Dec 17, 2004 10:02 am |
|
|
SherpaDoug wrote: | At the right side of the Receive window there are three check boxes, "Dec", "Hex", and "Bin". Check what you want to see.
Warning: I suspect that if I check them all and the serial data comes in real fast, ie. high baud rate, long strings, small inter-character spacing, on my PC I may miss an occasional character. Therefore don't display all formats if you don't need them.
This is my favorite serial comms program! |
I wanna see string and hex at the same time
I wanna return the cariage _________________ Alex |
|
![](templates/subSilver/images/spacer.gif) |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Dec 17, 2004 10:23 am |
|
|
The main Receive window shows the ASCII values of the bytes, and executes the <CR> and <LF> characters. Simultaniously the Hex window shows the hexadecimal values of the bytes, executing nothing.
What else are you looking for?
P.S. I just noticed the latest version has custom baud rates! So now if your clock is 5% slow you can use 9120 baud instead of 9600. I haven't seen that in a serial program since DOS days! I'll have to test it to see what the granularity is at high baud rates. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
![](templates/subSilver/images/spacer.gif) |
alexz
Joined: 17 Sep 2004 Posts: 133 Location: UK
|
|
Posted: Mon Dec 20, 2004 2:54 am |
|
|
SherpaDoug wrote: | The main Receive window shows the ASCII values of the bytes, and executes the <CR> and <LF> characters. Simultaniously the Hex window shows the hexadecimal values of the bytes, executing nothing.
What else are you looking for?
P.S. I just noticed the latest version has custom baud rates! So now if your clock is 5% slow you can use 9120 baud instead of 9600. I haven't seen that in a serial program since DOS days! I'll have to test it to see what the granularity is at high baud rates. |
I would like to see something like that:
AA AA 80 06 00 01 00 00 40 00
DD DD 12 01 10 01 00 00 00 08
AC AC
AA AA 00 05 03 00 00 00 00 00
AA AA 80 06 00 01 00 00 40 00
DD DD 12 01 10 01 00 00 00 08
AC AC
AA AA 00 05 03 00 00 00 00 00
AC AC
AA AA 80 06 00 01 00 00 12 00
DD DD 12 01 10 01 00 00 00 08
AA AA 80 06 00 01 00 00 40 00
DD DD 12 01 10 01 00 00 00 08
I would like to use the normal strings instead of the values DDDD and AAAA...
But the main thing is that I want see it in coloumn like this and not evering in one row, because its not really readable and hard to follow _________________ Alex |
|
![](templates/subSilver/images/spacer.gif) |
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Mon Dec 20, 2004 3:08 am |
|
|
Hi Alex,
What you are asking for does not make sense because on one hand you would like to see the hexidecimal value of a character and on the other you want the application to respond to control characters. If the application was to correctly interpret <CR> and <LF> then you would expect it to also correctly interpret cursor commands up, down, left, right, erase to EOL, erase to BOL etc. You can't have it both ways :-) _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
![](templates/subSilver/images/spacer.gif) |
|