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

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
User avatar
cubitus54
Flowcode v5 User
Posts: 110
Joined: Wed Jun 19, 2013 7:18 am
Has thanked: 7 times
Been thanked: 32 times

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

Post 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
Attachments
I2C.fcf
(5.5 KiB) Downloaded 299 times
Flowcode V6.1.2.0(11 05 2015)

User avatar
cubitus54
Flowcode v5 User
Posts: 110
Joined: Wed Jun 19, 2013 7:18 am
Has thanked: 7 times
Been thanked: 32 times

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

Post by cubitus54 »

missing in 16F1847.fcd line

Define74 = # define MX_MI2C

There are no compilation errors, but the communication is not working ...
Flowcode V6.1.2.0(11 05 2015)

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times

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

Post 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.

User avatar
cubitus54
Flowcode v5 User
Posts: 110
Joined: Wed Jun 19, 2013 7:18 am
Has thanked: 7 times
Been thanked: 32 times

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

Post 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
Flowcode V6.1.2.0(11 05 2015)

Post Reply