View previous topic :: View next topic |
Author |
Message |
Ben Gordon
Joined: 18 May 2017 Posts: 3
|
dsPIC33EP64GP504, I2C and compiler version 5.073 |
Posted: Thu May 18, 2017 10:23 am |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19384
|
|
Posted: Thu May 18, 2017 10:28 am |
|
|
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.... |
|
![](templates/subSilver/images/spacer.gif) |
Ben Gordon
Joined: 18 May 2017 Posts: 3
|
A .LST file comparison suggests it is the compiler |
Posted: Thu May 18, 2017 5:26 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Thu May 18, 2017 5:55 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19384
|
|
Posted: Fri May 19, 2017 12:19 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Ben Gordon
Joined: 18 May 2017 Posts: 3
|
Issue report to CCS and will be fixed in next release |
Posted: Tue May 23, 2017 3:16 pm |
|
|
Looks like it was something in the compiler. |
|
![](templates/subSilver/images/spacer.gif) |
|