Hi David,

Thanks.  I will have a look at it and test it. If it all works OK I will add it 
to Jallib.

Kind regards,

Rob

________________________________
Van: [email protected] <[email protected]> namens David VB 
<[email protected]>
Verzonden: donderdag 27 maart 2025 16:21
Aan: jallib <[email protected]>
Onderwerp: [jallib] Re: Two I2C Bus on one PIC

Rob,

Here attached the files to control a second I2C bus for PIC'w with 2 MSSP 
modules (ex: PIC16F18325 which I'm gonna use in my next project)
I did not add a control to see if the PIC has a second MSSP at compile time, 
because it was not controlled for PIC with one MSSP either....

Nothing is tested, but if it compiles, it should work, because what I did was 
only "Search and replace".   i did not touch the logic

Feel free to adapt as you wish

Le mercredi 26 mars 2025 à 16:23:18 UTC+1, David VB a écrit :
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]<mailto:[email protected]>.
To view this discussion visit 
https://groups.google.com/d/msgid/jallib/ca3c68e1-c15b-4d9c-b6b7-1a14bb5df444n%40googlegroups.com<https://groups.google.com/d/msgid/jallib/ca3c68e1-c15b-4d9c-b6b7-1a14bb5df444n%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/AM7PR02MB6098C0DBC3ECB5944E6FA52FE6A12%40AM7PR02MB6098.eurprd02.prod.outlook.com.

Reply via email to