Shop OBEX P1 Docs P2 Docs Learn Events
New to Propeller -- s/w UART capabilities? — Parallax Forums

New to Propeller -- s/w UART capabilities?

propelliflypropellifly Posts: 25
edited 2011-09-03 07:29 in Propeller 1
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?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-01 09:00
    "Is ViewPort the logical starting point for a newbie?" ... It all depends on what you already know and what you want to do with your development board. ViewPort is an excellent tool for looking at what a program is doing with its variables and for monitoring I/O pins. As such, it's a very useful debugging tool for some kinds of programming.

    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.
  • propelliflypropellifly Posts: 25
    edited 2011-09-01 09:29
    Mike Green wrote: »
    "Is ViewPort the logical starting point for a newbie?" ... It all depends on what you already know and what you want to do with your development board. ViewPort is an excellent tool for looking at what a program is doing with its variables and for monitoring I/O pins. As such, it's a very useful debugging tool for some kinds of programming.

    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!
  • HannoHanno Posts: 1,130
    edited 2011-09-01 10:36
    Welcome to the fabulous world of the Propeller!

    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
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-01 10:56
    propellifly,

    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
  • propelliflypropellifly Posts: 25
    edited 2011-09-01 11:33
    Hanno wrote: »
    Welcome to the fabulous world of the Propeller!

    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

    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!
  • propelliflypropellifly Posts: 25
    edited 2011-09-01 11:34
    Duane Degn wrote: »
    propellifly,

    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

    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.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-01 12:42
    propellifly,

    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
  • propelliflypropellifly Posts: 25
    edited 2011-09-01 13:00
    Duane Degn wrote: »
    propellifly,

    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. :)
  • propelliflypropellifly Posts: 25
    edited 2011-09-01 13:09
    Weird, I wonder why the Propeller Tool can open Tim Moore's pcFullDuplexSerial4FC .spin file, but I can't read anything in vim?

    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?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-01 13:15
    As I mentioned earlier, the 4-port driver can provide 3 ports at 115.2K per cog. If you can allocate 3 cogs, you could have 9 x 115.2K ports. 1 for ViewPort and 3 for your application still leaves 1 free for something else like a TV driver for additional help with debugging or status messages although ViewPort can do a lot of that.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-01 13:16
    I forgot to order a wall wart
    You've got to have something around that will work.

    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
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-01 13:27
    but I can't read anything in vim?

    Sorry, I don't know what you mean by "vim"?
    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?

    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
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-01 13:36
    Propeller development board

    Is the board you ordered the Propeller Professional Development Board? If not what board did you order?
    now I also need a MAX232 to interface with my PC

    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
  • rokickirokicki Posts: 1,000
    edited 2011-09-01 14:20
    Weird, I wonder why the Propeller Tool can open Tim Moore's pcFullDuplexSerial4FC .spin file, but I can't read anything in vim?

    By default spin files are stored in UTF-16. You can open them in vim by first converting them to UTF-8.
  • max72max72 Posts: 1,155
    edited 2011-09-01 14:36
    around the forum there is also a vim syntax.
    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
  • propelliflypropellifly Posts: 25
    edited 2011-09-01 20:43
    Thanks for the responses, guys! Gonna check out the vim syntax now. :)
  • RS_JimRS_Jim Posts: 1,768
    edited 2011-09-02 06:17
    propellifly,
    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
  • propelliflypropellifly Posts: 25
    edited 2011-09-03 07:29
    Thanks Jim. I was surprised that I ordered the PS on Thursday and received it the following day. I wanted to place an order anyway, since I really wanted a QuickStart to bring with me on a trip. That other dev board I have is a little too large. :)
Sign In or Register to comment.