PDA

View Full Version : I2CWRITE Issue at Compiling Time



rsocor01
- 16th July 2014, 04:24
Hi all,

I'm using a PIC16F1939 to control a RTC chip with I2C. I'm using PBP2.60. The 16F1939 has 16384 words of programming memory. So whenever I compile the big program that I'm playing with I get the normal message,


7390


Everything good so far. So, whatever code I add to my program I get the above "Crossing page boundary...." messages. Now, if I add these lines of code,



SYMBOL SCL = PORTC.3 'EEPROM CLOCK PIN
SYMBOL SDA = PORTC.4 'EEPROM DATA PIN


ADDRESS VAR BYTE
CONTROL VAR BYTE: CONTROL = %11011111

WRITE_VAR = %01000000
'I2CWRITE SDA, SCL, %11011111, $07, [WRITE_VAR]
ADDRESS = $07
I2CWRITE SDA, SCL, CONTROL, ADDRESS, [WRITE_VAR]
PAUSE 10

Then, I always get the following messages,


7391


The program seems to be working fine. But, I have no idea why I get this "1183 : Crossing page boundary..." message only when I use the I2CWRITE. I'm pulling my hair out trying to figure this out :eek:. Any help will be greatly appreciated.

Thank you,

richard
- 16th July 2014, 04:50
read this
http://www.picbasic.co.uk/forum/showthread.php?t=40

rsocor01
- 16th July 2014, 13:00
read this
http://www.picbasic.co.uk/forum/showthread.php?t=40

Thanks Richard, but why this "1183 : Crossing page boundary..." message appears only when I use the I2CWRITE command? That is what I don't understand. Is this a normal compiling message?

pedja089
- 16th July 2014, 13:21
Yes. It appears only when your code is larger than 1K, 2K etc...

rsocor01
- 16th July 2014, 14:07
Yes. It appears only when your code is larger than 1K, 2K etc...

I know it's a normal thing. The question is that whatever code I add to my program I get the usual crossing page boundary messages. I can get the programming memory nearly full and I get the messages in the first picture posted above. Only and only when using I2CWRITE is that I get the "1183 : Crossing page boundary...".

xpa999
- 23rd July 2014, 02:00
I do believe that the '1183' refers to a line number in the assembled code. The number changes depending upon which libraries are called and where the page crossing occurs in the listing.

rsocor01
- 23rd July 2014, 13:44
Hi, that makes sense. Because it only happens when using the I2CWRITE command.