The second bus will connect devices that will not always be present or 
powered up.   I don't want to take the risk to hang the whole main bus if 
those devices are not attached.  And since there are two MSSP in the PIC, 
it's worth to use them.

Rob,
If it this as I described (only copy and rename the 
registers/variables/constants by adding a '2' as needed, if you want, I can 
do it myself and share it later on).
I was planning to use also the i2c_level1.jal and i2c_reset_bus.jal 
libraries.  Therefore, I think this will need 3 new (copies) files.

Le mercredi 26 mars 2025 à 17:25:08 UTC+1, Rob CJ a écrit :

> Hi David,
> I think that, just as for the serial hardware, that we need a second iic 
> hardware library. I could make the library for you and start this weekend. 
>  I think that it is not that much work.
>
> Met vriendelijke groet,
> Rob Jansen 
> ------------------------------
> *From:* [email protected] <[email protected]> on behalf of 
> David VB <[email protected]>
> *Sent:* Wednesday, March 26, 2025 4:23:18 PM
> *To:* jallib <[email protected]>
> *Subject:* [jallib] Two I2C Bus on one PIC 
>  
> Hi,
>
> I will use a PIC16F18325 to control (as master) TWO separate I2C Buses.   
> This PIC has 2 MSSP modules, so this is possible.
>
> But, the I2c_hardware.jal lib does not support that: it can only reference 
> the first module.
>
> o i have to make a copy of that lib, and rename all references to the 
> registers of the MSSP module to access the second module ?   (Ex: SSPCON2 
> which is an alias for SSP1CON2 should be renamed SSP2CON2 in the copy of 
> the lib)
>
> Or is there another way ?
>
> Also note that if I want to make the buses run at different speeds (ex: 
> one at 100 kHz, and one at 400 kHz), some global variables and constants 
> have also to be duplicated and renamed.
>
> Any ideas welcome....
>
> Kind regards,
>
> David
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/jallib/6d8d86fb-7d51-4b8a-93a2-fc2244d36da6n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jallib/6d8d86fb-7d51-4b8a-93a2-fc2244d36da6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/jallib/94c59e9a-4b96-4f75-b58b-127bd60211den%40googlegroups.com.

Reply via email to