04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

READ<br />

<strong>Syntax</strong><br />

read address, databyte<br />

Commands<br />

• Address - is a byte sized variable or constant that specifi es what address to read the on-board<br />

EEPROM from.<br />

• DataByte - is a byte sized variable (0-255) which stores the data returned from the on-board<br />

EEPROM.<br />

Supported<br />

• BA - supported<br />

• BAN - supported<br />

• BAP - supported<br />

• BAP40 - supported<br />

Description<br />

All modules except the <strong>Basic</strong>ATOM Pro 24 and <strong>Basic</strong>ATOMPro ONE come with built in EEPROM.<br />

The READ / WRITE commands were created to access the built-in memory. READ will read a single<br />

byte from the built in EEPROM at the address specifi ed in the command.<br />

Notes<br />

1. The AtomPro24 does not have built in EEPROM. An external 32kbit or larger eeprom can be<br />

added. Connect the EEPROM SCL pin to P10 and the EEPROM SDA pin to P11 with a 10K pull<br />

up resistor. The address pins on the EEPROM (A0,A1 and A2) are tied to ground.<br />

2. READ will only read one byte at a time. To read multiple locations a simple loop can be used or<br />

see READDM.<br />

Example<br />

The example program will write the string “Hello” starting at the fi rst location to the on-board<br />

EEPROM. Next, it will read the EEPROM locations 0 to 10 and print the contents to the terminal<br />

window.<br />

index var byte<br />

char var byte<br />

write 0,”H”<br />

write 1,”e”<br />

write 2,”l”<br />

write 3,”l”<br />

write 4,”o”<br />

for index = 0 to 10<br />

read index,char<br />

serout s_out,i9600,[char]<br />

next<br />

end<br />

169

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

Saved successfully!

Ooh no, something went wrong!