Communicate to Terminal Frequencies Program from Comm Port without Parallax Ser
Rich_W8VK
Posts: 44
Hello All!
···· Can someone tell me how I could do Comm Port data to the Propeller running the Terminal Frequencies Program without the Parallax Serial Terminal?
···· I'm trying to use a Visual Basic/Visual Studio Program to send data to the Terminal Frequencies Program without having to have the Parallax Serial Terminal Program up and running too! Is there some kind of Object Source Code File that will integrate easily into the Terminal Frequencies Program that will take the place of Parallax Serial Terminal and allow input data?
···· I was able to use the BS2 stuff off the comm port to another program and it would send/receive data Ok and I didn't have to have the Debug window running in that case.· Can someone give some suggestions on how to set the propeller up this way please?
Thanks!
Rich_W8VK
·
···· Can someone tell me how I could do Comm Port data to the Propeller running the Terminal Frequencies Program without the Parallax Serial Terminal?
···· I'm trying to use a Visual Basic/Visual Studio Program to send data to the Terminal Frequencies Program without having to have the Parallax Serial Terminal Program up and running too! Is there some kind of Object Source Code File that will integrate easily into the Terminal Frequencies Program that will take the place of Parallax Serial Terminal and allow input data?
···· I was able to use the BS2 stuff off the comm port to another program and it would send/receive data Ok and I didn't have to have the Debug window running in that case.· Can someone give some suggestions on how to set the propeller up this way please?
Thanks!
Rich_W8VK
·
Comments
Do you have visual studio working? If so, are you at the point of sending and receiving one byte, or do you want something more complicated (eg a terminal program in visual studio, which is not that hard to write)
Or are you looking for some sort of different code on the Propeller side. If so, what do you need it to do?
I've never used the parallax serial terminal program, so maybe I don't understand the question properly. But on the other hand, the reason I don't use pre written serial terminal programs is I have written my own and I'm constantly changing and updating it as no pre written one does the things I need. Which means maybe I have some code that could help out here.
Do you want to send and receive a byte? Or a packet of bytes? Or an entire file?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
···· I want to send only from Visual Basic Program/Visual Studio Program a short string of numbers only like 10105000, to the Propeller Terminal Frequency Program! Input a number string only to it!
···· I don't need to see what the Propeller board sends or echos, but its okay if the propeller does send something, as the other program ignors it! These data strings are sent at 28.8, 56.7 KB rates by the way! I don't want the Parallax Serial Terminal Program, or any serial terminal/Plus involved as the face cover to the computer screen!
···· Does that make what im wanting to do crystal clear now? Thanks for your answer too!
Rich_W8VK
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
···· Well the terminal frequency has code in it that calls for the serial terminal object to be present! So I guess a person has to elimanate the code calling for the serial terminal and see what it needs from that point!
···· I'm not good at the coding (spin language) to see what it needs. The thing always locked up on me trying to modify it!
···· Attached is a modification by a Parallax person (Andy Lindsay), to make it generate all the time and accept an input! The input has a format of numbers 10105000 for example. But it can only accept input from the parallax serial terminal! Thanks for your help!
Rich_W8VK
Presume you referring to this line in your program
Debug : "FullDuplexSerialPlus" ' Parallax Serial Terminal display object
If so this refers to an object required by the propeller to compile/run your program on the propeller micro.
It does not refer to the Parallax Serial Terminal.exe Program which runs under Windows
regards
Gerry
········ Look at the spin code I posted earlier Please! It calls for the·spin code in serial terminal plus to do the communicating to the terminal frequencies program. The serial terminal plus program provides entered data to be digested by the Propeller terminal frequencies program.
········ So when I have the VB/Visual Studio program up and running on the same comm port as the propeller i have a lock up at times or it doesn't see the same data that was entered by serial terminal plus that makes it work!
········ I guess what i'm asking is how do i cut the spin code out of this terminal frequencies program looking for serial terminal plus communication, and turn the data comming to it thru a comm port? The VB program can select any port the propeller is hooked to! It's the Propeller terminal frequencies program that needs a different object code and editing to work to a custom program sending the correct data format at it! Thanks for your reply! I wasn't able to get back to you as i had a very demanding day since my father passed away!
······· I am looking forward to any help modifying this terminal frequencies program I can get! See my earlier posting if you need the propeller program files! Thanks to all!
Rich_W8VK
·
Debug : "FullDuplexSerialPlus" ' Parallax Serial Terminal display object
Which renames "fullduplexserialplus" as 'debug' for the rest of the code.
The comment
' Parallax Serial Terminal display object
is a bit misleading. It would have been that for the person who wrote the code, but in reality it can talk to any terminal program, or indeed vb.net. So if you like you could just remove that comment.
There are four bits of code to get working
1) Propeller output
2) VB.Net input
3) Propeller input
4) VB.Net output
I can give you all the code at once (and ?cause lots of confusion) or small bits at a time. But maybe you already have some code?
Anyway, first step might be to get the propeller to output a byte.
take this bit of code
and modify and simplify it.
This starts up the serial object, waits a short time, and outputs a single "A" and then ends (goes into an endless repeat). So each time you restart the propeller it sends an A.
You can test this with the propeller serial terminal. Or with Hyperterm or Teraterm or any other terminal program. Or with vb.net.
So - do you have some code working in vb.net that can talk to the serial port?
As a side issue, writing serial code can get very tedious if you are contstantly swapping from programming to debugging. There will be conflicts using the serial port. It can be a lot easier to put a second serial port on the propeller and use serial to USB device. On the dracblade for instance I program using com port 1 talking to pins 30 and 31 on the prop, and I get the program to talk via pins 28 and 29 on the prop and on vb.net use com port 4. (I bought a whole pile of USB to serial devices and they only ended up $2.50 each so easy to add com ports).
But if you only have one com port, there is a lot of: 'program with F11, shut down the prop tool, run the program you are writing in vb.net, restart the propeller, test a byte came through, shut down the vb.net program, restart the propeller tool, edit either/both the spin code and the vb.net code'. If you forget one of those steps, you get clashes with the com port, and even worse, sometimes bits of programs running in the background hogging the com port and you can only find these with a ctrl/alt/del.
You might find a serial port monitor program useful as well. Eg, in your original code the first thing spin does is send an ascii character 16 for Clear Screen. But other terminal programs might interpret that differently (eg VT100 which uses ESC sequences to clear the screen and move the cursor around). And you might not see anything on some terminal programs as this is a value that might not display. Generally, if you want something to display use ascii numbers from 33 to 126. www.asciitable.com/ With a serial port monitor program at least you can see the data go from the propeller to the PC, even if the PC hasn't cleared the input buffer yet.
How much code do you have working in vb.net?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
···· This looks very, very, good! I had the whole day tied up with a swap out of telephone companies. Had to wait on the transfer of modems and getting the modem to talk to the telephone! Then I had to rewire my fathers old wiring to get five telephones going! I have some cleanup to do yet!
···· Please give me a little time to check out your programming and set up some test files to try out the new spin code!
···· Yes I have a complete VB program written that is an old telephone modem program modified to basically send data! I dont display the receive window to the user, as there is no need! I just have it set up to transmit "10105000" eight numbers when i want a change!
···· Thanks for your help Dr Acula so far! Let me get caught up! I will give you another posting i hope by this evening!
Rich_W8VK
·
I've always found receiving code to be a bit complicated. For instance, if you use this:
note that it decrements rxbyte each time you check to see if a byte is available. A bit of quantum mechanics there - by measuring something you upset the very thing you are trying to measure. So I ended up writing a new method
and that doesn't decrement the counter. So your program can keep polling and only when byte(s) are available do you actually collect the data
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
You need to go back and revisit Dr. Acua's original code. It is not looking for an object called Debug, but rather renaming the object "FullDuplexSerialPlus" to "Debug" to be used in the rest of the program as "Debug".
I think your calling of "SimpleDebug" might be the problem. I have not analyzed it but "SimpleDebug" was not something Dr. Acula had in mind.
Also, when you include "SimpleDebug", it requires that "FullDuplexSerial.spin" to be available to be included in the program. It needs to be in the same directory along with "Acula 1.spin" and "SimpleDebug.spin" to be compiled correctly.
Load Acula 1.spin in the propeller tool and hit F8, (info). This can tell you a lot.
Jim
Then I downloaded and installed RealTerm and tried it with that. Also worked fine once I set the proper baud rate and com port.
From looking at the spin program I can see no reason for it not to work with hyperterm or VB as long as the baud rate and port are correct.
See attached - put both in the propeller directory. The 'main' program is this:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
···· I just saw this last post of yours with the file attachment! I will try it right away and reply! Thanks!
Rich_W8VK
·
If you program this with F11 (ie to the eeprom), then start up a terminal program, then reset the propeller (or cycle the power supply) you should get an A on the terminal screen. Tested with both Hyperterminal and Teraterm.
This is very simple but if this bit works then you can build on it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
····· Lets us all try something new! Posted herein is the file I wish all to modify, and try to compile, and run! I also have Hyper Terminal set up on Comm 3, at 56700 BPS, 8 Bits, No Parity, and no flow control.
···· The name of this file to try and modify and get running is Terminal Frequencies for Rich Take 4.
If a mod is successfully done, Please move the file to the next number! (Terminal Frequencies for Rich Take 5, ect.) and attach the new file to your posting.
···· The posted file (4) will not F8 compile due to errors in the PUB Main Area! Can someone correct this please!· The number 4 file was made out of take 3 and Send A.·Thanks for everybody's help!
Files included are terminal Frequencies for Rich 3, SendA, to become the 4 file! And of course the 4 file!
Rich_W8VK
Post Edited (Rich_W8VK) : 3/5/2010 12:21:20 PM GMT
It now gets to the stage of asking for a fequency. But if you type something, I know it is going to the board as I have leds that flash on that board, but it isn't capturing the bytes in this bit of code.
This is not code I'm familiar with, so maybe someone else can help there.
On the Dracblade board I'm using a modified version of the 4 port serial driver in the obex with very simple code - first check if a byte is in the buffer
and if it is, then get it
and to send a byte
That is the heart of the program that ends up doing xmodem file transfers in CP/M to and from a terminal program. So I'm not sure what direction to take you next - try to get that GetDec code to actually receive a byte, or use code I know works.
Maybe someone else can help with that GetDec code - does it finish when it gets 11 bytes or when you type Enter or some other way?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
The first problem is the use of "Debug". Since you declared - Serial : "FullDuplexSerial". You must now use "Serial" where you used "Debug" before.
Second problem is that you use "Serial.tx(CR)". You have not defined "CR". Notice in the other areas "Serial.tx(13)" was used. 13 is a CR, (Carrige Return).
If you notice in your "Take2" program, CR was defined in the CON section:
But was left out is this version.
That would allow you to use either (13) or (CR) later on.
Third problem, FullDuplexSerial.spin does not have a ".getDec" funtion. That is in FullDupleSerialPlus.spin
·And, of course you will never get anywhere with the "repeat" statement In "PUB Init"
Jim
Post Edited (hover1) : 3/5/2010 1:45:14 PM GMT
···· I'm sorry, I don't have the foggiest idea what your talking about here! I'm not a good programmer and the only way i get things is in a corrected file! Thanks anyway for trying to help!
···· Next!
Rich_W8VK
·
By hitting F8 (View Info) with your program open, it will bring up the errors and tell you what is wrong. Fix them one at a time. I gave you all the solutions. Try it out and see if you can't fix the problems. You will probably understand better if you actually changed the errors yourself. It's a better way to learn.
What I gave you works on my end, (the terminal program anyway, I haven't checked if it's actually outputing anything).
Jim
EDIT: Take the "repeat" out.
Post Edited (hover1) : 3/5/2010 3:59:43 PM GMT
As to the VB side,··I have no experience in it. Can't help you there.
Post Edited (hover1) : 3/5/2010 6:25:57 PM GMT
····· This indeed does work with Hyper Terminal for changing the frequencies!
Very, Very Nicely done!
····· There's just one problem left that didn't occur with the orignal setup! And that is this:
·· When using the original terminal frequencies program and the serial terminal plus, when you exited the original programs, the prop board keep generating at the frequency you last set it!
·· Now when you leave Hyper Terminal from setting the frequency, it turns off the Prop board from generating! Do we want it turned off? No!
Thanks!
Rich_W8VK
·
This program works as tested with the Propeller Serial Terminal. Hyper Terminal probably issues a reset upon exit.
This is starting to look more like demands than looking for help.
Exit stage right.
Jim
Hover mentioned three things that needed fixing and the explanation as to why they needed fixing. I just went ahead and fixed those three things in the code I posted in version 5. Either way, I think it is entirely possible that the propeller can solve the problem you want to solve, and hopefully these code examples are enough to show it can be done.
But - where to from here?
*Possibly there might be people here prepared to write the code.
*Alternatively, now might be a time to go back and read the manual and learn some Spin and do some experimenting. At the very least follow through the example in the manual that gets a led flashing.
*Or - maybe pay someone to write the code and I think there are people on this forum that have done that in the past.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Best of luck with the project.
We will be here to help.
Best Regards,
Jim
But if not, ok here is some code, but from now on rather than asking for more and more things, could you please post some code you have written yourself, to show you understand this? Just modify some lines, add something, and get it to do something new. It is just that we can't keep writing everything for you (you might have noticed hardly anyone is replying to this thread. There is a reason for that).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
···· I have a new version of TerminalFrequencies up and running! I am able to control it·from Hyper Terminal too! Can anyone eliminate the frqa statement that keeps being sent out after i enter a new frequency?
··· Attached is the Terminal Frequencies Version i'm using now! Thanks!
Rich_W8VK
Post Edited (Rich_W8VK) : 3/8/2010 9:22:58 AM GMT