| 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
- dha
- ta1dr
- Jon Chandler
Forum Activity
Credit Where Credit's Due - jon chandler Tuesday, 16 March 2010 12:01 - [9 replies]
Marching LEDs - mrdeb Saturday, 13 March 2010 22:54 - [7 replies]
USB 8 Channel Servo Controller - andyo Saturday, 13 March 2010 01:19 - [2 replies]
Dedicated Servo Controller - graham Friday, 12 March 2010 17:58 - [0 replies]
Must have....delta temperature glowies! - graham Friday, 12 March 2010 17:31 - [3 replies]
A 'throw-away" PIC board - jon chandler Friday, 12 March 2010 13:41 - [31 replies]
iHID - graham Friday, 12 March 2010 02:04 - [5 replies]
Recent Comments
- 2010-03-18 05:40:21 azuga...
Gamers ought to know link:http://www.buyazugagold.com [azuga gold[/u...]
- 2010-03-17 22:58:18 Jon C...
Graham, Thanks for fixing the spacing on the array. This is how i...
- 2010-03-17 21:14:34 ASDne...
Thanks Graham, It is a problem with Flowcode because the demo wa...
- 2010-03-17 19:50:32 Graha...
Looks like you've pretty much solved every minor issue that was enc...
- 2010-03-17 11:42:03 Jon C...
The low-cost servo does have one other feature. The origina...
- 2010-03-17 10:56:44 Graha...
I am not familiar with flowcode, though did you try powering the bo...
- 2010-03-15 21:47:55 ASDne...
Hello there, I am still trying to get the LCD to work but I am pro...
- 2010-03-15 13:16:38 Graha...
Hi Hop, I've finally got some time this weekend to delve into the ...






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???
