View previous topic :: View next topic |
Author |
Message |
chrhartz
Joined: 29 Aug 2008 Posts: 7
|
PIC18F23k22 UART2 pins sharing with programmer |
Posted: Mon Jan 08, 2024 3:20 pm |
|
|
I need two UARTS to connect to a PC and another serial device.
The PIC18F23k22 choosen supports two UARTS. Unfortunately the 2nd
UART shares the pins with the programming interface. (PGC and PGD)
It does not look like i can route them to alternative pins. :(
My programmer is a MPLAB ICD 3. I am using a TAG-Connect MCP cable
to make connection during flashing only. After flashing it is disconnected.
What are the best options to have both the programmer and serial device
connected at the same time? Multiplexer with program control or just two
resistors to the serial device to keep the programmer levels dominant and
hope that these resistors doesn´t disturb the signals at 115.300?
Cheers,
Chris |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9232 Location: Greensville,Ontario
|
|
Posted: Mon Jan 08, 2024 3:40 pm |
|
|
DPDT DIP switch is what I used, yeah , I know, when the dinosaurs roamed....
Microchip do have 'ap notes' on this.... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9232 Location: Greensville,Ontario
|
|
Posted: Tue Jan 09, 2024 10:56 am |
|
|
hmm watching snow turn into rain.....
..any chance you can upgrade to the PIC18F46k22 version ??
eliminates the pin 'sharing', more memory too...
not that much bigger......
just thinking of possible options.. |
|
|
gaugeguy
Joined: 05 Apr 2011 Posts: 303
|
|
Posted: Tue Jan 09, 2024 12:27 pm |
|
|
Depending on your other requirements the PIC18F26K40 would be the same pinout but have pin selectable UARTs. It should also be less expensive than the PIC18F23K22. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Wed Jan 10, 2024 10:20 am |
|
|
The PIC18F26K40 has some pretty alarming entries in its errata. FYI. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
Posted: Wed Jan 10, 2024 10:57 am |
|
|
Just on the basis that more features are better, and having a very few errata,
I'd suggest the PIC18F27Q83. This is an absolute 'ripper' of a chip. Has five
UARTs, and PPS as well. It currently has no published errata, and I've used
it in half a dozen boards without any issues at all. In the UK costs under £2.
Low power (and you can make this better by turning off the peripherals
you are not using), 64MHz. Loads of ROM & RAM, DMA etc. etc.. A real
'keeper' of a chip. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sun Jan 14, 2024 7:37 am |
|
|
Back in the dinosaur days I drove 4 UARTs from a PIC with only 1 UART port.
I used a CD4052 as an expander for both transmit and receive at TTL level.
Needed 2 spare pins to select which UART to drive.
You may/(may not) need to add resistors to bias off the non-selected UARTs.
I see that there are replacements for the original CD part.
Mike |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9232 Location: Greensville,Ontario
|
|
Posted: Sun Jan 14, 2024 9:09 am |
|
|
gee Mike that sounds a lot easier than when I added a PC 8bit quad UART to a PIC16F877...back when the 'big animals' roamed......
sigh...
sadly I still have 2-3 tubes of 4052, 4051 and 4053...collecting dust...
Jay |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sun Jan 14, 2024 10:57 am |
|
|
I have used the PIC18F27Q84 and PIC18F47Q84, have had no issues with
them at all. Almost the same as the Q83 but a little better CAN module. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
Posted: Mon Jan 15, 2024 7:44 am |
|
|
Agreed, I was not looking at Can. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Thu Jan 18, 2024 6:11 am |
|
|
Quote: |
gee Mike that sounds a lot easier than when I added a PC 8bit quad UART to a PIC16F877...back when the 'big animals' roamed......
sigh...
sadly I still have 2-3 tubes of 4052, 4051 and 4053...collecting dust... |
I had considered relays/switches but prefered the solid state solution.
I also have some 4051/2/3 in the junk box, if I can find them.
They were useful for making chopper stabilised amplifiers in the 1970s!
It was relatively easy to to get ~1uV offset using cheap 741 type OPAs.
That was before the ready availability of OP07s and the like.
Could be tempted to go down the same route today, using a PIC to provide some of the functionality.
Very handy for thermocouples, strain-gauges, resistive current sensors etc.
Mike |
|
|
|