Shop OBEX P1 Docs P2 Docs Learn Events
Multiple RS-232 Ports? — Parallax Forums

Multiple RS-232 Ports?

artkennedyartkennedy Posts: 174
edited 2014-01-16 07:33 in Propeller 1
Seeking advice here to decide if the Propeller system is where I want to be for this project.

Project: Controller for Data Collection and Control

I plan to use a micro controller system to interface between the following 4 three elements:
1- Array of AD590 temperature sensors ( to be switched by I/O pins )
2 - Protek 506 DMM with RS-232 port
3- HP48g+ calculator with RS-232 compatible port
4- X10 powerline modem via RS-232 interface

The crux of the matter is to use a controller which will provide a convenient means to access three separate RS-232 ports.

Wisdom anyone?

Comments

  • dbpagedbpage Posts: 217
    edited 2013-08-07 10:10
    Try the fullDuplexSerial4port object ... http://obex.parallax.com/object/248
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-08-07 10:12
    This will be a cakewalk for the Propeller. You'll need to convert the RS-232 to a 3.3V signal with transistors or a chip like MAX3232.

    There's a serial driver that lets you communicate with up to four serial lines with a single cog.

    There will be plenty of cogs left over to do the other things you want.

    I use the Prop to gather data from four serial device regularly.

    Edit: Dennis not only bet me at typing but his link works. (I just fixed mine (it's to the same driver).)

    Edit: Here's the thread discussing the object.
  • artkennedyartkennedy Posts: 174
    edited 2014-01-09 13:54
    Thanks. I have some experience with forth on a New Micros Inc board but I have been away from board and code hacking for a while and am very new to the Propeller. Been digging in the past few days. Now understand that propforth is running as a spin object on one cog and other spin objects can be running on other cogs to handle things like serial comm. The next thing to understand is how to access send and receive with the cogs running the serial comm from the propforth project cog. I am going to dig on that now. Hints welcome.
  • artkennedyartkennedy Posts: 174
    edited 2014-01-09 14:37
    Ok, just read
    6 PropForth Input/Output. Fog clearing a bit. I'll get back to you.
  • artkennedyartkennedy Posts: 174
    edited 2014-01-09 14:59
    I'm back to being confused. I see in the doc discussion of the "fl" word. The listing of cog? shows
    5(0)->7(0)
    6(0)->5(0)
    7(0)->6(0)
    but when I follow along I get
    6(0)->7(0)
    7(0)->6(0)
    The doc does not explain how the cogs got cross linked like that.

    Also: cog? shows PropForth running on cogs 0-6. Or am I understanding that wrong?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-01-09 15:14
    Hi Art;
    artkennedy wrote: »
    I'm back to being confused. I see in the doc discussion of the "fl" word. The listing of cog? shows
    5(0)->7(0)
    6(0)->5(0)
    7(0)->6(0)
    but when I follow along I get
    6(0)->7(0)
    7(0)->6(0)
    The doc does not explain how the cogs got cross linked like that.

    Also: cog? shows PropForth running on cogs 0-6. Or am I understanding that wrong?

    fl is a special serial loading word that ignores echoing so loading errors don't occur.

    I suggest you start up a new thread with PropForth in the title.
    The Professor is the guru in all things forthian. He will find you.

    Duane J
  • artkennedyartkennedy Posts: 174
    edited 2014-01-09 15:20
    Is this an error in the doc?
    [h=3]9.1.177 cognchan[/h]\ cognchan ( n1 -- n2 ) number of io channels for cog n2

    Should be "number of io channels for cog n1" - right?
  • artkennedyartkennedy Posts: 174
    edited 2014-01-09 16:16
    What is the significance of the dictionary words that begin with a leading underscore? I notice that some of them have near duplicates without the _ ?

    BTW, is this a proper use of a thread - replying to myself seeking a response?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-01-09 16:24
    artkennedy wrote: »
    Seeking advice here to decide if the Propeller system is where I want to be for this project.

    Project: Controller for Data Collection and Control

    I plan to use a micro controller system to interface between the following 4 three elements:
    1- Array of AD590 temperature sensors ( to be switched by I/O pins )
    2 - Protek 506 DMM with RS-232 port
    3- HP48g+ calculator with RS-232 compatible port
    4- X10 powerline modem via RS-232 interface

    The crux of the matter is to use a controller which will provide a convenient means to access three separate RS-232 ports.

    Wisdom anyone?

    Sounds like an easy job for Tachyon Forth, even without a 4port serial object this is easy enough to do in Forth especially if the serial is of the command/response type as you can mux this one at a time. BTW, you can get away with compatible RS232 ports yourself, just use inverted logic level. For sure the DMM and HP48 are logic level anyway and the X10 will probably just use a standard RS232 chip in it so it will be logic level compatible too. Just use 100k resistors to your Prop pins for receive.

    Tachyon is very fast (250K serial) as it is and avoids having to do anything in assembler which hasn't already been built into the kernel.
  • artkennedyartkennedy Posts: 174
    edited 2014-01-12 23:34
    I think I am in over my head here. I know a lot more about Forth than I do about the Propeller platform. I need to back up and learn the basics of the system and .spin objects before trying to get fancy in Forth. Bye for now.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-13 01:38
    Yeah, that PropForth example is not the easiest to comprehend. It does work, but it is just running data in circles internal to one Propeller.

    If you require multiple RS232 ports, try to explain how many you desire and how they will work together. Then someone can help out.

    Either you will have one RS232 port distribute data to others and collect data from others; or you will likely have pairs that are doing some sort of modification and retransmission.

    Thinking about this topic in the abstract is not going to be very rewarding.

    Prof Braino is the resident PropForth mentor and sorts out all the document errors and omissions, percieved and real.

    fl is short for Fastload and the looping through added cogs is trying to create a buffering mechanism to prevent the loading from being over-run by the fast baudrate of the load. Historically 'fl' has had problems with working 100% of the time... the larger the load, the more risk that it will ultimately fail. There has been work in progress to perfect a better fastload, but I am not sure of the current status.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-01-13 03:24
    artkennedy wrote: »
    I think I am in over my head here. I know a lot more about Forth than I do about the Propeller platform. I need to back up and learn the basics of the system and .spin objects before trying to get fancy in Forth. Bye for now.
    That sounds a bit like learning French to order a cheese burger and french fries in English. Just stick to Forth then at least for the present. In Tachyon Forth you already have serial support for each cog as you have SERIN and SEROUT just like in PBASIC but there are other ways too (such as the default TX with an output mask). It's a simple matter to redirect KEY and EMIT to use these definitions the way you want to.
    : SEROUT2 #P8 SEROUT ; \ Use P8 as COM2 transmit
    : SERIN2 #P9 SERIN ;
    : COM2 ' SEROUT2 uemit W! ' SERIN2 ukey W! ;
    To redirect serial to COM2 you just invoke COM2 and KEY and EMIT will use this method. CON is the default serial I/O channel.
    COM2 ." Output now directed to COM2!"
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-01-15 23:35
    That sounds a bit like learning French to order a cheese burger and french fries in English. Just stick to Forth then at least for the present. In Tachyon Forth you already have serial support for each cog as you have SERIN and SEROUT just like in PBASIC but there are other ways too (such as the default TX with an output mask). It's a simple matter to redirect KEY and EMIT to use these definitions the way you want to.
    : SEROUT2 #P8 SEROUT ; \ Use P8 as COM2 transmit
    : SERIN2 #P9 SERIN ;
    : COM2 ' SEROUT2 uemit W! ' SERIN2 ukey W! ;
    To redirect serial to COM2 you just invoke COM2 and KEY and EMIT will use this method. CON is the default serial I/O channel.
    COM2 ." Output now directed to COM2!"

    @Art: So what did you think of these methods? I don't think it could get any simpler. Of course you would name the port after the device so that you could just redirect with the words DMM, HP48, and X10 etc.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-16 07:23
    Art seems to be chasing PropForth for now. But I will mention that you would like a reply.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-01-16 07:33
    Art seems to be chasing PropForth for now. But I will mention that you would like a reply.
    Just giving him the opportunity as I am sure he is well aware although I don't "need" a reply myself. We sometimes feel like a vending machine but instead of a coin it's a kick ;)
Sign In or Register to comment.