Page 1 of 1
PIC18F46K42 hardware I2C
Posted: Fri Apr 11, 2025 9:42 pm
by marcin
Hello everyone. I am working on a certain operator panel project (which I will write about in another thread). One of the selected microcontrollers was PIC18F46K42. One of the assumptions was to use hardware I2C bus modules. I read the datasheet and it says that the microcontroller has two hardware I2C modules.
After selecting this microcontroller in the project, there is no option to select hardware I2C modules. I am using FCv10.
Dear team, can I count on your help?
Best regards, Marcin
I apologize for the spelling mistakes, I am using a translator.
Re: PIC18F46K42 hardware I2C
Posted: Fri Apr 11, 2025 9:57 pm
by chipfryer27
Hi
Please see below. In the I2C component you have the option to set Channel 1 / Channel 2 / Software.

- Screenshot 2025-04-11 215637.jpg (108.9 KiB) Viewed 1952 times
Hope this helps.
Regards
Re: PIC18F46K42 hardware I2C
Posted: Sat Apr 12, 2025 7:25 am
by marcin
Hello chipfryer27 and all .
Thank you for your answer. Please look at the screenshot in my project. After expanding the selection window I have only the "Software" option and no other. As you can see in the project there is also an I2C LCD display with a PCF8574 expander and another I2C expander for supporting the PCF8575 matrix keyboard. In the properties of both components I also do not have the option to select hardware I2C.

- Flowcode i2c.png (273.08 KiB) Viewed 1920 times

- Flowcode i2c_1.png (275.1 KiB) Viewed 1920 times

- Flowcode i2c_2.png (278.76 KiB) Viewed 1920 times
I even tried to reinstall Flowcode and update the microcontroller and component database, but it did not change anything.
For other microcontrollers, the options for selecting hardware I2C were there, so please help.
Best regards, Marcin
Re: PIC18F46K42 hardware I2C
Posted: Sat Apr 12, 2025 11:07 am
by chipfryer27
Hi
I have included all your components in a chart and all provide the channel options as shown in the example below.

- Screenshot 2025-04-12 105935.jpg (107.37 KiB) Viewed 1874 times
Are you sure you are using the latest version (Flowcode 10.1.2.40) with full database update (Help > Library Updates > Full Database)?
Regards
Re: PIC18F46K42 hardware I2C
Posted: Sat Apr 12, 2025 1:29 pm
by marcin
Hello.
Of course. As I wrote, I reinstalled FCv10 to the latest version and updated the database.
So let's do it differently. I'm attaching my project file and if you can, please open it on your computer and see if you have the option to select hardware I2C channels.
Edit.
I created a new project with this microcontroller on FCv9 on two computers - on the one where FCv10 is installed and on the other where there is only FCv9. On both for PIC18F46K42 there is no option to select hardware I2C channels.
Best regards, Marcin
Re: PIC18F46K42 hardware I2C
Posted: Sat Apr 12, 2025 1:53 pm
by medelec35
At the moment we will not be able to support I2C on the K42 devices, therefore the i2c peripherals have been removed from the definition files.
Software mode is the only mode that will work.
Re: PIC18F46K42 hardware I2C
Posted: Sat Apr 12, 2025 2:22 pm
by marcin
Hi
I just saw your reply as I finished editing my previous post. Thanks for your reply - that explains a lot.
Are you planning to add hardware I2C support for PIC18FxxK42 in the near future, or should I look for another microcontroller for my project?
Best regards Marcin.
Re: PIC18F46K42 hardware I2C
Posted: Sat Apr 12, 2025 5:01 pm
by medelec35
Since later Q devices work in a similar way, we will be revisiting the K42.
I'm not sure when that we be, but is on our to-do list.
If you are in a rush and need to use the built-in I2C peripheral then I would recommend trying a different target device.
Before purchasing a different microcontroller, its worth compiling to hex first to make sure there are no issues, with peripherals you plan on using.
As far as I'm aware, most microcontrollers should be good to use.
Re: PIC18F46K42 hardware I2C
Posted: Sat Apr 12, 2025 9:08 pm
by marcin
medelec35 wrote: ↑Sat Apr 12, 2025 5:01 pm
Before purchasing a different microcontroller, its worth compiling to hex first to make sure there are no issues, with peripherals you plan on using.
As far as I'm aware, most microcontrollers should be good to use.
I agree with you. I did the tests on a small PIC16F685 microcontroller and they were successful, but the amount of memory was not enough, so I bought two boards that were available to me. One with a PIC16F15376 microcontroller and the other with a PIC18F46K42.

- Xpress Board PIC18F46K42.png (171.66 KiB) Viewed 1327 times
Now I have to look for a board with another microcontroller compatible with the pinouts for the previous boards, hardware interfaces I2C, SPI, UART and a fast clock.
medelec35 and chipfryer27 thank you for your help.
Re: PIC18F46K42 hardware I2C
Posted: Sat Apr 12, 2025 9:23 pm
by chipfryer27
Hi
Microchip has a handy selection tool to help establish suitable products. Enter your requirements such as number of I2C or UARTS etc and it will show all that meet your requirement.
https://www.microchip.com/maps/microcontroller.aspx
Regards