Hello?
It's hard to find an MCU, so the MCU I finally got is the PIC18F45K40.
I want to receive GPIO input as Low Active or High Active. But it doesn't work correctly. So I'm using it in reverse. Any good way?
Next question. I want to use two UARTs in PIC18F45K40-I/PT. B Port is set well. However, C Port is not set and an error occurs. In the manual, C7 (Pin No. 1) is indicated as RX1. It would be nice to set it to a port supported by FC9, but many PCBs have already been made.
Please help.
Thank you.
PIC18F45K40 UART PIN Mapping
-
- Posts: 217
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 1:43 pm
- Has thanked: 6 times
- Been thanked: 7 times
-
- Matrix Staff
- Posts: 2089
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 646 times
- Been thanked: 704 times
Re: PIC18F45K40 UART PIN Mapping
Hello.
For the GPIO input active low for example, I have mentioned that here
For the UART component, you can only select ports that are designed to be available by the manufacturer.
From the datasheet (I have blanked the 28-pin ports), here are the available ports for channel1 and channel2. As you can see, only B and C are avaiable for Channel2
If you want to use port C for both channels, then instead of using channel2 you could use the UART software (Timer) component.
For the GPIO input active low for example, I have mentioned that here
For the UART component, you can only select ports that are designed to be available by the manufacturer.
From the datasheet (I have blanked the 28-pin ports), here are the available ports for channel1 and channel2. As you can see, only B and C are avaiable for Channel2
If you want to use port C for both channels, then instead of using channel2 you could use the UART software (Timer) component.
Martin
-
- Matrix Staff
- Posts: 2089
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 646 times
- Been thanked: 704 times
Re: PIC18F45K40 UART PIN Mapping
If you only can only see port B and D with channel1 then select a random pin.
It should then change from port D to Port C so you can then select the correct port C pin.
If you are still having issues can you either post your project file or PM it, if you want it to remain private?
It should then change from port D to Port C so you can then select the correct port C pin.
If you are still having issues can you either post your project file or PM it, if you want it to remain private?
Martin
Re: PIC18F45K40 UART PIN Mapping
Thank you.
That way C7 is sometimes set. However, after a while, it is changed back to D7 in an unrecognized situation. And when compiling in C7 state, a compile error appears.
It's my PG
That way C7 is sometimes set. However, after a while, it is changed back to D7 in an unrecognized situation. And when compiling in C7 state, a compile error appears.
It's my PG
- Attachments
-
- 221102-01-PRT2COM.fcfx
- (57.51 KiB) Downloaded 375 times
-
- Matrix Staff
- Posts: 1956
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 511 times
- Been thanked: 700 times
Re: PIC18F45K40 UART PIN Mapping
Hello,
What error message are you getting.
I tried the following and it's compiling fine for me, reloading the project and still ok and assigned correctly.
ModbusSlave to Channel 1 TX C6 and RX C7
Monitor_Send to Channel 2 TX B6 and RX B7
You might need to check your using the latest version of the files by going to Help -> Library Updates.
Here's the project with my property changes.
What error message are you getting.
I tried the following and it's compiling fine for me, reloading the project and still ok and assigned correctly.
ModbusSlave to Channel 1 TX C6 and RX C7
Monitor_Send to Channel 2 TX B6 and RX B7
You might need to check your using the latest version of the files by going to Help -> Library Updates.
Here's the project with my property changes.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel