CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PCWH 3.184: Compiler problems, writing to eeprom with 18F442

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
grunwald



Joined: 12 Jan 2004
Posts: 3
Location: germany

View user's profile Send private message Visit poster's website

PCWH 3.184: Compiler problems, writing to eeprom with 18F442
PostPosted: Tue Feb 17, 2004 7:21 am     Reply with quote

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
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Tue Feb 17, 2004 9:18 am     Reply with quote

Have you looked at the latest version of the compiler? there are some changes in the way writes to EEPROM are handled that might be usefull for you. As far as that memory bank change you are observing, Place an acces to a register in the line proceding the write to EEPROM line and the bank change statement will be moved. I don't believe that bank change is a problem.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group