View previous topic :: View next topic |
Author |
Message |
jodank
Joined: 22 Apr 2014 Posts: 49
|
Posted: Sat May 03, 2014 6:01 pm Post subject: Reading content of variable with terminal? How? |
|
|
Hi folks!
Is it possible to get the content of a variable from the real uC during it is operating through the hyperterminal or so?
I have to know the content of some variables when the device is on but I have no lcd on it. ...
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Sat May 03, 2014 7:29 pm Post subject: |
|
|
Hi,
Just Setup the Serial port on the uC, then use:
Code: |
print Variable Name
|
Easy as that.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
jodank
Joined: 22 Apr 2014 Posts: 49
|
Posted: Sat May 03, 2014 7:42 pm Post subject: |
|
|
This is really easy man. Thanks for the advice.
On my EasyAvr5 development board I have a com port but ihave to use this feature on the finished device too.
Another question pls.:
Is it possible to get the stored data from the uC eeprom through the same serial connection? |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Sat May 03, 2014 8:47 pm Post subject: |
|
|
Hi,
The uC can do what ever it's been programmed to do
To answer your question, yes it's possible. Just read the eeprom value into a variable, then print it.
Have a look at the help text, it's actually not that bad.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
Pikczu
Joined: 22 Jan 2006 Posts: 72 Location: Dublin, Ireland
|
Posted: Sat May 03, 2014 9:41 pm Post subject: |
|
|
You can use as well debug . It is working as print but save you a time to clean your code later. Just add debug on or off |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Sun May 04, 2014 10:24 am Post subject: |
|
|
Have a look at my ENC28J60 web server in the blog section it has a command line sub that prints a prompt to the terminal and responds to commands from a terminal program you just need to change the commands and what it sends back , it has a help file that it sends in response to ? or Help being sent to it. I even got it to the point where you can delete (backspace) characters incorrectly typed.
Regards Paul |
|
Back to top |
|
|
jodank
Joined: 22 Apr 2014 Posts: 49
|
|
Back to top |
|
|
Pikczu
Joined: 22 Jan 2006 Posts: 72 Location: Dublin, Ireland
|
Posted: Tue May 06, 2014 8:41 pm Post subject: |
|
|
At first i would start from checking the cable it self before you start writing any kind of software.
Short pin 2 and 3 on your cable (that one from PC site) open the bascom terminal pickup correct comport and start typing.
If you get back what you wrote in terminal window means you have correct settings and up to that point cable is OK go to next step.
Second step i would plug in your rs232 cable in to the board and short two pins on TTL site of your max 232 pin 10 and 9 (remove uC from board just in case)
You should get exactly the same results what ever you type in to terminal window should show on the screen.
If step two doesn't work check power and GND to max232 swap pin 3 and 2 in your cable check again.
Then let us know. |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Tue May 06, 2014 10:28 pm Post subject: |
|
|
Good solution to get know is enything is transmited from uC is : Take headphones eg. from Skype or whatever Connect earth of headphones to earth of device and take capacitor 1uF - 2,2uF and listening Tx Rx pin on uC through this capacitor.
This method I use time ago when Radio Code required reading of motorola uC in BootMode
...if you dont have Logic Analyzer then you hear |
|
Back to top |
|
|
jodank
Joined: 22 Apr 2014 Posts: 49
|
Posted: Wed May 07, 2014 12:26 am Post subject: |
|
|
Pikczu:
I finished right now with testing as you describe.
All the test was finished with good result. I mean, cable is ok and I got back what I typed into the terminal windows of Bascom but if I put back the uC I got only a blank screen in the terminal.
Right now I have no headphone... |
|
Back to top |
|
|
jodank
Joined: 22 Apr 2014 Posts: 49
|
Posted: Wed May 07, 2014 12:51 am Post subject: |
|
|
Ok good peoples, thanks for your time and advice.
I found the problem.
On the dev board is a DIP switch9 where I did not enabled the TX and RX line and so the MAX232 was not feed with information from the uC.
When I put the switch into the right position than I got the msg "Hello world" in the termial window.
I'm very happy now.
Is it possible to clear the screen of the terminal after the print command? |
|
Back to top |
|
|
Deanus
Joined: 26 May 2006 Posts: 188 Location: Adelaide
|
Posted: Wed May 07, 2014 8:44 am Post subject: |
|
|
Hi Jodank,
I think it's this sequence Print "[27","[2J" when you want to clear the screen.
Regards
Dean |
|
Back to top |
|
|
jodank
Joined: 22 Apr 2014 Posts: 49
|
Posted: Wed May 07, 2014 4:42 pm Post subject: |
|
|
I tried now and it's not that sequence... |
|
Back to top |
|
|
jodank
Joined: 22 Apr 2014 Posts: 49
|
Posted: Wed May 07, 2014 8:59 pm Post subject: |
|
|
Ok people, here is how I solved my problem with clearing the terminal window:
I use this type of printing to print all the time in the same line
Code: |
Print "here put something what you wish to print" ; chr(13) ;
|
This code can print a variable like the time hh:mm:ss into the same line and all the values are updated all the time. |
|
Back to top |
|
|
Deanus
Joined: 26 May 2006 Posts: 188 Location: Adelaide
|
Posted: Thu May 08, 2014 10:15 am Post subject: |
|
|
Hi Jodank,
Chr(13) is only a new line,
Here's the site with all the control codes for terminals, you did mention that you were using Hyper terminal or the like.
http://www.cse.psu.edu/~kyusun/class/cmpen472/11f/hw/hw7/vt100ansi.htm
The Screen erase is
Erase Screen <ESC>[2J
which in Bascom is
Erase Screen Print &H1b, "[2J"
Regards
Dean |
|
Back to top |
|
|
|