PDA

View Full Version : I2C MSSP Samples code



jackberg1
- 21st February 2025, 14:07
Hi everyone,

currently I use the I2C regular 'bit-banging' method from PBP on a PIC18F25K22

with instruction like 'I2Cwrite PORTB.2, PORTB.1,$A0,I, [str aarray\32]'

and looking to upgrade to a 24FC16 at 1Mhz, to acheive this I need to use the MSSP hardware function

and I'm having problem on how to figure it at all.

I looked at the AN989 and the code are listed in ASM, and I'm asking peoples here with more experience on this field

if it's possible to write in basic code instead of ASM to acheive this and where to get clear commented sample code

so I can learn & build this project on I2C.

Thanks to anyone help on this project.

richard
- 23rd February 2025, 01:11
if it's possible to write in basic code instead of ASM to acheive this and where to get clear commented sample code


so I can learn & build this project on I2C
sic

yes it is , its not too difficult


see here for a pbp example , with no asm code at all ,that is well commented
https://www.picbasic.co.uk/forum/showthread.php/26852-24FC64-EEPROM-Running-at-1Mhz

you appear to totally ignore this even though its 99% compatible with what you request

jackberg1
- 24th February 2025, 01:38
your'e right starting point
first get some pratice with this listing and see how it goes.

regards.