Tutorial for interfacing a Propeller to a PC with VB 2008!
Microcontrolled
Posts: 2,461
After I had to prowl the internet for information on how to get this "Should be simple" task done, I decided to write a tutorial about it. Now others can learn to interface the Propeller to the PC and make cool PC apps that can continue to help Propeller programmers. I've spent all afternoon on it, so I hope you like it!
Thanks,
Micro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
Post Edited (Microcontrolled) : 5/25/2010 5:17:18 PM GMT
Thanks,
Micro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
Post Edited (Microcontrolled) : 5/25/2010 5:17:18 PM GMT
Comments
One suggestion - maybe attach it in PDF incase people don't have Office 2007+
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
Cheers [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
May the road rise to meet you; may the sun shine on your back.
May you create something useful, even if it's just a hack.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···································Fix it, if ain't broke!
D Rat
Dave Ratcliff N6YEE
Post Edited (ratronic) : 5/25/2010 7:50:24 PM GMT
@jazzed: Thanks! I spent so much time figuring this out myself that I figured I should let everyone else have an easy source.
@mikediv: Thank you! I hope it helps!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···································Fix it, if ain't broke!
D Rat
Dave Ratcliff N6YEE
I don't know if this will help..
I have found that using a timer to "recieve", is very helpfull.
Set up a timer tick event to ".readexisting", every tick it will "readexisting" Data, and update a Label or a textbox or whatever...
I set mine up to give a reading for RCtime, and also a Light to freq. converter.. (Wanna see it?)
Anyways, thanks MicroControlled, for the quick lesson in communicating with the Prop to PC. it was very helpfull to me,
It confirmed what I had discovered allready.. which is a good thing.
Also, (for the absolute newbie) make sure when you send a string to the Prop... TERMINATE THE STRING!! With a 0, or..
Prepare to spend hours hunting down the "bug"..
Oh and don't forget to put an "@" in front of the string pointer...That drove Me insane for a few hours hunting down that one... sigh...
This works, (@whatEverDataPointer)... this won't work (WhatEverDataPointer)... You WILL know what I mean...
All part of the fun I guess..
@ratroinc: Let me check it out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
Would you like to expand your work???
In Sphinx there is a simple ftp (file transfer protocol) that mpark has used. I started to split it out to a seperate Sphinx aware program (prop end) just like DIR. Michael has a C PC program that will do the ftp. Would you like to do the protocol in VB to extend SphinxOS ?
Another app would be to make a VT100 terminal in VB for the prop. Not all codes need to be supported.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
Here is some Working Code as written by a GrandMaster Carpenter...
Hey, What can I say,..·I can Cut and Paste with the best of them.
For Visual Basic recieveing, I use this..
What Visual Basic Recieves from the Propeller, is this...
I have no idea how to post Visual Basic Code, I will try to just attach the PCommunication Project.
And The Propeller File, is also named PCommunication..
IF the Two Programs are ran at the same time, AND the Prop. Pro. Dev. Board IS wired As woefully described.
It should function in all sorts of fun and entertaining ways, and indeed, the comm port, will "comport"...
Just Play around with them, and See what You can See, They were written by a Newbie, so a Newbie should
be able to sort it out..(LOL, I bet the Pro's Might struggle with it, at least, it will be a good laugh for them.)
As a Disclaimer, the code and comments, are written for Me, and Me alone, REGARD THEM AT YER OWN RISK.
Please, Feel Free to comment on My comment's, I would love to hear what any Pro would say of them.
Again, I am a Profesional·Carpenter, My day to day hand tools, are somewhat more Primative than a lap top,
and communication with a keyboard can be diffucult and awkward at best, at least·for Myself·that is..
Anyways, I will try My best to Post Up the Two Programs now.. I may need instruction on this.
Post Edited (Ttailspin) : 5/26/2010 3:28:24 AM GMT
Next step - if you are sending data you will find vb has trouble with bytes 128 to 255, so you have to convert that string into byte values if you want the full range of ascii values. This becomes relevant if you are sending binary files.
Reading values back can be done in lots of ways but a timer as already suggested is a good system. Check for bytes in the buffer several times a second, and then read in that number of bytes.
@Cluso, VT100 terminal is already done in visual basic, as is xmodem, and the more basic input and output of bytes.
@microcontrolled, if you like you can pull to bits the code I have that does all the above - smarthome.viviti.com/propeller down near the bottom just above the picture of wordstar is a link "IDE" and that contains a huge amount of vb code that can do all the things you want. The complicated part is simplifying it. Then of course, once you make it simple, it doesn't do what you want so you have to make it complicated again.
addit Sorry about that last bit, but I've just finished reading Catch 22 and the writing style is somewhat contagious!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Propeller Code
Timers are good if you need/want to poll the serial port. My opinion, use the DataReceived event.
Edit added project files
Post Edited (Mike G) : 5/26/2010 1:21:38 PM GMT
It was for a project I did a few months ago to control 4 120Vac circuits and cause a power interruption as specific points for very small amounts of time.
It shows how to use a separate thread to do the receiving·from the COMM port.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim Fouch
FOUCH SOFTWARE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
If you're having problem integrating in your own project, post your code for help. You have to "New" the serial port for the DataReceived event to wire up.
Post Edited (Mike G) : 5/27/2010 1:08:22 AM GMT