Page 1 of 1

I2C with 16F1847 error This chip does not have Master I2C

Posted: Sat Jan 25, 2014 8:53 am
by cubitus54
Hello,

I would like to use the I2C bus on a 16F1847.
At the Compiling A I have this error message:

Code: Select all

...
Starting preprocessor: C:\PROGRA~2\Flowcode\v5\Tools\boostc\pp.exe "test_pression GY65.c" -i C:\PROGRA~2\Flowcode\v5\Tools\boostc\include -d _PIC16F1847 -la -c2 -o "test_pression GY65.pp" -v -d _BOOSTC -d _PIC16 -d _PIC16x -d _CHAR_INDEX 
C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_I2C.c(319): This chip does not have Master I2C capability
1 errors detected
...
Normal?
Same error on Flowcode V6.04

thank you
PIC16(L)F1847
The I2C interface supports the following modes and
features:
• Master mode
• Slave mode
• Byte NACKing (Slave mode)
• Limited Multi-master support
• 7-bit and 10-bit addressing
• Start and Stop interrupts
• Interrupt masking
• Clock stretching
• Bus collision detection
• General call address matching
• Address masking
• Address Hold and Data Hold modes
• Selectable SDAx hold times

Re: I2C with 16F1847 error This chip does not have Master I2

Posted: Sat Jan 25, 2014 10:12 am
by cubitus54
missing in 16F1847.fcd line

Define74 = # define MX_MI2C

There are no compilation errors, but the communication is not working ...

Re: I2C with 16F1847 error This chip does not have Master I2

Posted: Sun Jan 26, 2014 12:12 am
by Kenrix2
Great job on catching the missing define. I don't have that micro to test with but, maybe you could try this instead:
Define77=#define MX_MI2C
For some reason I get a different define number than you and also deleted the spaces. Probably won't make any difference though. I am guessing there is something else going on but I can't spot it.

Re: I2C with 16F1847 error This chip does not have Master I2

Posted: Mon Jan 27, 2014 10:34 am
by cubitus54
Hello,

By adding this line = # define MX_MI2C, there is no problem at compile time, but the PIC does not work: (
I had already modified the file because there was error in the definition of PWM.

Code: Select all

Define42=#define MX_I2C
Define43=#define MX_MI2C
Define44=#define MX_I2C_1
Define45=#define MX_I2C_1_SDA_PORT portb
Define46=#define MX_I2C_1_SDA_TRIS trisb
Define47=#define MX_I2C_1_SDA_PIN 1
Define48=#define MX_I2C_1_SCL_PORT portb
Define49=#define MX_I2C_1_SCL_TRIS trisb
Define50=#define MX_I2C_1_SCL_PIN 4
Define51=#define MX_I2C_2
Define52=#define MX_I2C_2_SDA_PORT portb
Define53=#define MX_I2C_2_SDA_TRIS trisb
Define54=#define MX_I2C_2_SDA_PIN 2
Define55=#define MX_I2C_2_SCL_PORT portb
Define56=#define MX_I2C_2_SCL_TRIS trisb
Define57=#define MX_I2C_2_SCL_PIN 5
Define58=#define MX_PWM
Define59=#define MX_PWM_CNT 4
Define60=#define MX_PWM_PSCA1
Define61=#define MX_PWM_PSCA4
Define62=#define MX_PWM_PSCA16
Define63=#define MX_PWM_1_PORT portb
Define64=#define MX_PWM_1_TRIS trisb
Define65=#define MX_PWM_1_PIN 3
Define66=#define MX_PWM_2_PORT portb
Define67=#define MX_PWM_2_TRIS trisb
Define68=#define MX_PWM_2_PIN 6
Define69=#define MX_PWM_3_PORT porta
Define70=#define MX_PWM_3_TRIS trisa
Define71=#define MX_PWM_3_PIN 3
Define72=#define MX_PWM_4_PORT porta
Define73=#define MX_PWM_4_TRIS trisa
Define74=#define MX_PWM_4_PIN 4