• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Simple clocking circuit for a serial tty?

Status
Not open for further replies.

MrUmunhum

New Member
Hi group,

Does anyone have a simple (non-PIC) clocking circuit I can use to drive a serial line, transmit and receive?
Can a 555 timer be used?
Even 300bps will work for this. Just real simple single byte transfers.

Thanks for your time.
 

MrUmunhum

New Member
You could use any stable clock you like, the rest of the circuit is the more complicated part - what EXACTLY are you trying to do?.
Nigel,
I am working on a project that uses the serial tty control pins to cause interrupts. My problem is that there are only 4 input pins to use, DCD, DSR, CTS and RNG. I was thinking that I could use the output line to trigger an interrupt? I found a chip that I can use to read that doesn't require an external clock signal but not the write side.
 

Sceadwian

Banned
Why not make life easier and use a micro controller?
A 555 might be able to produce a stable enough clock to transmit data at 300 baud maybe a bit higher stability is the key. The thing about most PC's uarts is they adapt to the clock of the incoming data, but they drift if you send long bytes of constant data as the clock error is compounded with each byte sent, so with an inaccurate clock you an get good results if you put a long delay in between each byte transmission, that way the PC uart will re-sync for each byte. I've run into this problem even on an AVR that didn't have an accurate enough clock for high buad rates, transmitting a byte with a long delay inbetween always worked but as soon as long strings were sent it would desync and you'd get garbage. Thermal and voltage drift of the 555 and ageing of the caps might change the frequency over time enough that it wouldn't work reliably.
 
Last edited:

MrUmunhum

New Member
This project is too simple for a PIC

I will at some point in time start using PICs but this project is not the right time to start that learning curve. I think that even the clock is going too far? I get wrapped up in a project and it just keeps getting in deeper and deeper. I started this one as a way of inputting a simple start/stop control to another program that records audio files. It's getting too complex for now.

Thanks for your time.
 

Sceadwian

Banned
This is what micro controllers are good for, because with digital logic, and even a lot of analog stuff you can just throw a micro controller at it and not only do half or better of your problems go away but you have more possibilities to chose from because of all that power sitting there in that little package =) I personally would recommend AVR's over PIC's and some users would agree with me as from a hardware standpoint they have a decent amount more power and flexibility. PICs do have more users out there, and there are more PIC users here, but this shouldn't be the primary reason for choosing a micro controller as support is out there for both for anyone that asks. From an ASM standpoint I wouldn't recommend a PIC at all they're horrible to program in with ASM, AVR's were designs to be C compiler and ASM friendly. For basic and C both PICs and AVRs are compareable though AVR's have more useable processor power even on chips running at the same speed.

The sooner you jump in the better =) The first thing I ever learned to do was blink an LED through a resistor on a micro controller before I knew even the first bit about analog or digital electronics, and that's even before I even knew what the resistor was for.

If you can get someone's help choosing an appropriate programmer and a specific chip to program that's not too difficult there are basic language compilers that are extremely easy to program with at the start, and then you can move up to C or ASM at a later point in time if you even need to.
 

Leftyretro

New Member
Nigel,
I am working on a project that uses the serial tty control pins to cause interrupts. My problem is that there are only 4 input pins to use, DCD, DSR, CTS and RNG. I was thinking that I could use the output line to trigger an interrupt? I found a chip that I can use to read that doesn't require an external clock signal but not the write side.
This is a little confusing. The control signals (DCD,DSR,etc) are single independent digital input or output signal lines that have no timing relationship with any possible clocked serial data on the send and receive lines. These are not serial signals but rather parallel logic signals. You don't need clock timing to send or receive these control lines, just possibly voltage level converters depending on what voltage levels are being used on the two sides of the control signal(s).

Lefty
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Nigel,
I am working on a project that uses the serial tty control pins to cause interrupts. My problem is that there are only 4 input pins to use, DCD, DSR, CTS and RNG. I was thinking that I could use the output line to trigger an interrupt? I found a chip that I can use to read that doesn't require an external clock signal but not the write side.
Hardly an 'exact' description of what you're trying to do, it doesn't even mention what you're using, or what you're trying to do - it really still tells us nothing.
 

Sceadwian

Banned
Lefty, he's using the control lines as digital I/O into the computer to avoid using a clock. I've seen people use it like that before. If you want and you can pole the serial port fast enough you can actually use those condition lines to transmit clocked serial data. Just pick one line as a clock and sample the UART faster than 4 times the incoming clock rate. That gives you three bits to use for data. Not ideal but it works.
 

Leftyretro

New Member
Lefty, he's using the control lines as digital I/O into the computer to avoid using a clock. I've seen people use it like that before. If you want and you can pole the serial port fast enough you can actually use those condition lines to transmit clocked serial data. Just pick one line as a clock and sample the UART faster than 4 times the incoming clock rate. That gives you three bits to use for data. Not ideal but it works.
Yes, I know about bit banging asynchronous serial data, but it's not clear at all that is what he is trying to do but I wish him luck anyway ;)

Lefty
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top