PC Command Console
Areal Person
Posts: 197
Hi,
I’m working on a Propeller project where I need to create some kind of
windows software that would provide a proprietary command console to the Propeller.
It would be a window screen that would open on the PC and would have a command prompt,
I would then be able to type custom commands and they would execute on the propeller based on
how I had programmed the Propeller spin/asm program to execute the commands.
There would also need to be some communications back from the Propeller to the PC
to report command success etc...
What would be the best way to do this ? Is there any programs or resources available
that I could start with ?
I thought about just using a terminal setup to the propeller, would this be the best way ?
Is there an example that could get me started communicating with the Propeller through
a serial terminal interface etc. ? I'm new at this stuff and really need an example
to get me started.
I need to build something custom so that I can extend it with new commands and features
as I upgrade the hardware components with new features.
Thanks for the help,
-Areal
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
I’m working on a Propeller project where I need to create some kind of
windows software that would provide a proprietary command console to the Propeller.
It would be a window screen that would open on the PC and would have a command prompt,
I would then be able to type custom commands and they would execute on the propeller based on
how I had programmed the Propeller spin/asm program to execute the commands.
There would also need to be some communications back from the Propeller to the PC
to report command success etc...
What would be the best way to do this ? Is there any programs or resources available
that I could start with ?
I thought about just using a terminal setup to the propeller, would this be the best way ?
Is there an example that could get me started communicating with the Propeller through
a serial terminal interface etc. ? I'm new at this stuff and really need an example
to get me started.
I need to build something custom so that I can extend it with new commands and features
as I upgrade the hardware components with new features.
Thanks for the help,
-Areal
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
Comments
Once this works, then you can write your own windoze interface. Remember DTR resets the propeller if you use the PropPlug.
P.S. You can't use Hyperterminal on the same COM Port because it will reset the propeller by DTR (unconfirmed).
Enjoy
the basic thing to use is the FullDuplexSerial-object
but i would prefer the extended fulduplex serial-object as this one provides
commands for sending and receiving decimal numbers as a string and convert
the string into an integervalue.
depending on how complex the commands are
for simple commands it might be more effective
to translate the commands in a bytecode in the windows program and then
send the bytecodes to the propeller.
Otherwise you would have to receive complete strings on the propeller and compare the received strings
with predefined strings which is surely possible.
Simply start playing with the Extended_FD_serial-object
you're welcome to as as many questions as you like. Concrete questions - even if they are very simple - are most apreciated
Simple questions are simple to answer to and can be done "on the fly" so don't hestiate to ask.
best regards
Stefan
I would like to implement a professional cmd console that I could
easily extend. It needs to be high speed as possible and also be designed
so that it can be extended with new features/commands.
What about using the byte code design for all commands, I’m really not sure how to
do that. What about the pros and cons ? What would a byte code command structure look like ?
Your thoughts ?
Also, Is there any examples of using the FullDuplexSeral object as a command
interface ?
-Areal
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
If so, I think I may have enough info to try to get started.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
that should quickly get you rolling along the right path
-Areal
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but
what do you expect ? I'm a programmer.
This is a Thermostat that has a PC console (via USB) and allows data logging, Setpoint/data updates/status queries and debugging dumps via a "serial terminal"
The Parsing code is pretty ugly, but it allows single character commands + multiple integer parameters (any number in any order)
http://forums.parallax.com/forums/default.aspx?f=25&m=216870&g=218666#m218666
bytecommands means: you type a command like "SETPARAMETER1 100" on the PC-keyboard
(in this case 17 strokes on the PC-keyboard. The WINDOWS-Software translates the command
"SETPARAMETER1" to a Number between 0 and 255 that could be transmitted as ONE byte
so this number is the bytecode. If you need more than 256 different commands you would
translate it into two bytes (numbers between 0-65536 and should be really enough)
without translation you would send "SETPARAMETER1 100" and on the propellerside you
1.) receive "SETPARAMETER1" as a string
2.) have to compare the full string "SETPARAMETER1"
which will need more bytes and a bit more complicated programming than just comparing one or two bytes
to keep the overview and to keep things clear on the propeller yu will define CONSTANTS for all the numbers
example
now you can use the word SetParameter1 for the number 103
the propeller gets a number but you read a clear word in the text of code
that's what constants are for.
To extend this is up to you. If you wrote write very concrete WHAT KIND of commands you thinking of
we can give you more advice.
About the Pins:
as the manual says:
PIN 30,31 is used by the Propeller-IDE to send the program
Once the program is sent you can use the Pins like all other Pins
PIN 28,29 is used for the eprom through the bootphase of the chip
after the bootphase you can use them like all other pins
For a simple serial connection TWO pins is enough one for sending one for receiving
Now it depends on the real application if it is enough to connect PC and propeller via a normal serial cable
for an enviroment with a lot of electrical noise or distances ore than 5 meters other things are nescessary
best regards
Stefan
Although it refers to the BS2 it is suitable for any of the Parallax processors. I am a novice with the Prop but managed to put together a Propellor app and a VB app with two way communication at 115200 baud. On the VB side a value or values are typed into any of the six text boxes, when the send button is pressed the six bytes are transmitted to the Prop which then sends them back to be displayed in the top text box. The Data_Array in the Spin code can be used internal to the Prop
This is only an example and has no code to trap the following errors #1 Numbers less than 1 or greater than 255 #2 Closing the port while the Prop is still transmitting data
I would normally use the sixth byte for a checksum but did not in this case. It is possible to assign any of the six bytes to switches·, sliders or indicators, whatever you want you interface to look like.
If anyone can answer for me why sending a zero value to my current Spin code produces errors I would apprecitate it.
Comments welcome and source code available to any who want.
Jeff T.