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

dsPIC33EP64GP504, I2C and compiler version 5.073

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



Joined: 18 May 2017
Posts: 3

View user's profile Send private message

dsPIC33EP64GP504, I2C and compiler version 5.073
PostPosted: Thu May 18, 2017 10:23 am     Reply with quote

My code runs fine with versions up to and including v5.072. Now the I2C does not seem being setup correctly. I am setting the I2C port with:
Code:

#FUSES NOALTI2C1
#use i2c(MASTER, I2C1, SLOW, stream=I2C_PORT1, NOINIT)

followed by
Code:

i2C_init(I2C_PORT1,1);

The list of changes in for v5.073 does not mention any changes that I would expect to affect this.

Does anyone know what the change in the compiler that is causing this?
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu May 18, 2017 10:28 am     Reply with quote

Honestly try a quick comparison. If you haven't changed anything, just recompiled, a diff checker program will tell you what has changed. A quick look at the listing for this part of the code, and it should show what has changed. May well be an error, introduced by another change... :(

There have been two versions very quickly, which may suggest they found something with the first....
Ben Gordon



Joined: 18 May 2017
Posts: 3

View user's profile Send private message

A .LST file comparison suggests it is the compiler
PostPosted: Thu May 18, 2017 5:26 pm     Reply with quote

A file compare on the .LST file generated by v5.072 and v5.073 shows that code is the same, but the SFR addresses used in the I2C code has changed. v5.073 seems to be using addresses which don't match the datasheet. I have cut and pasted an example. (All calls to I2C through out the code are affected).

v5.072 (works)
.................... i2C_start(I2C_PORT1);
061A: BTSS.B 208.3
061C: BRA 626
061E: BSET.B 206.1
0620: BTSC.B 206.1
0622: BRA 620
0624: BRA 62C
0626: BSET.B 206.0
0628: BTSC.B 206.0
062A: BRA 628

v5.073 (does not work)
.................... i2C_start(I2C_PORT1);
061A: BTSS.B 208.3
061C: BRA 626
061E: BSET.B 2E0.1
0620: BTSC.B 2E0.1
0622: BRA 620
0624: BRA 62C
0626: BSET.B 2E0.0
0628: BTSC.B 2E0.0
062A: BRA 628

I shall stick to v5.072 for now as the issues fixed in v5.073 are not related the the part I am currently using.
newguy



Joined: 24 Jun 2004
Posts: 1899

View user's profile Send private message

PostPosted: Thu May 18, 2017 5:55 pm     Reply with quote

That's unfortunate that they seem to be reverting to their old ways. When I first started using CCS around 15 years ago, I remember them issuing new compiler releases sometimes twice a day. That's when I quickly learned never to blindly install the latest version and instead stick with something older; perhaps flawed, but flawed in a manner I knew about.
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Fri May 19, 2017 12:19 am     Reply with quote

Report it to CCS.
It looks like they have revised the database covering the registers on the chip and somebody has made a mistake on the location of I2C1CON.

It gets even more interesting. If you generate a register map from 5.073 for this chip, it too is wrong, but with different addresses to the ones being found!...
Ugh.

A similar test on 5.071, has both values right.

Just tested quickly a couple of PIC24's and the registers are right in both versions.
Ben Gordon



Joined: 18 May 2017
Posts: 3

View user's profile Send private message

Issue report to CCS and will be fixed in next release
PostPosted: Tue May 23, 2017 3:16 pm     Reply with quote

Looks like it was something in the compiler.
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