Multiple serial input sources

20 views
Skip to first unread message

Hans van Veldhuizen

unread,
Aug 5, 2025, 1:02:46 PMAug 5
to jallist

Hello, I have a question:
I have five measurement units that all send their values continuously in the same text format at 9600 baud.
I want to read them sequentially onto one UART. Does anyone have any tips on how I could do this?
Thanks in advance.
Regards,
Hans

Rob CJ

unread,
Aug 5, 2025, 1:15:45 PMAug 5
to jallist
Hi Hans,

If they do not write the data at the same time you can use a multiplexer to select each unit invidually.

For example the 75HC151 is an 8 input mutiplexer. You can then select with your PIC 1 of 8 (or in your case 1 of 5) using the three select inputs.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Hans van Veldhuizen <hanz...@zeelandnet.nl>
Verzonden: dinsdag 5 augustus 2025 19:02
Aan: jallist <jal...@googlegroups.com>
Onderwerp: [jallist] Multiple serial input sources
 
--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jallist/4a99241c-c528-4464-96de-1e0d6269caa2n%40googlegroups.com.

pinhe...@gmail.com

unread,
Aug 5, 2025, 1:40:37 PMAug 5
to jallist
Why not simply use PSP to select the input that goes into the uart ?

The PSP can easily do the job of the 74151.
You only need 5 inputs instead of 3 (maybe also a 4th for control of the mux)



Hans van Veldhuizen

unread,
Aug 5, 2025, 1:45:23 PMAug 5
to jallist
Rob, you mean 74HC151. I have found sum 74HC4051 , is that the same?
Pinhead what is a PSP?

Op dinsdag 5 augustus 2025 om 19:40:37 UTC+2 schreef pinhe...@gmail.com:

pinhe...@gmail.com

unread,
Aug 5, 2025, 1:53:09 PMAug 5
to jallist
I meant PPS, sorry....

Peripheral Pin Select 


Rob CJ

unread,
Aug 6, 2025, 2:27:38 AMAug 6
to jal...@googlegroups.com
Nice suggestion using PPS but I thought you can only use PPS once, that is, it cannot be changed dynamically.

Met vriendelijke groet,
Rob Jansen

From: jal...@googlegroups.com <jal...@googlegroups.com> on behalf of pinhe...@gmail.com <pinhe...@gmail.com>
Sent: Tuesday, August 5, 2025 7:52:57 PM
To: jallist <jal...@googlegroups.com>
Subject: Re: [jallist] Multiple serial input sources
 

pinhe...@gmail.com

unread,
Aug 6, 2025, 3:23:42 AMAug 6
to jal...@googlegroups.com
It all depends on the value of the 1PPS fuse.   

Rob CJ

unread,
Aug 6, 2025, 1:41:15 PMAug 6
to jal...@googlegroups.com
Hi Pinhead,

Yes you are right, you can change the PPS-es if not locked.

Nice solution.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens pinhe...@gmail.com <pinhe...@gmail.com>
Verzonden: woensdag 6 augustus 2025 09:23
Aan: jal...@googlegroups.com <jal...@googlegroups.com>
Onderwerp: Re: [jallist] Multiple serial input sources
 

Rob CJ

unread,
Aug 7, 2025, 2:48:09 PMAug 7
to jal...@googlegroups.com
Hi all,

Did not anwer one question.

Yes I meant 74HC151 but a 75HC51 also works and you can try - if your PIC has PPS - to change the USART input if you want to get the input of different devices.

Kind regards,

Rob



Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Rob CJ <rob...@hotmail.com>
Verzonden: woensdag 6 augustus 2025 19:41

pinhe...@gmail.com

unread,
Aug 7, 2025, 5:25:11 PMAug 7
to jal...@googlegroups.com

Hans van Veldhuizen

unread,
Aug 8, 2025, 9:50:59 AMAug 8
to jallist

Rob, Pinhead,
The PPS case is too complex for me; it's just given me a headache. I went back to the old ones who have never let me down.
By the way, I can't find anything about a 75HC51, but I do know that it's an American license plate.
Oh well, I'll see.
Hans
Op donderdag 7 augustus 2025 om 23:25:11 UTC+2 schreef pinhe...@gmail.com:

pinhe...@gmail.com

unread,
Aug 8, 2025, 9:58:25 AMAug 8
to jallist
Hi Hans,

POS is really simple to use.  Just do it once, dig into the datasheet and you'll see.

As soon as I will have access again to my pc, i will send you an example 

David


Rob CJ

unread,
Aug 8, 2025, 12:46:45 PMAug 8
to jallist
Hi Hans,

It was the 74HC151.

About PPS. I know you often use older PICs and they do not always have the PPS functionality.

Which PIC do you want to use?

BTW. The issue with PPS is - at least that is what I noticed - that even if you use pins at their default location you still need to apply the PPS. I would have expected that you only neede PPS if you want te reassign pins to other locations than the default location but apparently for default it is also needed.

For example in the project I just posted I am using IIC on the standard pins of the PIC16F1765 and still I need to do the PPS, like this.

; Set IIC default pins.
include pps
pps_control_lock(FALSE)                
RC0PPS = PPS_SCK  ; IIC SDL to C0  (default).          
RC1PPS = PPS_SDA  ; IIC SDA to C1  (default).    
pps_control_lock(TRUE)                

So if you want to use PPS and change the input pin assignments for your UART you have to repeat the above steps. Also note that not all ports can be used for PPS, that is also mentioned in the data sheet of the PIC that you want to use.

Kind regards,

Rob



Verzonden: vrijdag 8 augustus 2025 15:58
Aan: jallist <jal...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages