Serial Communication with square wave generator board

Thread Starter

qitara

Joined Jan 18, 2013
112
Hi

I bought a few dual channel PWM generators which i found on the web, they are quite neat for their frequency range and the cool part is that they got serial com in them making the frequency and the duty cycle configurable via an external source. After multiple attempt to sending commands to the PWM generator using my computer and a serial analyzer software which i know works great as i have used it to send commands to other stuff before, i have been unable to externally configure it. The seller does not provide any support neither do i know who the manufacturer is.

The PWM generator came with the following information


The board has 3 pins for the serial com Rx,Tx,Ground which means it's a RS232 if i'm correct, still using the commands as listed above wont work. any idea ?
 

dendad

Joined Feb 20, 2016
4,451
It will be 5V serial signals probably, not RS232.
What actual electrical connection are you trying to drive it with?
Have you tried a USB to TTL serial adapter?
 

Thread Starter

qitara

Joined Jan 18, 2013
112
I haven't tried TTL, but what make you think its TTL
Am no expert but TTL uses 4 pins, the board only has 3
 

shteii01

Joined Feb 19, 2010
4,644
They are using Tx and Rx labels. Those are normally associated with UART. Which normally means that you need USB to TTL translator chip. I am planning to use Arduino Uno for this purpose, by bypassing the microcontroller and just using USB to TTL translator chip that comes standard on Uno.
 

dendad

Joined Feb 20, 2016
4,451
No. "TTL" does not need 4 pins. TTL refers to the voltage level and it is probably not really correct to say it is 0/5V but that is what it has often come to refer too.
I think you will need 0/5V signals (it could be 3.3V but 5V is more common). RS232 can be +/- 12V and if you hook an RS232 signal like that into it you will most likely pop it.
 

Thread Starter

qitara

Joined Jan 18, 2013
112
OK i got one "USB to TTL" but as said it's 4 wires... do i connect the RX,TX,Ground and leave the ACC wire ?
 

Thread Starter

qitara

Joined Jan 18, 2013
112
Big thanks to all of you guys... RX,TX,GROUND did the job...

In simple terms if some one could explain... what the difference is between RS232 and TTL, Is it the same exact protocol but with different signal voltage levels or something completely different ?
 

MrChips

Joined Oct 2, 2009
30,706
Big thanks to all of you guys... RX,TX,GROUND did the job...

In simple terms if some one could explain... what the difference is between RS232 and TTL, Is it the same exact protocol but with different signal voltage levels or something completely different ?
TTL is the raw logic signal, usually 0 to 5V.
RS-232 is same protocol but the levels are reversed (inverted) and voltages are anything from ±5V to ±15V.

For example, if RS-232 is ±10V,
5V TTL becomes -10V
0V TTL becomes +10V
 

dendad

Joined Feb 20, 2016
4,451
And to just confuse things further, you can run various data protocols over both TTL and RS232!
For something so simple, serial connections and getting the protocols and handshaking correct can cause a lot of headaches.
Like they say, standards are so good, that's why we have so many ;)
 

MrChips

Joined Oct 2, 2009
30,706
So TTL is basically used for direct communication to micro controllers ?
That is one way of putting it but let's not say it like that.

Think of if this way:

1. Design a UART using standard TTL logic.
2. Send the serial data using a robust protocol and medium over 300m. That is where RS-232 comes in.
 

dendad

Joined Feb 20, 2016
4,451
I'm pleased you figured it out. Those boards look interesting.
You can use differential RS485 to drive serial comms over a km or more. TTL is for short range, usually board to board, RS232 if for quite a few meters.
It is a good idea if you are driving comms externally to use some sort of isolation from the processor to protect it from zaps. So use RS232 or RS422, RS485....
I think nowadays, RS232 is a thing of the past. Most devices have USB or network connectivity. In industrial control, a lot of older devices have RS232 but others use Ethernet, RS485 or CAN. Most new cars now have CAN in them.
A lot of the controllers I make have RS485 half duplex networking. This allows multiple devices to communicate on a 2 wire + gnd network.
It is worth having a look at various serial/networking systems.
 
Top