A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
I've simulated my application successfully with the MPLAB simulator and would like to program the chip soon. In my application, I have a matrix keypad for input to check/program a PIN code. When assigning the PIN code, I'm checking the first six digits entered compared with a value I would put into EEPROM. Is there a way I can program the chip once for the EEPROM values to store for a "unique serial number" before programming it with my program? If not, I was considering placing a routine in the startup initialization routine to check the EEPROM locations used for the serial number for FF at each location. If the value is FF, then the first six keypresses after the initial power up would be written to the EEPROM and every power up afterwards would not then allow the programming of the SN. If possible, I'd like to program the EEPROM seperately. I'm using an EPIC Plus programmer from ME labs. Thanks again, Tom |
|
|
|
If I understand you correctly, At chip programming time - you want to burn some data into EEPROM and subsequrntly access that data. You also need to write to EEPROM ? during the actual running of the program. To put data into the Pic at burn time you need to use the data or dw keyword org 0x2100 DATA 0x59,0x45,0x53 ;YES Then if you subsequently want to write to EEPROM you must make sure that you only use addresses past the last bit of static data. In the above case, the program would write to EEPROM starting from address 03, the first available free address. There is of course nothing stopping you from putting the data wherever you wanted. org 2130 for example. However some programmers won't automatically place things at org 0x2100 (for the 16 series pics, org 0xF0000 for the 18 series) and you have to enter it manually. Colin On Sun, 30 Nov 2003 18:19:53 -0000, tom_bihn wrote: ::I've simulated my application successfully with the MPLAB simulator ::and would like to program the chip soon. In my application, I have a ::matrix keypad for input to check/program a PIN code. When assigning ::the PIN code, I'm checking the first six digits entered compared ::with a value I would put into EEPROM. Is there a way I can program ::the chip once for the EEPROM values to store for a "unique serial ::number" before programming it with my program? -- cdb, on 01.December.2003 I have always been a few Dendrites short of an Axon and believe me it shows. Light travels faster than sound. That's why some people appear bright until they speak! |
|
Tom As was pointed out in another reply use DE or one of those data statements. This is an example of storing 123456 in an eeprom of a 16f628 at eeprom address 0 Org 8448 DE 1 DE 2 DE 3 DE 4 DE 5 DE 6 BTW have a look at my Password program its written in BASIC here at http://users.picbasic.org/ Then goto Projects / control But don't forget to have a good look around at the rest of the stuff as well, especialy the GAMES and PPRINT, which is in How to / Make The Most of Proton Plus As far a saving passwords with the epic just use the Serial number feature. Tim --- In , "tom_bihn" <tbihn@n...> wrote: > I've simulated my application successfully with the MPLAB simulator > and would like to program the chip soon. In my application, I have a > matrix keypad for input to check/program a PIN code. When assigning > the PIN code, I'm checking the first six digits entered compared > with a value I would put into EEPROM. Is there a way I can program > the chip once for the EEPROM values to store for a "unique serial > number" before programming it with my program? > > If not, I was considering placing a routine in the startup > initialization routine to check the EEPROM locations used for the > serial number for FF at each location. If the value is FF, then the > first six keypresses after the initial power up would be written to > the EEPROM and every power up afterwards would not then allow the > programming of the SN. > > If possible, I'd like to program the EEPROM seperately. I'm using an > EPIC Plus programmer from ME labs. > > Thanks again, > Tom |