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 support@ccsinfo.com

Problem with table implementation

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







Problem with table implementation
PostPosted: Tue Apr 15, 2003 9:28 pm     Reply with quote

I currently have a problem implementing a table in ROM. The value placed in the first ROM location is always wrong but other values are correct. I was wondering if anyone else are experiencing the same problem?

Compiler version used: 3.152
IDE: MPLAB v6.20
Processor used: PIC12CE674
Fuses: WDT, NOPUT, INTRC (I/O)



Here is part of the code:

/************ ID SETTING ************/
#rom 0x07f9 = {0x3411}
#rom 0x07fa = {0x3422}
#rom 0x07fb = {0x3433}
#rom 0x07fc = {0x3444}
#rom 0x07fd = {0x3455}
#rom 0x07fe = {0x3466}


The compiled code is suppose to return the following:
Address Opcode
0x07f9 retlw 0x11
0x07fa retlw 0x22
0x07fb retlw 0x33
0x07fc retlw 0x44
0x07fd retlw 0x55
0x07fe retlw 0x66


Instead I am getting the following in ROM:
0x07f9 retlw 0x66
0x07fa retlw 0x22
0x07fb retlw 0x33
0x07fc retlw 0x44
0x07fd retlw 0x55
0x07fe retlw 0x66


Apparently any changes in 0x07fe will also cause a similar change in both location 0x07f9 and 0x07fe. Is this a compiler bug?
___________________________
This message was ported from CCS's old forum
Original Post ID: 13696
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: Problem with table implementation
PostPosted: Wed Apr 16, 2003 11:37 am     Reply with quote

:=I currently have a problem implementing a table in ROM. The value placed in the first ROM location is always wrong but other values are correct. I was wondering if anyone else are experiencing the same problem?
:=
-----------------------------------------------------------

I did a test with PCM vs. 3.152, and I didn't see the problem.
Here's a partial dump of the Program Memory Window from MPLAB
vs. 5.70.40:

<PRE>
07F8 3FFF addlw 0xff
07F9 3411 retlw 0x11
07FA 3422 retlw 0x22
07FB 3433 retlw 0x33
07FC 3444 retlw 0x44
07FD 3455 retlw 0x55
07FE 3466 retlw 0x66
07FF 3FFF addlw 0xff
</PRE>

Here's the test program:

<PRE>
#include "c:\Program Files\Picc\Devices\12ce674.h"
#fuses WDT, NOPUT, INTRC
<BR>
#rom 0x07f9 = {0x3411}
#rom 0x07fa = {0x3422}
#rom 0x07fb = {0x3433}
#rom 0x07fc = {0x3444}
#rom 0x07fd = {0x3455}
#rom 0x07fe = {0x3466}
<BR>
main()
{
<BR>
while(1);
}
</PRE>
___________________________
This message was ported from CCS's old forum
Original Post ID: 13711
Edmund Ooi
Guest







Re: Problem with table implementation
PostPosted: Wed Apr 16, 2003 7:29 pm     Reply with quote

The problem only occurs with MPLAB v6.20.00 however MPLAB v5.70.40 works well. There are no such problems with the .hex file either. The .cod file seems alright too.

Probably a bug in MPLAB v6.20.00
___________________________
This message was ported from CCS's old forum
Original Post ID: 13737
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