Maker Pro
Maker Pro

RS232 message to pulse

Andy3405

May 11, 2016
2
Joined
May 11, 2016
Messages
2
I have a device that outputs a serial RS232 message every 5 seconds. I would like to use this device as a pulse generator, but I don't know how to ignore the next highs and lows which are part of the message and will last for about 0.1 seconds, until the next message 5 seconds later. Any ideas of what I should look into?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,719
Joined
Nov 17, 2011
Messages
13,719
Use a monostable multivibrator (monoflop). It will be triggered by the first edge of the signal on the RS232 line. Make the duration of the monoflop a bit longer than the longers RS232 'message'. This will give you one pulse for every RS232 'message'.
 

Andy3405

May 11, 2016
2
Joined
May 11, 2016
Messages
2
Yes, this is definetely the solution to the stated problem. Unfortunately, I just realised that I need something a little bit more complicated than this. What If I want to trigger every nth message(let's say 2nd), and the time between messages is 0.1 seconds, not 5, and the messages are about 0.05.
Reusing your answer, I should be able to set the duration to 0.15 and then I should be good. Also, if I want to trigger every 3rd time, I should just increase the duration to 0.25. But I believe the below 0.1 seconds duration becomes an issue now. Should I use a counter instead?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,719
Joined
Nov 17, 2011
Messages
13,719
A counter is definitely the better solution.
Alternatively use a microcontroller with UART interface and manage the complete timing in software, if you're comfortable with programming a microcontroller.
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
+1 on a small Micro if practical, you get a interrupt flag every char input, the extra processing power would allow you to do as you wish with the No. of chr's etc. and be more flexible.
M.
 

AnalogKid

Jun 10, 2015
2,892
Joined
Jun 10, 2015
Messages
2,892
Is the RS-232 message at true 232 signaling levels (+/-9 V or so), or at logic levels (5 V or 3.3 V)?

A true monostable circuit (with feedback) will put out a constant pulse for each message. That can increment a CD4017 counter that steps through its outputs like a rotary switch until it gets to one that is tied to its reset. That one is your output pulse. If you want independent adjustability of the output pulse width, the reset signal fires another monostable that makes the output pulse. In this way, moving a jumper changes the number of messages desired between output pulses.

Two CMOS chips:
CD4093 - both monostable circuits built up with one chip.
CD4017 - Johnson decade counter.

ak

Note, no 555's or microcontrollers were employed in the making of this response.
 
Top