![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#2
| |||
| | |||
| Yes, it erases them on power-up, but not always on hard reset. The datasheet from the microchip site for the particular PIC you're using will tell you what to expect at power on and reset. If the PIC has some eeprom data space you can write config/setting information to there and it will stay until you decide to change it... |
|
#6
| ||||
| ||||
| Is it possible to retrieve data from the file register in bank 0? Say I would like to retrieve some data stored in a file register in bank 0 and move it to the EEPROM. Are the file registers available in bank 1? Or do they have a different address? Or can I first go to bank 1, prepare and enable writing to the EEPROM, before returning to bank 0, move the data from the file register into the work register, and go back to bank 1 to complete the writing to the EEPROM? As far as I can see I can't store the data in the work register when moving to bank 1 to prepare the EEPROM because I will need the work register for data to the EECON2 register. Sorry for all these questions. I have never really used the EEPROM part of the PIC before. Edit: According to PIC Simulator IDE, I should be able to retrieve the data loaced in the file register in bank 1. Last edited by The Blight; 03-26-2008 at 07:46 PM. |
|
#7
| |||
| | |||
| Ummm, Yes? You can pre-load the EEDATA register before you switch to Bank1 to set EECON1 & EECON2 for the write. Or you can setup for the write, and before you do the Is that what you mean? The contents of EEDATA are not effected by the EECON2 write sequence you can swtich banks, get the data, switch banks back and write it to EEDATA then do the write sequence.. Switching banks at any point in the process has no effect on the data stored in W or other registers. The only critical bit is the write sequence which is in the data sheets for each PIC. |
|
#8
| ||||
| ||||
| The EEDATA register is located in Bank1, so I can't se how I can access it from Bank 0. Guess you mean I can switch to Bank1, write data to the EEDATA register, then go back to bank0 and continue the workflow to later on write it to the EEPROM. Don't see the point of this because I can just take this data from the a file register when writing to the EEPROM. Might be useful if you don't want to use a f register, or lack the space to do so. Right now I'm just retrieving data from the file registers (which I found out is available in bank 1.. was a bit confused, but makes sense now) where I have stored some calibration data before switching to Bank 1. That way I can save code and not have to switch between banks during the write cyclus. Though it is nice to know that I can switch banks after the initiation/preparation sequence has been completed. I know it has no effect on the w or f registers, but I thought that the sequence for writing to the eeprom was a bit more limited, so I just had to ask. Thanks for your help. Program is done and tested. Seems to be working the way it should. |
|
#9
| |||
| | |||
| Good-o... FYI, the only bit of the write sequence that is order critical is this bit: (From the pic16F876A datasheet) MOVLW 55h MOVWF EECON2 ; Write 55h MOVLW AAh ; MOVWF EECON2 ; Write AAh BSF EECON1, WR ; Set WR bit to The order, and method of setting the data and address registers before that point is totally up to you, assuming you get the values you want in there that is! Cheers, Chris H. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help: Mitsu M3 tools changer memory registers | Meccbell | Mazak, Mitsubishi, Mazatrol | 0 | 01-03-2008 09:33 AM |
| need help with file | truman | Autodesk Software (Autocad, Inventor etc) | 5 | 05-11-2007 11:11 AM |
| file ext help | wildpair | BobCad-Cam | 3 | 02-01-2007 06:24 PM |
| .PSC file? | boomer187um | Autodesk Software (Autocad, Inventor etc) | 0 | 08-29-2005 11:15 PM |
| .INI file | JOE65 | TurboCNC | 7 | 03-21-2004 01:46 AM |