Shop OBEX P1 Docs P2 Docs Learn Events
Interface to winbox — Parallax Forums

Interface to winbox

Craig NCraig N Posts: 17
edited 2006-06-06 02:39 in BASIC Stamp
Q from newbie:

Just got a basic stamp homework board from a radio shack going out of business (bummer), and immediately set to work on a robot. Very interesting controller here.

My question is: I'd like to interface it to a PC to, for example, download external EEPROM data or communicate via RC while the robot is roaming. I started experimenting with the SERIN/SEROUT commands, as I understand that if I write to PIN 16, that would use the onboard serial connector (?) and started trying to figure out corresponding VC++ code, but feel like I'm reinventing the wheel. Does anyone have sample VC++ code and the corresponding PBASIC commands that would get the PC talking to the stamp?

Many TIA,
Craig

Comments

  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-06-05 16:10
    When you send serial data out of pin 16 (the dedicated serial I/O) you can use something as simple as Hyperterminal to see the data.

    As far as C++, visual or otherwise, you simply need to determine the port you are trying to get the communication from, and pull serial data accordingly.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • Craig NCraig N Posts: 17
    edited 2006-06-05 18:42
    Well, that definitely demonstrated that I can send data from the stamp to the PC! Guess I need to figure out the VC++ code now [noparse]:)[/noparse] Many thanks,
    Craig
  • RGuyserRGuyser Posts: 90
    edited 2006-06-05 19:04
    craig,

    if you are not set-on C++, there are several articles in nuts n volts about using visual basic and a stamp..

    in addition, there is probably quite a bit out there on using c++ for serial communication in general..
  • Craig NCraig N Posts: 17
    edited 2006-06-05 19:12
    Not set on C++... just tried to get RS232 working in Ruby [noparse];)[/noparse] Believe it or not, I never learned Visual Basic, but I'll bet I can get a general idea of the serial API by looking at those examples...

    Here's a really interesting Q: has anyone got TCP/IP working on a BASIC stamp?

    Again, many TIA,
    Craig
  • RGuyserRGuyser Posts: 90
    edited 2006-06-05 19:33
    craig. there is an addon product here somewhere, for sure. i also think i saw a TCP\IP stack for PIC microcontrollers. it may be worth looking into that, as the cost would likely be far lower than parallax's $100 option.. i would imagine tcp\ip will add quite a bit of complexity to your project unless you find some sort of tcp\ip to serial converter or something...

    there are several products that would help you.
  • RGuyserRGuyser Posts: 90
    edited 2006-06-05 19:35
    oh, also,

    i am certain the nuts n volts articles wil be handy even if you are not going to use VB. you can see how the stamp can be made to respond\transmit serial data, etc... also, i havent used c++, but i would imagine it has a way to access the windows mscomm32, like VB. the concepts and practices should be applicable.

    cheers.
  • Craig NCraig N Posts: 17
    edited 2006-06-05 19:56
    Eegads, just discovered PINK on the parallax site--probably worth the $100 just to have something that works the first time around and is well documented for the basic stamp. So... here's a thought... connect PINK to a little wireless ethernet hub and let the host PC communicate with it remotely. This could be mondo fun. Anybody see any immediate design flaws?

    Hardware question: in the PINK manual (http://www.parallax.com/dl/docs/prod/comm/30013-PINK-v1.02.pdf bottom of page 2), the interface pins are connected to the wires by what looks like jumpers--a really elegant solution to a problem I've had over the years trying to connect those two things without, to date, a satisfactory solution. Is that what it is? If so, where do you get jumpers like that?

    Many TIA,
    Craig
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-06-05 20:24
    Those are wires with female sockets on one end, and pins on the other end.

    If you are looking for TCP/IP stacks, there is also a stack for the SX- but really you should move to chips designed for TCP/IP if this is the direction that you are heading...

    You can either make wires like that (just crimp & heatshrink on the 'socket' ends)- or with some looking around you can find them via Google...I'm not sure where we get them.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • HarborHarbor Posts: 73
    edited 2006-06-05 20:37
    Craig N said...
    Anybody see any immediate design flaws?

    Hardware question: in the PINK manual (http://www.parallax.com/dl/docs/prod/comm/30013-PINK-v1.02.pdf bottom of page 2), the interface pins are connected to the wires by what looks like jumpers--a really elegant solution to a problem I've had over the years trying to connect those two things without, to date, a satisfactory solution. Is that what it is? If so, where do you get jumpers like that?
    No design flaws. Works fine. I'm using a PINK in my current project. There is sample code and a couple of scripts on the Parallax site... No, I tell a lie. It's a post here on the forum that provided those scripts to let a Windows box send and receive from the PINK.

    The hardware connection is basically just a jumper wire, but Parallax includes a very nicely designed set of wires for the purpose. Been meaning to see if I can buy a couple of dozen extras for other purposes. They have a square female connector soldered on each end, and one end they inserted a matching double male connector pin. The male pin fits nicely into breadboard holes and the female connector accepts the standard pins on IC's and what have you. I'm not sure why this was used in lieu of the usual 28 ga jumper wires but I like it better on the whole. Probably for the female connector to attach to pins. Nice job, Parallax.

    The only drawback with the PINK is that you only get into the comm stack at two levels: high level HTML and the very low level User Datagram Protocol. (Actually, you can send e-mail too, but you can't receive it, just send.) So the pink was conceived as a way to let your stamp display data to the world at large, and accept inbound entries from people using the html 'post' protocol. Using it for computer-to-computer stuff you have to drop clear down to the UDP level and that adds to the coding work a little. Nevertheless, it's well worth the price as you said, and the extra work as well. Tying it to a wireless hub will work fine.

    Incidentally, if you have a PINK on each of two Stamps, they can exchange UDP quite easily. The extra work comes when you want to talk to Linux boxes because there are no directly applicable UDP scripts I can find. Someone did find or craft such scripts for Windows as I said. I'll try to look those up this morning and edit this post to include a link.

    Update: This thread discusses the subject and includes UDP scripts for Windows:
    http://forums.parallax.com/showthread.php?p=556951

    Post Edited (Harbor) : 6/5/2006 10:16:26 PM GMT
  • Craig NCraig N Posts: 17
    edited 2006-06-05 20:49
    Wow, thanks for the detailed post, Harbor. Looks like it will be sufficient for my robot to talk to my PC. If you don't mind, I'd like to be able to email you in the future when I'm playing around with the PINK (just ordered it online). Could you please send an email to me at my att.net address (username craigni)?

    Ironically, I *did* get 2 basic stamps, as they were so cheap at the Radio Shack going out of business.

    Many, many thanks,
    Craig
  • RGuyserRGuyser Posts: 90
    edited 2006-06-06 02:39
    ive seen the wires on a page selling microcontroller development products. possibly melabs website. possibly the basicx stie(or both)
Sign In or Register to comment.