1
\$\begingroup\$

I am extremely new to this and I'm learning by building stuff myself so please let me know if this is too vague and I'll elaborate if I can. I'm sure this is something very simple, but can't figure out how to do it.

I have built radios before and know how to modulate a signal as ASK but now I'm trying to send a simple bitstream from a USB port to a radio's input. My idea was to use a serial program to dump bytes into the radio input signal but all the research I have done indicates using rs232 or UART or something. I have no experience with this and I don't want some protocol sticking parity bits in all over the place. I simply want to be able to send, for example, 0x1234 as 00000001000000100000001100000100 at a baudrate of \$2048\$. Can I go further and actually send individual bits like start/stop bits?

My intention is to monitor the frequency with an sdr and then learn how to demodulate the bits from the IQ data.

Is there a simple method outputting bytes directly onto the wire or something I don't know about which will prevent me?

Any help or direction would be greatly appreciated.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ USB doesn't work that way -- there is a lot going on in the differential pair signalling, you can't just bitbang one of the USB wires. Need a whole serial interface engine. Just get an Ftdichip.com FT232, you can easily bitbang the Ft232 pins without needing to dig into the USB specs. \$\endgroup\$
    – MarkU
    Commented Feb 8, 2015 at 1:41
  • 1
    \$\begingroup\$ USB raw wire is worse than parity bits, its closer to Manchester encoding with bit stuffing. And its always toggling with bus activity, every 1msec a new frame starts. \$\endgroup\$
    – MarkU
    Commented Feb 8, 2015 at 1:43
  • 1
    \$\begingroup\$ You should appreciate that the start, stop and (optional) parity bits in an async serial stream are not there for decoration, they serve a purpose. \$\endgroup\$
    – markt
    Commented Feb 8, 2015 at 3:09
  • \$\begingroup\$ Thanks MarkU. That sounds like exactly what I want to do! I already have a pl2302x (usb->ttl) lying around, will that do? and can anyone link me to a good tutorial on this bitbanging stuff? This sounds like my new favourite thing. \$\endgroup\$
    – tozhan
    Commented Feb 8, 2015 at 17:23

2 Answers 2

0
\$\begingroup\$

Another alternative is using a USB serial port, using the CTS/RTS and DSR/DTR signals as a 2 channel digital I/O.

The good part is that it is well packaged and easy to program, in most languages and OSes, and that the off-the-shelf hardware is readily available.

The drawbacks include that USB, as others have commented, cannot send individual bits, so the overhead is huge and timing and jitter may be a problem if you need precise timing.

Caveat hacker: I haven't done the maths for 2400bps, but I think it's OK, I've done this for at least 1200 bps if memory serves me right.

That said, using an existing protocol like RS232 is probably a simpler and more robust option.

\$\endgroup\$
0
\$\begingroup\$

2048 bits per second is pretty slow. You might try using a USB to parallel converter and bit-banging one of the pins in software. The FTDI UM245R might do the job. It even has a FIFO if you ever want to try higher bit rates.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.