Page 1 of 2

I2C Slave Pic12F1840 ( NOT FIXED )

Posted: Mon Jun 17, 2024 6:52 pm
by Alan_37
Hi

Trying to Communicate between an STM32F411 ( i2C Master ) and a PIC12F1840 i2C Slave .

I2C has 3 working Devices when I add the PIC18F1840 Slave and try to Scan for devices
it Replies with an ACK and then it shorts the SCK to GND and nothing works after that .

In my PIC Program I only INIT I2c and Put the MCU in a loop .
.
2024-06-17 19 36 02.jpg
2024-06-17 19 36 02.jpg (13.89 KiB) Viewed 10099 times
.
2024-06-17 19 36 52.jpg
2024-06-17 19 36 52.jpg (36.53 KiB) Viewed 10099 times
.
2024-06-17 19 35 40.jpg
2024-06-17 19 35 40.jpg (63.35 KiB) Viewed 10099 times

Re: I2C Slave ( Pic12F1840 )

Posted: Mon Jun 17, 2024 7:35 pm
by mnfisher
I know this is for pic acting as slave - but see viewtopic.php?f=6&t=2598 - where we hit the same issue with connecting two AVR MCUs.
We got around by using the twi interrupt - and the pic maybe has something similar..

Martin

Re: I2C Slave ( Pic12F1840 )

Posted: Mon Jun 17, 2024 7:36 pm
by mnfisher
Also don't forget the pull up resistors!

Re: I2C Slave ( Pic12F1840 )

Posted: Mon Jun 17, 2024 7:50 pm
by Alan_37
Hi pullup resistors where 10K and changed ro 4.7K
But Same problem

Re: I2C Slave ( Pic12F1840 )

Posted: Mon Jun 17, 2024 8:15 pm
by Alan_37
mnfisher wrote:
Mon Jun 17, 2024 7:35 pm
I know this is for pic acting as slave - but see viewtopic.php?f=6&t=2598 - where we hit the same issue with connecting two AVR MCUs.
We got around by using the twi interrupt - and the pic maybe has something similar..

Martin
A Two wire interrupt , I think would be a custom interrupt , I am using i2c Channel 1 but I don't know how that would
work .

Re: I2C Slave ( Pic12F1840 )

Posted: Wed Jun 19, 2024 10:45 am
by Alan_37
Hi

Is this bug fixable or better look for an Alternative ?

Re: I2C Slave Pic12F1840 ( NOT FIXED )

Posted: Wed Sep 04, 2024 10:21 pm
by Alan_37
Hi,

This Component Also does not work on Atmeg328P

Has someone ever seen this Component working?
Is there any plan to fix this Component any time soon?

Re: I2C Slave Pic12F1840 ( NOT FIXED )

Posted: Thu Sep 05, 2024 8:56 am
by mnfisher
The AVR example referenced above does work.

The slave needs to be interrupt driven to stand a chance.

Martin

Re: I2C Slave Pic12F1840 ( NOT FIXED )

Posted: Thu Sep 05, 2024 9:43 am
by chipfryer27
Hi

Following on from Martin above, I was messing with I2C slave a while back and can't remember offhand when / why, but I do recall that I used the SSP interrupt on a PIC (not every PIC has this feature). Can't really remember much more, or if I actually succeeded in doing what I wanted, but I do know that I had to use the SSP.

Regards

Re: I2C Slave Pic12F1840 ( NOT FIXED )

Posted: Thu Sep 05, 2024 10:18 am
by chipfryer27
Hi

If you go to the "old" forum and search for I2C SSP you should find some information. Incidentally the old forum is a great source of help.

https://www.flowcode.co.uk/mmforums/sea ... ds=i2c+ssp

Regards