このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


Pascalite 金物類/武器類: First Steps HOME - - - - - - Other 構成要素 for programmers - - - - - - Pascalite 金物類/武器類 "How To.." Main Page

Pascalite 金物類/武器類: First Steps


First Steps with Pascalite

This page covers, I hope in beginner-friendly 詳細(に述べる), all the "fun" things you need to go through the first time you use your shiney new Pascalite 金物類/武器類.



This 構成要素 (c) T K Boyd, 3/03. I hope you will 設立する links to this for me... but please do not re-分配する it. It is for your personal use. If you are a teacher, please feel 解放する/自由な to make 適切に credited copies for use by your own pupils until August 2004, at which time the license lapses. Please revisit this 場所/位置 to see how things stand then.


This is written 特に for the Pascalite 加える, and ソフトウェア 見解/翻訳/版 2.60C... but much of what appears here will 適用する 平等に to the other Pascalites and other 見解/翻訳/版s of the ソフトウェア.

I 嫌疑者,容疑者/疑う most 使用者s will already have the ソフトウェア 任命する/導入するd, but just in 事例/患者, I'm starting from scratch with these 公式文書,認めるs.

I have tried to cover things that neophytes will need to know. Let me know if you were left without an answer to something. Experienced 使用者s: Please be 患者?!

I have no formal 関係 to 支配(する)/統制する 加える, though I hope, through this and other 成果/努力s to build up some "good will" credit with them!

====
First, 始める,決める up the PC which is going to be used for programming your Pascalite. This machine will be called the 開発 PC in the 残り/休憩(する) of this.

I used an old Toshiba 100CS 衛星 that cost me &続けざまに猛撃する; 75. You'll need a 解放する/自由な serial port, either a 9 pin one, or you'll need a 25->9pin adapter. (Assuming you bought the very reasonably 定価つきの cable 供給(する)d by 支配(する)/統制する 加える. You could, of course, (不足などを)補う your own 9 pin (Pascalite end) to 25 pin cable.

Besides 実験(する)ing the 業績/成果 of a system 始める,決める up at the time of receiving my first Pascalite, I've also 確認するd that it 作品 罰金 on a system which was 始める,決める up with the 解放する/自由な compiler and simulator download. (If you have that on your machine already, you still need to 始める,決める up the 環境 選択s, as desribed below.

The Pascalite レコード I received 2/03 had a 基準 Windows "体制/機構.exe" which behaved nicely when I ran it... 許すd me to say where I 手配中の,お尋ね者 the ソフトウェア 任命する/導入するd. As I remember it, the download from the 逮捕する was also 井戸/弁護士席 behaved. I 任命する/導入するd the program where I 手配中の,お尋ね者 it (C:\Program とじ込み/提出するs\Pascalite) rather than in the default folder, and had no 悔いるs.

See my Pascalite ソフトウェア tutorials for 公式文書,認めるs on what the ソフトウェア should do, even without the 金物類/武器類.... Or just keep reading... we'll be using it すぐに...

====
The に引き続いて 試みる/企てるs to take you through a 始める,決める of 演習s and 実験(する)s which will...

     a) Introduce you to your Pascalite
     b) 実験(する) it in a 論理(学)の and "first things first" sequence.

Unplug anything that may be plugged into your Pascalite board.

Organise your 力/強力にする 供給(する). This needs to be 7-15v DC, 500mA; it doesn't need to be 規制するd. If you are (as you probably should) using a procket to connect the 力/強力にする to the board, the outer sleeve should be 0 volts, and the central 穴を開ける 肯定的な.

Plug your 力/強力にする in to your board. Use a voltmeter to check that 5 volts appears across the pins 示すd "GND" and "5v" on the 26 way (2 x 13) 始める,決める of pins. The first psu I tried on it out of my junk box SEEMED to 会合,会う the specs... but I was only getting 4.3v. A different PSU worked okay... mystery not 解決するd at this time... but it is very likely the problem is with the PSU.

