Page 1 of 1

Problem with the I2C component in PIC32MX370F512H MCU

Posted: Thu Feb 25, 2021 12:18 pm
by Lagoda
Hi,

I would like to ask help because the I2C Master component not working with PIC32MX370F512H chip if I use the hardware channel setup.
Nothing happen on the I2C signal ports.

The software channel is working. ( I note the SCL signal 522 kHz instead of 400 kHz in this case. )

I tried the "I2C Master" and "cal I2C" components. The two components behave the same.

I use the UART component too in this project and it is working correctly.

Best Regards,

Lagoda

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Fri Feb 26, 2021 12:24 pm
by Lagoda
Hello Ben,

Thanks for the reply.
I may have misrepresented the problem.
The I2C internal peripheral does not work in the MCU.
But I tried what you suggested.
The situation has not improved.

Would you check again?
Lagoda

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Fri Feb 26, 2021 2:54 pm
by Lagoda
Addition to the previous ones:

I also tested the I2C Master component with a PIC18F67K40 MCU, in this case only the software channel works too.

I also tested the I2C Master component with a PIC24FJ1024GB610 MCU. In this case, the code cannot be compiled if you want to use hardware channel 3. Channels 1 and 2 works, but the clock speed is approximately 47kHz when SCL = 100kHz is set. Approximately 125kHz for SCL = 400kHz, 333kHz for SCL = 1MHz.

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Wed Mar 03, 2021 11:37 am
by Benj
Sorry reply was for a different topic :oops:

Thanks I'll have a look into the problem for you.

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Wed Mar 03, 2021 9:13 pm
by Lagoda
Hello Ben,

That would be very good! :)
The most important thing for me would be to be able to use the I2C peripherals of the PIC32MX370 MCU.
I noticed that channel 2 is not initialized by the component macro.
Something happens to channel 1 during initialization, but it can only send START. (I tested it with the "Cal I2C" component macro.) I'll watch it again tomorrow (Thursday) morning, but channel 2 is certainly wrong.

Best Regards,
Lagoda

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Thu Mar 11, 2021 10:39 am
by Lagoda
:cry: :cry: :cry:

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Fri Mar 12, 2021 11:26 am
by Benj
Hello,

Sorry for the delay. I think I've spotted the problem, at least with channel 2 not being initialised and while I'm fixing that I'll see if I can find anything that is causing the problems for channel 1.

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Fri Mar 12, 2021 11:34 pm
by Benj
Hello,

I've now pushed an update to the update system.

Hopefully it improves things for you with the I2C hardware channels but let me know how you get on.

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Mon Mar 15, 2021 10:19 pm
by Lagoda
Hello Ben!

Thank you very much for your help. :D
Both channels seem to work. I tested it with the "Cal I2C" component macro.
Master and Servant are talking to each other. I only checked with an oscilloscope.
The SCL frequency is 370 kHz. Can you set it to 400 kHz?

Best Regards,

Lagoda

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Tue Mar 16, 2021 12:32 am
by Benj
Hello,

Excellent that's great progress. I've now pushed another change to hopefully better work out the baud rate.

Let me know how you get on.

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Tue Mar 16, 2021 8:29 am
by Lagoda
Hello,

Sorry I made a mistake, the SCL now 370 kHz. :oops:
The previous SCL setting was good.
Sorry, once again.

Please reset the previous baud rate.
Thanks,
Lagoda

Re: Problem with the I2C component in PIC32MX370F512H MCU

Posted: Tue Mar 16, 2021 11:50 am
by Benj
Hi Lagoda,

No problem I've rolled it back for you. Thanks for letting me know.