Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
C Programming for microcontrollers (Joe Pardue, 2005).pdf
Скачиваний:
260
Добавлен:
12.08.2013
Размер:
4.55 Mб
Скачать

Appendix 6: Motor Speed Control Wheel

Appendix 6: Motor Speed Control Wheel

287

Appendix 7: HyperTerminal

Appendix 7: HyperTerminal

This book origianally used HyperTerminal for PC communications, but some folks were so adamant in their revulsion of HyperTerminal that I had to finally admit that maybe this wasn’t just the pervasive hatred of MicroSoft, but was due to HyperTerminal itself. It is very hard to get set up and going properly and some folks said it was buggy and unreliable. I received permission from Br@y++ to use his terminal so that is the one shown in the Quick Start Section. The remaining sections still have illustrations from HyperTerminal, but you can and probably should use Bray’s Terminal since it is simple and lots of folks love it. Both are free.

Test Your Connection:

The Butterfly comes with built-in code that allows you to communicate with a PC COM Port to change “Your name”. This is a good way to see if your hardware is working like it should be.

Connect an RS-232 cable between your Butterfly and your PC as in Figure 10. Open HyperTerminal

On you PC taskbar GOTO Start, Programs, Accessories, Communications and click on HyperTerminal, then take a deep breath, because HyperTerminal was not really designed with your use in mind, so it can be confusing (but it IS free).

Where it asks for a new connection name, call it Thunderfly or something equally memorable, and select the least dorky icon you can find in the list. I favor the atom next to the phone, because it makes no sense whatever.

289

Appendix 7: HyperTerminal

The ‘New Connections Properties’ window opens and select the COM Port you are connected to:

If you don’t know what Com Port you are connected to:

Your computer’s manual will tell which COM Port you are using. But since you’ve lost your manual…

Click the start button

Click the settings button

Click the control panel button

(If you are using XP, hunt around, it’s all there somewhere)

In the control panel, click the System button

Depending on your OS, hunt for the Hardware panel, and then click the Device Manager button (Why does Microsoft have to do this differently on every OS?)

In the Device Manager, expand the Ports(COM & LPT)

If fortune smiles, you’ll only have one COM Port and it will be COM1.

If you have multiple COM Ports that aren’t being used, then go find that darn manual! Or look at you connections on the back of your PC and hope one of them is labeled, or just plug it in an guess which COM Port it is connected to. If you guess wrong, just try the next one COM1, COM2, COM3… until it works, and next time you buy a PC, put the manual somewhere that you can find it.

290

Appendix 7: HyperTerminal

Set the COM Port communications parameters:

Bits per second to 19200, data bits to 8, parity to None, stop bits to 1, and flow control to None

Click OK and the Properties Window appears, click the Settings tab.

291

Appendix 7: HyperTerminal

And the ASCII Setup button, and fill out that Window as below:

By now you are almost surely as sick of HyperTerminal as I am, but if you’ve done everything right (and if you are like me, you haven’t) you’re ready to program “Your Name” in the Butterfly.

On the Butterfly click the joystick down until you see NAME.

Click the joystick right to “ENTER NAME”

Click the joystick down to “DOWNLOAD NAME”

Center the joystick and press it. (By the way, do you know where the term ‘joystick’ comes from?) The message “WAITNG FOR INPUT ON RS232” appears on the LCD.

Return to the PC and HyperTerminal. Type ‘Hello world’ and hit enter.

292

Appendix 7: HyperTerminal

You’ll now see your message scrolling across the Butterfly LCD. If not, notice that you have three areas that you can mess up:

Soldering and connecting the RS232

Selecting the correct COM Port

Setting up HyperTerminal properly

So if its not working by this point go back and meticulously retry everything you can think of, including passing a dead chicken over the setup while chanting voodoo hymns. It took me a while to get all this running and I supposedly know what I’m doing, so don’t feel bad if this is a little harder than you might hope. (You get what you pay for)

293