(An aside: Look at the underside of the Pascalite board. You will see that the pins of the 2 x 13 header are connected in pairs: pins 1 and 2 are for "Cnt", pins 3 & 4 are for D7, etc.)

You can also 力/強力にする the Pascalite with an ordinary 9v 殴打/砲列.

関わりなく your 力/強力にする source, I would recommend 会社にする/組み込むing an on/ off switch... not just because I try to be tidy-minded, but also because you やめる often have to reset the 装置 with a 力/強力にする off / on cycle when you are doing repeated programming. (Most of us have to program and RE-program a few times to get something to where we want it. Incremental 開発 is a good thing.... and we いつかs 落ちる prey to indulge in "poke and hope" debugging, which always 追加するs "try again" cycles!)

On the 開発 PC, start the Pascalite 統合するd 開発 環境 (IDE).

Invoke とじ込み/提出する|New|Empty

Enter

program IntTut1;
begin
def_out(d0);
repeat
始める,決める(d0);
延期する(200);
reset(d0);
延期する(200);
until 4=5;
end.
(Yes, I know there's an extra 半分-結腸 in that! See どこかよそで for 詳細(に述べる)s of Pascal programming. For now.. just do it!)

Save your program. You can use whatever 指名する you like. I'm using IntTutn for these: "Introductory Tutorial"n. I'd 示唆する making a folder called Pascalite in your My 文書s folder.

Invoke 道具s| ふりをする Program (or just 圧力(をかける) F2!).

Once you've 直す/買収する,八百長をするd all typos (!), and it 収集するs, other windows will open. Above the window where you entered the program's source code, a new 妨げる/法廷,弁護士業 of icons will have appeared. Click on the green, 権利-pointing triangle. In the 模擬実験/偽ること window, you should see LED d0 winking on and off.

Click the grey square to stop the program.

======
So far, so good. Now to make it work in the real Pascalite. Good old RS-232! If you were working with computers 支援する then, you'll know what I mean. If not, you may find out. But at least it has a lot いっそう少なく to go wrong than modern machines!! If you have trouble with this element of the 一括, it will only be once, and will be your biggest difficulty.

Invoke the Pascalite IDE 選択s|環境 window.

On the Compiler tab...

始める,決める the Microcontroller 見解/翻訳/版
始める,決める "陳列する,発揮する size" if you are going to be using an LCD module.

On the Communication tab, 始める,決める the Comm port. (Probably Comm 1 or Comm 2). If you're using a serial mouse, and it goes mad, use the other one!)

On the Editor tab... you don't need to do anything!

Now you need to make Windows settings. Either 権利 click "My Computer", and click on "所有物/資産/財産s", or, if you prefer going through the Start Menu: Settings | 支配(する)/統制する パネル盤 | System | Ports:

The comm port you are plugging the Pascalite into needs the 権利 速度(を上げる), etc. For my Pascalite PLUS: the に引き続いて worked: 57600 bits per second, 8 data bits, parity 非,不,無, stop bits 2, flow 支配(する)/統制する: 非,不,無. (You may be able to get away with one stop bit, but 2 is safer.)

Have a look in the "金物類/武器類 / ソフトウェア" 手動式の at the end of section 3.1 (pg. 8 in my copy) There is some advice about ASCII values greater than 127 and the 可能性 of overwriting programs. I 港/避難所't yet fully 人物/姿/数字d this advice out, but I have been happily downloading programs to my Pascalite without 出来事/事件.

Connect the Pascalite to the 開発 PC with a RS-232 crossover cable. I hope you bought the one 支配(する)/統制する 加える 申し込む/申し出s? At that price, why struggle? I'll try to 追加する a pin-out to this page. 令状 if you want it.
圧力(をかける) f9 to comile your program and send it to the Pascalite. (Or go through the menu: 収集する | Sent to Microcontroller. (There's no need to ask the ソフトウェア to 収集する it before sending... it will do that automatically.)

You should get sensible messages on the 審査する as things 進歩.

If you get error messages, don't panic. See "Troubleshooting" in the 金物類/武器類/ソフトウェア 手動式の. Even before you do that, try unplugging the 力/強力にする to the Pascalite 簡潔に and 圧力(をかける)ing f9 again. (いつかs the communication between the 装置s doesn't sync 権利 the first time.)

Hopefully, you will 結局 see: "とじ込み/提出する IntTut1.pas is downloaded successful" and three buttons. Click on start. You won't see anything wonderful yet.

Connect an LED to a resistor. I used a 1K2 resistor with a green LED. (It was a bit too big, the LED is faint. But it keeps the drain on my 殴打/砲列 to a 最小限, and it was what I had to 手渡す! You can use other color LEDs and, within 推論する/理由, other resistor values. (I may 追加する 詳細(に述べる)s later). For this next thing, you don't need to do a "proper" 関係... just be careful not to short any pins!!: Try your LED + resistor between GND and 5v (Pins 25 and 11 of the 2 x 13 pin header.) If the LED glows, good. If not, try turning your LED + resistor around the other way. It won't 事柄 if you 大(公)使館員d it backwards. It doesn't 事柄 which 味方する of the LED the resistor is on, but it DOES 事柄 that the resistor is in series with the LED. I.e.: GND - resistor - LED - 5v, or GND - LED - resistor - 5v.

NB: The pages in the 手動式の giving which-pins-connect-to-what-signal are 平易な to 混乱させる, and the 関係s for a Pascalite プロの/賛成の are NOT the same as for a 加える. Once you have the 権利 page....

When you know which way '一連の会議、交渉/完成する your LED + resistor 作品, attach the end that was connected to ground to d0 (Pascalite 加える: pins 19 & 20), and the other end to GND (無 volts). (Pascalite 加える: pins 25 & 26)

(NOTE TO MYSELF: WRITE UP GP TESTS BOARD)

Now you should see the LED winking on / off / on / off ! ! (On time: about a fifth of a second. Also off time.)

If you have any 疑問s about why the program does what it does, try to change it to give an on time of half a second (延期する(500)) and an off time of a tenth of a seond. You can do it!

I lied. (Above). You could probably get away with connecting the LED between d0 and GND, without the resistor. The 推論する/理由? The Pascalite has resistors between the pins on the 半導体素子 and the pins on the 2x13 connector. That is part of the 推論する/理由 that my "reasonable" 1K2 現在の 限界ing resistor was too big. So FOR A PASCALITE: you can get away with "no" (extra) resistor, if the onboard resistor is big enough for your needs. Don't think that in general you can attach LEDs without 現在の 限界ing resistors.

======
Moving on....

除去する the 力/強力にする from the Pascalite.

Connect a momentary switch to d4. Connect the other 味方する of the switch to GND. Also connect d4 to an 18K resistor. (Other values would do... c. 5k 最小限, 50k max). Connect the other 味方する of the resistor to 5v.

(NOTE TO MYSELF: SORT OUT "extra" resistors on Pascalite)

Now 令状, 収集する, and download the に引き続いて:

program IntTut2;
var bInp:byte;
begin
def_out(d0);
repeat
read(portd, bInp);
if (bInp and 16)=16 then reset(d0) else 始める,決める(d0);
until 4=5;
end.
圧力(をかける) the switch and the LED goes on; 解放(する) switch and LED goes off.

read(portd,bInp) fills the variable bInp with 1s and 無s depending on what is connected to d0,d1,d2...d7. Even though you can 令状 to a 選び出す/独身 bit, you have to read all 8 bits to find out what is in any of them. (公式文書,認める that the pins are numbered from 無. The first pin is "d0".)

"bInp and 16" returns either 0001000 (binary... which equals 16), or 00000000, depending on what was in the 5th bit of bInp, which, after read(portd, bInp) will in turn depend on what the voltage of pin d4 was.


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
Search this 場所/位置 or the web 力/強力にするd by FreeFind

場所/位置 search Web search

広告 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
Link to editor's Sheepdog ソフトウェア ™ page
How to email or 令状 this page's editor, Tom Boyd