PIC16F1936 I2C

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
allenkkwong
Posts: 20
Joined: Mon Apr 24, 2017 3:26 am
Has thanked: 1 time
Been thanked: 3 times
Contact:

PIC16F1936 I2C

Post by allenkkwong »

Hello, I have a project that uses PIC16F1936 I2C. Once I initialize the I2C module, the MCU is getting unstable and other pins will accidentally change states. Can you let me know what is the likely problems I have?

allenkkwong
Posts: 20
Joined: Mon Apr 24, 2017 3:26 am
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: PIC16F1936 I2C

Post by allenkkwong »

Hello, I changed to use software I2C and use Port A to drive the I2C bus. It works. Therefore, it seems that the macro that uses hardware I2C might have glitch.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC16F1936 I2C

Post by Benj »

Hello,

That's odd I'm not aware of a problem with the hardware I2C on that device.

Are you able to post a simple project that demonstrates the issue and we will investigate it for you.

allenkkwong
Posts: 20
Joined: Mon Apr 24, 2017 3:26 am
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: PIC16F1936 I2C

Post by allenkkwong »

Hi Benj,

Pls find the attached. I have simplified the FC by deleting the timer interrupt and some key scan.

Thanks!

Allen
Attachments
test.fcfx
(31.56 KiB) Downloaded 98 times

allenkkwong
Posts: 20
Joined: Mon Apr 24, 2017 3:26 am
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: PIC16F1936 I2C

Post by allenkkwong »

Hi Benj,

Any update?

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC16F1936 I2C

Post by Benj »

Hello,

If you disable the watchdog timer in the project options then does this allow the hardware I2C to work without issues, I'm wondering if it's somehow related to the watchdog timing out and resetting.

It might also be worth turning off the I2C Stop Delay property and see if this makes any difference.

allenkkwong
Posts: 20
Joined: Mon Apr 24, 2017 3:26 am
Has thanked: 1 time
Been thanked: 3 times
Contact:

Re: PIC16F1936 I2C

Post by allenkkwong »

Hi Benj

The watchdog has been there and there is no problem. For some reason I need to use the I2C and the problem happen. I am quite sure that it is related to the I2C macro. Once I started the I2C marco, it is getting unstable and kind of weird behaviour of IOs.

Thanks

Post Reply