New to Propeller -- s/w UART capabilities?
propellifly
Posts: 25
Noob alert!
I have a Propeller development board, and would like to start playing with it. I should probably buy ViewPort and start with samples, but I'm curious about its ability to support multiple s/w UARTs @ 115.2k. Is this even feasible? I haven't seen anything mentioned other than several single UART half/full duplex implementations.
Is ViewPort the logical starting point for a newbie?
I have a Propeller development board, and would like to start playing with it. I should probably buy ViewPort and start with samples, but I'm curious about its ability to support multiple s/w UARTs @ 115.2k. Is this even feasible? I haven't seen anything mentioned other than several single UART half/full duplex implementations.
Is ViewPort the logical starting point for a newbie?
Comments
There's a 4-port UART driver in the Object Exchange. It can handle 3 ports at 115.2K and 4 ports at roughly 100K using a single cog. You can run multiple copies, one per cog, for more serial ports. Look at the comments in the source code for details of its capabilities. Even with the single UART per cog routines, you can usually run multiple copies, one per cog.
Thanks for the detailed response, Mike. I am all about debugging... call it a lack of programming skill (though I've been programming for several years), but I find that I inevitably end up in the debugger a lot, and thus favor those processors with nice tools. Perhaps getting the trial version is a good place to start, provided that I can dedicate the time to fully vet the product during the 30 day trial.
I completely missed the 4 port UART driver, so I'll head over to the Object Exchange now and have a look. Sure sounds like a fantastic solution right now!
Here's a review of ViewPort from Robot magazine:
http://www.parallax.com/Portals/0/Downloads/docs/article/ROBOT_ViewPort.pdf
I'm all about debugging myself- I wrote ViewPort to help me with my projects- initially a computer vision guided balancing robot powered by the Prop...
115kbps is no problem for the Propeller- ViewPort can transfer data at 2Mbps- full duplex to support streaming video, high speed sampling (up to 80Msps), Visual Studio debugging, etc...
Enjoy the Propeller- make sure to take advantage of these forums, lots of great people here!
Hanno
The four port object Mike Green suggested is a great object. It allowed me to free up several cogs in some of my projects.
I like to think I've improved upon a good thing. By rearranging the variables I was able to increase the rx buffer from 64 byte to 128 bytes at the cost of only a couple of longs. I also fixed the small bug (thanks to Tracy Allen) in the Dec method.
There are links to several other multi port serial drivers on the thread I just linked to.
I recently finished a project, helping someone merge serial streams by adding a prefix to indicate which serial line the transmission was from. This project uses up to eight serial ports.
I personally use the Propeller to log data from multiple serial ports for my day job.
Duane
Hanno, thanks for the extra info. Your projects were the first I had seen with the Propeller, which is what got me quite interested in the first place!
Duane, fantastic info, thanks a bunch. I am definitely going to pull up your project and have a look. What compiler do you use? I know, stupid question but so far ViewPort is the only thing I've heard about. Need to do more reading.
I usually use the Propeller Tool as a compiler. It's free, made by Parallax and can be downloaded from their website.
I also use Brad's Spin Tool (BST). It has a bunch of cool extra features. It's also free.
Duane
Thanks, downloading now. I am going to hold off on BST since it says to install the FTDI drivers first, but I forgot to order a wall wart with my Propeller development board so I can't connect it.
Anyhow, this is exciting, hopefully I can pick it up quickly.
Duane, you've done several ports before at 57.6k, but what are your thoughts on at least 8 ports at 115.2k? Just use less ports per cog? Maybe 2 per cog, leaving 1 for ViewPort and 3 for application logic?
You just need to make sure it's within the correct voltage range 7 - 12VDC. Make sure it's center positive. Most wall-warts have enough current capacity for low power projects.
I have used a bunch of wall-warts with my Propeller boards that were originally used for something else. I've use power supplies from RC battery charger, Nerf target launcher, several different cordless phones and a bunch of other devices.
If you have a wall-wart with the correct voltage and current rating but the connector is different then buy a package of "Size M Coaxial DC Power Plug" from Radio Shack (274-1569). Replace the plug on your wall-wart or use it with an appropriate battery pack.
Duane
Sorry, I don't know what you mean by "vim"?
Mike explained this well. One thing I'll add is if you're using more than one instance of a four-port serial driver, you want to save it as a different name and change something in the body of the code. (I think Tim gives instructions in his comments.) The Propeller Tool can tell if two objects are the same (even if they have different names) and will try to save space by reusing the same code. In this case we don't want the code to be reused since the code area is also used as tx and rx buffers.
Duane
Is the board you ordered the Propeller Professional Development Board? If not what board did you order?
Depending on which board you ordered, you might not need a MAX232(actually you'd want a MAX3232 for 3.3V com). The PPDB has a USB port as do several other Propeller boards.
The Propeller datasheet also includes a three transistor circuit for Prop to PC communication.
Duane
By default spin files are stored in UTF-16. You can open them in vim by first converting them to UTF-8.
http://forums.parallax.com/showthread.php?106949-spin-vim-syntax-file
http://forums.parallax.com/showthread.php?118328-Spin-syntax-definition-for-Vim
Under windows you always need the FTDI driver.
There are also other free languages available, but if you are looking for serial ports the 4 port serial object with all its variants is the way to go, and as far as I know it has not been ported to other languages.
Massimo
If you have a shortage of 7-9 voltage adapters, you can go to Radio Shack and get one with current capability running from 300MA to 1500 MA. The usual power plug on Parallax devices is the "M" plug. Set it for tip + and you are good to go!
Jim