18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

supply. <strong>The</strong> chip requires an additional inductor and capacitor, plus two resistors to set the<br />

output voltage. Maxim’s data books have more details about this and similar chips.<br />

Storing Programs on Disk<br />

With BASIC-52’s ability to store programs in on-board memory, disk storage isn’t necessary.<br />

But storing programs on the host system’s disk is convenient, since you can save as many<br />

programs as you want without worrying about running out of program memory. Since the<br />

programs are stored as ASCII text, you can write or edit them with any text editor, and then<br />

upload them as needed to the target system.<br />

Most communications software allows you to upload and download files. In Procomm Plus,<br />

you use the PGUP and PGDN keys. In the Windows Terminal Accessory, use the Transfers<br />

menu.<br />

Uploading to the 8052-BASIC System<br />

When you upload a program to the 8052-BASIC system, you have to ensure that BASIC-52<br />

has enough time to process each line before the next one arrives. If there isn’t enough time,<br />

you’ll have missing characters or lines in uploaded programs. <strong>The</strong>re are a couple of ways<br />

to ensure that your uploads are complete.<br />

Most software allows you to add delays after each transmitted line or character. You can<br />

experiment with different values to find the shortest delays that allow you to upload reliably.<br />

If you keep your program lines short, the delays between lines can be shorter.<br />

If these options aren’t available, try using a slower baud rate, which gives BASIC-52 a little<br />

more time to process each line before the next one arrives.<br />

Downloading to the Host Computer<br />

Saving Programs<br />

To download a BASIC-52 program from the target’s RAM to the host’s disk, type LIST<br />

to list the current program, but before you press ENTER to execute the command, set up your<br />

host’s software to download, or receive, an ASCII file. When prompted, specify a filename.<br />

When the transfer is ready to go, press ENTER to send your program to the host. When you<br />

see the READY prompt, end the transfer by whatever means your software requires. (In<br />

Procomm Plus, press ESCAPE.) You should now have a file on disk containing the program<br />

you just listed.<br />

You can test your download by erasing the program in the 8052-BASIC system’s RAM, and<br />

then uploading it back into RAM.<br />

<strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong> 63

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!