| Swordfish Tutorial/Library - External EEPROM |
|
|
| Saturday, 04 April 2009 08:36 | |
![]()
Pin 8 on 24LC256 = Vdd (5V) Pin 4 on 24LC256 = Vss (Earth) Note the PIC's power supply/oscillator are not shown
Here is an example of how to use the Library with a single EEPROM (24LC256)
Device = 18F452 Clock = 20 // import libraries... Include "ExtEEPROM.bas" Include "usart.bas" Include "Convert.bas" Dim Variable As Byte, // Variable used for data Device_Address As Byte, // Register for I2C Address reference Memory_Address As Byte, // Register for EEPROM memory address Family As Byte // Register for External EEPROM family setting USART.SetBaudrate(br19200) Variable = 123 // Place the value "1" in the variable register Device_Address = %000 // Set the EEPROM I2C address Memory_Address = 10 // Set the EEPROM address location to 0 Family = %1010 // Set the Family configeration as the binary number 1010 // Write the value 123 to EEPROM 000 at memory location 10 ExtEEPROM.Write(Variable, Memory_Address, Device_Address, Family) // Read from EEPROM 000, memory location 10 Variable = ExtEEPROM.Read(Memory_Address, Device_Address, Family) USART.Write(Convert.DecToStr(Variable)) While True Wend
Video Tutorials: Single External EEPROM Explores the use of the External EEPROM Library Covers the "Family" register use for compatibility with other EEPROM's ** Note - I mention that 10mS is required after an EEPROM write, this is now part of the Library and is not required **
Multiple (4) External EEPROM's Covers the use of addressing multiple EEPROM's on the I2C Bus with the Library
Comments (6)
Joomla components by Compojoom
|
|
| Last Updated ( Friday, 24 April 2009 09:48 ) |
Whos Online
- Jon Chandler
- andyo
Forum Activity
REALISTIC LED candle flicker - mrdeb Wednesday, 10 March 2010 05:48 - [0 replies]
the LCD demo hello world - mrdeb Wednesday, 10 March 2010 05:41 - [29 replies]
USB problem - jon chandler Tuesday, 09 March 2010 11:31 - [3 replies]
Servo Module - andyo Tuesday, 09 March 2010 03:39 - [3 replies]
pic to ps2 communication - roshan Friday, 05 March 2010 01:30 - [7 replies]
Way Off Topic: Worldwide Ignite Week - jon chandler Wednesday, 03 March 2010 20:33 - [4 replies]
PIC USB with C and Visual C++ Project - hop Tuesday, 02 March 2010 21:49 - [0 replies]
Recent Comments
- 2010-03-05 13:24:23 mrpse...
I was thinking of battery with powered routers or powered for every...
- 2010-03-05 12:17:40 andyo
50 rooms - wow. The XBee modules are very easy to use but I'm not ...
- 2010-03-05 11:46:37 mrpse...
Thanks AndyO. What I have to do is design a device to monitor temp...
- 2010-03-05 03:08:58 andyo
The circuit used for the remote sensor can be found here: [url]http...
- 2010-03-04 07:19:06 renno
plz i need help do u know from where i could download it or how cou...
- 2010-03-04 07:16:05 renno
hello everyone i'm trying to finish my final project and i want to ...
- 2010-03-04 02:49:38 Saira...
Thanks that was helpful
- 2010-03-04 02:35:35 Jon C...
There is a BlueTooth module available. If you used this, you can s...






very good tutorials you do!
Can you talk more about EEPROM. How can i sore and protect data in there.
And how to work with the Virtual Terminal,
i see only Gibrish in the prompt window.
And what about the I2C Protocol Analyzer, what the meaning of all the strange chars???
