Pascalite 金物類/武器類: Using the RS-232 port
HOME
- - - - - - - - - Other 構成要素 for programmers
- - - - - - - - - Pascalite, "How To Use It" main page
Pascalite 金物類/武器類: Using the RS-232 port
Using the RS-232 port
The に引き続いて assumes you've got your Pascalite 始める,決める up and working. If it gives you what you want, 広大な/多数の/重要な. Be advised, however, that this page is subordinate to others. Visit my Pascalite, "How To Use It" main page if you (機の)カム drectly here and there are things "行方不明の".
(You can show numbers on the LCD if you have one, but the に引き続いて programs will also send at least part of every number to the four LEDs for those of you without an LCD 陳列する,発揮する.)
All along, we've been using the Pascalite's RS-232 port for communication with the 開発 PC. 罰金. But it can be used for other things, too... just not at the same time!
I have in mind setting up a Pascalite to 監視する some 天候 sensors. The Pascalite will pre-過程 those signals, and then 経由で the RS232 port, pass the digested data の上に a bigger PC which will スピードを出す/記録につける the data on a hard disk, and 陰謀(を企てる) a 陳列する,発揮する. I'm sure you could also 料金d stuff INto the Pascalite over the RS-232, but that's a 事業/計画(する) for another day. (That tutorial has been 草案d. Send me an email if you want to 急いで it's 外見 on the web....)
Here is the 必須のs of 令状ing out 経由で the RS-232.
Enter the に引き続いて program. Your Pascalite will need a momentary switch on d4, as in IntTut2.
program IntTutRS232;
var bTmp:byte;
begin
def_out(d0);
令状(LCD,255); {(疑いを)晴らすs LCD}
repeat
reset(d0);{turns LED off}
repeat
read(portd,bTmp);
bTmp:=btmp and 16;
until bTmp=0;
令状(RS232,"Hi");
令状(RS232,13,10);
始める,決める(d0);{turns LED on}
延期する(500);
until 4=5;
end.
When you run this program, it waits for you to 押し進める the button. When you 押し進める the button, it sends "hi" out on the RS-232 関係. It also sends 10 and 13, aka CR / LF, which will help with the 外見 of the data on the receiving computer.... a new line is started after each "Hi".
"BUT!," I hear you cry. "Where does it GO?" It's all 井戸/弁護士席 and good me telling you the program 作品. Can you see it? Yes.
If your 開発 PC doesn't already have Hyperterminal on it, put it on... Settings | 支配(する)/統制する パネル盤 | 追加する/除去する Programs, Windows 体制/機構 tab.
Start Hyper 終点 running.
とじ込み/提出する | New 関係
指名する it "Pascalite" (or other of your choice)
Skip over "Country code", etc, going to the last edit box on that pane, "Connect using", and make it "Direct to Comm 1" (or whatever Comm port you're using to send programs to the Pascalite.)
始める,決める the port as before: (For Pascalite 加える: 57600 / 8 /非,不,無 / 2 / No handshake)
If you have already 収集するd and downloaded the program above, try 圧力(をかける)ing the switch on d4. You should get "hi" in the Hyperterminal window each time you do.
If you have to program (or re-program) the Pascalite, you must first disconnect Hyperterminal from the comm port. There's a button for this, or you can use Call | Disconnect from the Hyperterminal menu. THEN you can download the new program to the Pascalite... same cabel, same 関係s, just 一時的に 献身的な to program download. Once the program is downloaded, you need to REconnect Hyperterminal. Again, there's a button, or you can use Call | Connect. The first time you の近くに Hyperterminal, it asks if you want to save the "開会/開廷/会期". You do: This is your Pascalite settings. The next time you open the Hyperterminal folder, you'll see Pascalite (or Pascalite.ht if you are not hiding 拡張s.) Doubleclick this to go straight into where you want to be.
The only "tricky" 面 of this is realising that the 関係 between the Pascalite ソフトウェア on the 開発 PC cannot 株 the RS-232 with the Hyperterminal link. Only one or the other can be active at one time. The Pascalite 関係 turns itself on, if the RS-232 is 解放する/自由な, when you ask to download a program, and turns itself off once the programmhas gone. You have to turn the Hyperterminal 関係 on and off "by 手渡す". 公式文書,認める that you do NOT have to turn the Hyperterminal program on and off each time.
The Pascalite end of dumb, handshake-いっそう少なく RS-232 communication is pretty 平易な. For (警察などへの)密告,告訴(状) of programming a Windows machine to talk with your Pascalite by something of your own 創造 in Delphi (as …に反対するd to just using Hyperterminal) see my Delphi tutorial on the 支配する of serial communication.
To search THIS 場所/位置.... (Go to the 場所/位置's above, and use their search buttons if you want to seach them.)...
Way to search this 場所/位置 without using forms
広告 from page's editor: Yes.. I do enjoy
収集するing these things for you... hope they are helpful. However..
this doesn't 支払う/賃金 my 法案s!!! If you find this stuff useful, (and you
run an MS-DOS or Windows pc) please visit my freeware and shareware
page, download something, and 循環させる it for me? Links on your page
to this page would also be 高く評価する/(相場などが)上がるd!
Click here
to visit editor's freeware, shareware page.
Link to editor's (Arunet) homepage
How to email or 令状 this page's editor, Tom Boyd