I2C Slave Pic12F1840 ( NOT FIXED )

Any bugs you encounter with Flowcode should be discussed here.
Alan_37
Posts: 186
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Flowcode v10 I2C Slave Pic12F1840 ( NOT FIXED )

Post 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 10087 times
.
2024-06-17 19 36 52.jpg
2024-06-17 19 36 52.jpg (36.53 KiB) Viewed 10087 times
.
2024-06-17 19 35 40.jpg
2024-06-17 19 35 40.jpg (63.35 KiB) Viewed 10087 times
Last edited by Alan_37 on Sun Jun 23, 2024 12:33 pm, edited 2 times in total.

mnfisher
Valued Contributor
Posts: 1628
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: I2C Slave ( Pic12F1840 )

Post 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

mnfisher
Valued Contributor
Posts: 1628
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: I2C Slave ( Pic12F1840 )

Post by mnfisher »

Also don't forget the pull up resistors!

Alan_37
Posts: 186
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Re: I2C Slave ( Pic12F1840 )

Post by Alan_37 »

Hi pullup resistors where 10K and changed ro 4.7K
But Same problem

Alan_37
Posts: 186
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Re: I2C Slave ( Pic12F1840 )

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

Alan_37
Posts: 186
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Re: I2C Slave ( Pic12F1840 )

Post by Alan_37 »

Hi

Is this bug fixable or better look for an Alternative ?

Alan_37
Posts: 186
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 54 times
Been thanked: 26 times

Re: I2C Slave Pic12F1840 ( NOT FIXED )

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

mnfisher
Valued Contributor
Posts: 1628
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 142 times
Been thanked: 761 times

Re: I2C Slave Pic12F1840 ( NOT FIXED )

Post by mnfisher »

The AVR example referenced above does work.

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

Martin

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: I2C Slave Pic12F1840 ( NOT FIXED )

Post 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

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: I2C Slave Pic12F1840 ( NOT FIXED )

Post 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

Post Reply