PIC18F46K42 hardware I2C

For general Flowcode discussion that does not belong in the other sections.
Post Reply
marcin
Posts: 7
http://meble-kuchenne.info.pl
Joined: Mon May 16, 2022 8:11 am
Has thanked: 5 times
Been thanked: 1 time

Flowcode v10 PIC18F46K42 hardware I2C

Post 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.

chipfryer27
Valued Contributor
Posts: 1553
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 556 times

Re: PIC18F46K42 hardware I2C

Post 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
Screenshot 2025-04-11 215637.jpg (108.9 KiB) Viewed 1950 times

Hope this helps.

Regards

marcin
Posts: 7
Joined: Mon May 16, 2022 8:11 am
Has thanked: 5 times
Been thanked: 1 time

Re: PIC18F46K42 hardware I2C

Post 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
Flowcode i2c.png (273.08 KiB) Viewed 1918 times
Flowcode i2c_1.png
Flowcode i2c_1.png (275.1 KiB) Viewed 1918 times
Flowcode i2c_2.png
Flowcode i2c_2.png (278.76 KiB) Viewed 1918 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

chipfryer27
Valued Contributor
Posts: 1553
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 556 times

Re: PIC18F46K42 hardware I2C

Post 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
Screenshot 2025-04-12 105935.jpg (107.37 KiB) Viewed 1872 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

marcin
Posts: 7
Joined: Mon May 16, 2022 8:11 am
Has thanked: 5 times
Been thanked: 1 time

Re: PIC18F46K42 hardware I2C

Post 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.
PIC18F46K42_HMI_LASKA.fcfx
(55.53 KiB) Downloaded 19 times
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
Last edited by marcin on Sat Apr 12, 2025 2:13 pm, edited 1 time in total.

medelec35
Matrix Staff
Posts: 1951
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 625 times
Been thanked: 656 times

Re: PIC18F46K42 hardware I2C

Post 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.
Martin

marcin
Posts: 7
Joined: Mon May 16, 2022 8:11 am
Has thanked: 5 times
Been thanked: 1 time

Re: PIC18F46K42 hardware I2C

Post 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.

medelec35
Matrix Staff
Posts: 1951
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 625 times
Been thanked: 656 times

Re: PIC18F46K42 hardware I2C

Post 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.
Martin

marcin
Posts: 7
Joined: Mon May 16, 2022 8:11 am
Has thanked: 5 times
Been thanked: 1 time

Re: PIC18F46K42 hardware I2C

Post 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
Xpress Board PIC18F46K42.png (171.66 KiB) Viewed 1325 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.
Last edited by marcin on Sun Apr 13, 2025 7:45 am, edited 1 time in total.

chipfryer27
Valued Contributor
Posts: 1553
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 353 times
Been thanked: 556 times

Re: PIC18F46K42 hardware I2C

Post 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

Post Reply