Writing interface software for PC to microcontroller
I've been wanting to learn this for a while, I just never took the time to try and heavily research it, but I'm hoping to tap into the oceans of information from the users here.
Simply(hopefully) put, I want to be able to write a simple, windows-based program that will use a port on the computer to interface to an external circuit.
For example, write a program that is just a small window with a button in it that each time you press it, a line of code is sent to the RS232 port, which will be read in by a propeller (or other uC), and the microcontroller will respond to the code by making a stepper motor make a step (or whatever you want).
I'm not sure what language or IDE to use for making something like this. I'm also not to sure how detailed this can get. Any help will be appreciated!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
while alive = 1
wakeup
program(propeller)
eat(3)
sleep(7)
Simply(hopefully) put, I want to be able to write a simple, windows-based program that will use a port on the computer to interface to an external circuit.
For example, write a program that is just a small window with a button in it that each time you press it, a line of code is sent to the RS232 port, which will be read in by a propeller (or other uC), and the microcontroller will respond to the code by making a stepper motor make a step (or whatever you want).
I'm not sure what language or IDE to use for making something like this. I'm also not to sure how detailed this can get. Any help will be appreciated!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
while alive = 1
wakeup
program(propeller)
eat(3)
sleep(7)
Comments
But I want to be able to have a seamless application that uses the RS-232 port. So far, it seems like only Microsoft provides an logical alternative - Visual Basic.
I really dislike Visual Basic as it is quite unlike Parallax Basic and has a fairly steep learning curve. One could turn to Java or C if one has prior knowledge. But I don't.
So I am currently fooling with Win32Forth to see if I can get an RS-232 port involved. They have a Yahoo group and the software is free. It really is easy to use in a Windows environment and compiles a complete executible program.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
I just located a Win32Forth 'word' [noparse][[/noparse]the equivalent of a subroutine or function] that appears to support the serial port.
Try WINSER.F in the Win32Forth lastest free version. There is also a parallel port word - WINPAR.F
I have high hopes that this will provide a lot of utility and the software is FREE!!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
Python is also free....any thoughts on using it? I've downloaded the manual but haven't had the time to really get in to it!
cheers
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Hope you get everything working,
Craig
P.S. To open the Python Files, you must have Python installed. To see the code behind them, right click on the file and select 'Edit with Idle'
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
Also the GUI can have the menus and dialogue. If you using a single or two byte communication code to the BasicStamp, you have a lot more EEPROM for actual control applications. DEBUG requires you write the menus into the BasicStamp.
Originally, [noparse][[/noparse]circa 1984] I was quite interested in FORTH, but it lacked a Serial Port interface - so I gave up on it. This is a much more evolved form. But still, I think it easily does complex math functions with ease - charts too.
WIN32FORTH is a larger dictionary [noparse][[/noparse]thousands of words] so it may take longer to comprehend and get something initially useful. The WINSER.F is there in the package, but not automatically installed. It needs to be added in and complied to become operational. That is a useful exercise as sometimes you don't need all the bells and whistles.
And of course, there is a user group. Maybe in a few days I will have a GUI linked to a serial port. It really would be nice to have my devices able to have their own window that is formated to the applications I/O.
I believe the site is win32forth.sourceforge.net/ and I have the latest stable version - ver. 6.10.05
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
Post Edited (Kramer) : 3/27/2007 5:29:20 PM GMT
http://forums.parallax.com/showthread.php?p=607328
Here is a thread with a TCL example:
http://forums.parallax.com/showthread.php?p=630273
The TCL sample is command line, but can be made into a gui with TK.
This app looks terrible, it is just a serial port tester, you can get as fancy as you want with the program and graphics.
The command to write a string to the serial port using the User Defined button shown is as simple as this:
Post Edited (TChapman) : 3/27/2007 6:15:36 PM GMT
Like Kramer says it is unlike Parallax basic but what helps are the thousands of examples and what they term "walkthroughs"·which makes learning easier, so VB express is what I use.
I don't know a lot about the other programs but if I wasn't into VB I might opt for Real Basic from what I have seen the graphics of the interface look good.
I am not an expert with Visual Basic but if I can give you a few pointers that might help let me know.
Jeff T.
this is my·SS of a two servo controllers with 6 switches used as inputs or outputs.