13.07.2015 Views

X25640_8Kb_Serial_EE.. - ISL

X25640_8Kb_Serial_EE.. - ISL

X25640_8Kb_Serial_EE.. - ISL

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.

Using the Xicor <strong>X25640</strong> 8kB <strong>EE</strong>PROMBASIC Stamp II Program Listing (cont)' Write-protect (disable) the <strong>EE</strong>PROM.<strong>EE</strong>disable:low CSshiftout DATA_N,CLK,msbfirst,[WRDI]high CS' Deactivate the <strong>EE</strong>PROM.return' Write data to the <strong>EE</strong>PROM. Use the address in <strong>EE</strong>addr' and data in <strong>EE</strong>data.<strong>EE</strong>write:low CS' Activate the <strong>EE</strong>PROM.shiftout DATA_N,CLK,msbfirst,[Write<strong>EE</strong>]gosub Send_addr ' Send the address.shiftout DATA_N,CLK,msbfirst,[<strong>EE</strong>data]high CS' Deactivate the <strong>EE</strong>PROM.return' Read data from the <strong>EE</strong>PROM. Use the address in <strong>EE</strong>addr;' put data into <strong>EE</strong>data.<strong>EE</strong>read:low CS' Activate the <strong>EE</strong>PROM.shiftout DATA_N,CLK,msbfirst,[Read<strong>EE</strong>]gosub Send_addr ' Send the address.shiftin DATA_N,CLK,msbpre,[<strong>EE</strong>data]high CS' Deactivate the <strong>EE</strong>PROM.return' Send the address for a read or write.Send_addr:shiftout DATA_N,CLK,msbfirst,[<strong>EE</strong>addr\16]return' Read the <strong>EE</strong>PROM status register.Read_stats:low CSshiftout DATA_N,CLK,msbfirst,[RDSR]shiftin DATA_N,CLK,msbpre,[<strong>EE</strong>stats]high CS' Deactivate the <strong>EE</strong>PROM.return' Activate the <strong>EE</strong>PROM.' Send the disable opcode.' Send write opcode.' Send the data.' Return to program.' Send the read opcode.' Send the data.' Return to program.' Shift the address out.' Return to program.' Activate the <strong>EE</strong>PROM.' Send read-status opcode.' Get the status register.' Return to program.sales / technical support (916) 624-8333 • fax (916) 624-8003pictech@parallainc.com • stamptech@parallaxinc.com Page 11

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

Saved successfully!

Ooh no, something went wrong!