Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: mcdanne82 on February 27, 2010, 09:15:17 pm

Title: How to use the EEPROM?
Post by: mcdanne82 on February 27, 2010, 09:15:17 pm
Does anybody have same example code to read/write a byte array and LONG value to the EEPROM or SD card of the webserver.
How do you know what positions that is free and which is used by homepages?
Title: Re: How to use the EEPROM?
Post by: Markus Gritsch on March 04, 2010, 06:09:54 pm
I do not have any example code (since I am still waiting to receive my Web Platform ... sigh), but as I understand it from reading the docs you can use the functions declared in C:Microchip SolutionsMicrochipIncludeTCPIP StackXEEPROM.h (and defined in C:Microchip SolutionsMicrochipTCPIP StackSPIEEPROM.c) to access the EEPROM.

With the mpfs utility (which you use to generate the image from the directory containing the web pages) you can specify how many bytes it should reserve for your custom data.
Title: Re: How to use the EEPROM?
Post by: ian on March 05, 2010, 11:05:19 am
Here's the Bus Pirate demo of an SPI EEPROM, it gives a basic overview of how to interface one:
http://dangerousprototypes.com/2009/07/ ... rer-board/ (http://dangerousprototypes.com/2009/07/30/prototype-bus-pirate-3eeprom-explorer-board/)

You can also stead the code from the Bus Pirate SPI mode if you need to setup and use the PIC SPI interface. A little tweaking will be involved for the correct CS pins and RPx (reprogrammable pin, see IO and PPS in the datasheet) setup, but the SPI peripheral is the same on all 16bit PICs.
http://code.google.com/p/the-bus-pirate ... e/SPI.c#62 (http://code.google.com/p/the-bus-pirate/source/browse/trunk/source/SPI.c#62)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.00902043224session_write_close ( )...(null):0
20.00932174800ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00932175576Database_MySQL->query( ).../DatabaseHandler.php:119
40.05432314296Database_MySQL->error( ).../Db-mysql.class.php:273