Shop OBEX P1 Docs P2 Docs Learn Events
Asking help with comm noise — Parallax Forums

Asking help with comm noise

ElectronegativityElectronegativity Posts: 311
edited 2006-05-11 22:57 in General Discussion
Hi all:

I am trying to set up a 3-wire asynchronous serial communication between an SX52 protoboard and a home-brewed SX28 project.
I made the communication asynchronous since I want it to work seamlessly between SXs running at different clock speeds without having to tweak things by hand every time.

The three wires are ready to send, clear to send, and serial data.

It's almost working but there is some kind of noise on the lines that's getting interpreted as data.

I have diodes on RTS and CTS since each acts as a one-way line on which one device always talks and the other always listens.

Both microcontrollers are powered from the same supply and share a common ground.
They are running at 4MHz off of their internal oscillators.

There seems to be fluctuation and "Floating" of the low voltage off of ground.
When the pins are hot the voltage holds steady.

Should I use pull down resistors?
Capacitors?
Something else?

Thanks,
-Electronegativity

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I wonder if this wire is hot...

Comments

  • JavalinJavalin Posts: 892
    edited 2006-05-10 09:12
    Electronegativity,

    Are you using TRUE or INVERTED serial?

    If you are using TRUE (i.e. the idle state is a logic LOW) then you will need to use 10k pull DOWN (to ground) resistors.

    If you are using INVERTED (i.e. the idle state is a logic HIGH) then you will need to use 10k pull UP (to VDD) resistors.

    You will also have to initialize your Serial PIN to be initially HIGH or LOW depending.

    Let us know how you get on,

    James
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-05-10 15:07
    Hi Javelin.

    It's not true or inverted or anything.

    I wrote some assembly code so that the SX52 brings a RTS line high when it is ready to send a bit.
    When the SX28 sees RTS high it brings CTS high to signal that it is ready to recieve a bit.
    Then the SX52 moves a 1 or 0 to the data line and drops RTS low.
    When the SX28 sees RTS go low it rotates the 1 or 0 into a data input register then drops CTS low.
    When the SX52 sees CTS drop low it knows the bit has been received and brings RTS high to signal that it is ready to send the next bit.

    This should work even if both microcontrollers are running at completely different frequencies.

    I'm thinking that pulldown resistors will work because the problem seems to occur when one of the lines is supposed to be low.

    I started this thread mostly to find out what other people do.
    Is is standard operating proceedure to put pulldown or pullup resistors on all communication lines?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • BeanBean Posts: 8,129
    edited 2006-05-10 15:26
    Electro,

    Then that is syncronous communications.
    I suspect the diodes are causing the problem. Then you make the pin low the signal after the diode is basically floating.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com


    COMING SOON "SD DATA LOGGER" www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-05-10 15:33
    Thanks Bean.

    I put the diodes in at an earlier stage when each microcontroller was running off its own power supply.
    This caused all kinds of strange voltages and the diodes seemed to help a bit.

    I will remove them and use pulldowns to ground instead.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • JavalinJavalin Posts: 892
    edited 2006-05-10 16:31
    Electro,

    Ah, I assumed it was A-sync serial.

    James
  • SteveWSteveW Posts: 246
    edited 2006-05-10 21:48
    >I am trying to set up a 3-wire asynchronous serial communication
    >The three wires are ready to send, clear to send, and serial data.

    Hmm, an odd strategy, but fair enough.
    However, can you confirm that there's a 4th wire for ground, please?
    Also, it's a bit tricky to work out what you've actually built. A schematic would probably help us help you. Annotate it to show what you think should be happening, if you like.

    Steve
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-05-10 22:09
    Hi Steve, right now both SXs are running off the same power supply and share a common ground.

    There's no actual schematic of the whole project, and it's pretty involved.

    Basically it's an SX28 on a PCB with a MAX7219 display driver, a LTC1298 ADC, 8 digits of 7-segment LED, a potentiometer, and 4 dip switches.
    All the remaining pins go out to headers as general purpose I/O. I'll try to get a picture tonight if you want.

    Right now it can measure resistance, capacitance, or voltage and display the result.

    The plan is to use it as a readout for what other projects are doing so I can see the effects of different hardware or software.
    In the current case I want to connect a Memsic accelerometer to the SX52 protoboard and find out how much difference it makes if I sample the 100 Hz duty cycle at 4 or 50 MHz clock speeds, and how much improvement does a crystal give over the built in oscillator.
    By displaying the raw data (number of clock cycles that the duty cycle is high) I will be able to directly see the signal to noise ratio.

    I think Bean figured it out; the diodes were a mistake and they are causing the voltage to float off the ground because it can't go backwards through the diode.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-05-11 22:57
    Thanks a lot everyone, it works fine now.

    I've attached a picture.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
    1600 x 1200 - 709K
Sign In or Register to comment.