grunwald
Joined: 12 Jan 2004 Posts: 3 Location: germany
|
PCWH 3.184: Compiler problems, writing to eeprom with 18F442 |
Posted: Tue Feb 17, 2004 7:21 am |
|
|
Hello,
i have got some problems, when I want to write to eeprom.
The compiler sometimes does a "MOVLB F" in the "required write sequence" (mentioned in the datasheet) and that's why the data does not move to the eeprom :-(
E.G. the line "0D20: MOVLB F" below is the error and after
line "0D4C: BCF FF2.7" the compiler works correctly ...
Code: |
.................... write_eeprom(9,0xaa);
0D0A: CLRF FAA
0D0C: MOVLW 09
0D0E: MOVWF FA9
0D10: MOVLW AA
0D12: MOVWF FA8
0D14: BCF FA6.6
0D16: BCF FA6.7
0D18: BSF FA6.2
0D1A: MOVF FF2,W
0D1C: MOVWF 00
0D1E: BCF FF2.7
0D20: MOVLB F
0D22: MOVLW 55
0D24: MOVWF FA7
0D26: MOVLW AA
0D28: MOVWF FA7
0D2A: BSF FA6.1
0D2C: BTFSC FA6.1
0D2E: GOTO 0D2C
0D32: BCF FA6.2
0D34: MOVF 00,W
0D36: IORWF FF2,F
.................... write_eeprom(10,0x55);
0D38: CLRF FAA
0D3A: MOVLW 0A
0D3C: MOVWF FA9
0D3E: MOVLW 55
0D40: MOVWF FA8
0D42: BCF FA6.6
0D44: BCF FA6.7
0D46: BSF FA6.2
0D48: MOVF FF2,W
0D4A: MOVWF 00
0D4C: BCF FF2.7
0D4E: MOVLW 55
0D50: MOVWF FA7
0D52: MOVLW AA
0D54: MOVWF FA7
0D56: BSF FA6.1
0D58: BTFSC FA6.1
0D5A: GOTO 0D58
0D5E: BCF FA6.2
0D60: MOVF 00,W
0D62: IORWF FF2,F
|
Could You please tell me how I can allways get working code?
Thank You,
Bernd Grunwald |
|