Changing control values for PIC remotely

microchipmicrocontrollerpicxbee

I'm using a PIC to take information from a sensor and transmit it via xbee to control a relay, as well as through a gateway to an online program. Forgive the noobie question here (I've searched and can't find it, maybe because I dont really know how to word this)…How would I go about changing the 'control' parameter for the relay. Say for instance I want a relay to turn on my a/c when it gets too hot, and I want to change what "too hot" is via the custom web program. It seems to me that it would require re-programming the PIC, however I've seen these types of devices before and that's not necessary, so I don't know what I'd need to do instead. TIA!!

Best Answer

There are basically four ways to get nonvolatile storage in a modern micro.

  1. Internal EEPROM: Many (not all) micros have EEPROM on-chip. It's good for perhaps 100,000 operations (sometimes more) before it wears out and takes some milliseconds to write (but is fast to read).
  2. Flash memory: (EEPROM emulation). Some micros allow you to write a portion of the flash during normal operation. This can be an alternative if EEPROM is not provided. FRAM based micros have nonvolatile memory that has fewer limitations than flash, but they're not very common.
  3. External SEEPROM: Inexpensive and small serial EEPROMs are widely available. They typically use I2C, SPI or Microwire interface. A good alternative if the micro does not have EEPROM or you need more storage capacity.

  4. Battery or supercapacitor backup: Simply store the information in RAM and put the micro in a very low power state when it is not active. Batteries (even rechargables) eventually wear out.

Edit: See the datasheet here:

enter image description here

and here:

enter image description here

You can find many code examples on line for using the data EEPROM.