Multiple RS-232 Ports?
artkennedy
Posts: 174
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?
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
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.
6 PropForth Input/Output. Fog clearing a bit. I'll get back to you.
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
[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?
BTW, is this a proper use of a thread - replying to myself seeking a response?
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.
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.
: 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.