![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I'm just full of problems, aren't I? Now, I've started programming in Assembly and WOW, it's a whole lot easier than I thought. As a test to make sure my PIC is functioning correctly, I wrote (stole most of the) code for writing to EEPROM. Since it's short, here it be: #include <P16F876A.inc> BSF STATUS,RP1 BSF STATUS,RP0 BTFSC EECON1,WR GOTO $-1 BCF STATUS,RP0 MOVF 0x0000,W MOVWF EEADR MOVF 0x3F,W MOVWF EEDATA BSF STATUS,RP0 BCF EECON1,EEPGD BSF EECON1,WREN MOVLW 0x55 MOVWF EECON2 MOVLW 0xAA MOVWF EECON2 BSF EECON1,WR BCF EECON1,WREN loop NOP GOTO loop end Now, when I write it to my PIC (JDM programmer, IC-Prog 1.05D), hook it up, etc, and I plug it back into my programmer and read from it, the EEPROM location 0x0002 was written to instead of 0x0000, as I had copied to the EEADR register. Well, errr, What up with that? Thanks again, community, for putting up with me. | |
| |
| | (permalink) |
| Your writing whatever is in SFR 3F into EEPROM at address, whatever is in SFR 00. Try changing it to, Code: BCF STATUS,RP0 movlw 00; < change MOVWF EEADR movlw 0x3f;< change MOVWF EEDATA BSF STATUS,RP0 BCF EECON1,EEPGD Mike. | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Problem Writing into EEPROM of PIC16f690 | Ken Ho | Micro Controllers | 11 | 17th August 2006 05:55 AM |
| Writing Data to the EEPROM | Electrix | Micro Controllers | 2 | 31st August 2005 07:39 AM |
| Required sequence for writing EEPROM | MathGeek | Micro Controllers | 10 | 23rd August 2005 08:22 AM |
| Writing to EEPROM | rizzy | Micro Controllers | 3 | 27th January 2004 05:01 AM |