Shop OBEX P1 Docs P2 Docs Learn Events
Single wire serial-line noise — Parallax Forums

Single wire serial-line noise

DosManDanDosManDan Posts: 179
edited 2008-06-15 10:48 in General Discussion
I have one SX-28 talking to another SX-28 using a single wire serial connection. The second SX-28 is controlling an LCD.

The problem is, I'm receiving random characters in between and after the actual characters I'm sending to the LCD panel. I moved the serial wire over to a BS2 and it worked perfect. So, I have to believe there is something up with the SX-28. Should I have the SX-28 port set to TTL or CMOS?

I'm using the same schematics and hookup as shown in the LCD example from the SXB help file.

I put the ocsilliscope on the serial line, and the garbage characters are actually coming in on the line from the first SX-28. Could this be caused by a timing issue or line noise?

I'm using the SEROUT command on both the BS2 and SX-28. I'm starting to wonder if the difference is in the way the BS2 and SX-28 handle that command. On the BS2, I can send a string, and on the SX-28 I can only send a byte at a time. To communicate with the LCD panel, I need to send two bytes, one with the command and the other with the character I want to display.

Thanks in advance!
Dan

Comments

  • BeanBean Posts: 8,129
    edited 2008-06-13 21:25
    Dan,
    Are you using the internal clock ? If so it is not accurate enough for serial data.
    If you are using an external resonator, then I'm not sure what is going on ?
    Post your code.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com

    ·
  • DosManDanDosManDan Posts: 179
    edited 2008-06-13 22:12
    I'm using a Murata 4MHZ OSC on both of the SX-28 chips.

    The code on the second SX-28 is exactly the same as the code in the SXB Help file, under Serial LCD Example.

    I have attached the code for the first SX-28.

    Thanks again Bean!

    Dan
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-13 22:23
    Try adding a pullup resistor to the serial line at the receiving end. It sounds like the line might be tri-stating between characters.

    -Phil
  • DosManDanDosManDan Posts: 179
    edited 2008-06-13 23:12
    I have a 22ohm resistor on pin RA0, and a 4.7K resistor to +5V, and the serial wire connects to them both. I think I'm covered on the pullup on this.

    The resistors are connected to the second SX-28, it controlls the LCD.

    Thanks!
  • BeanBean Posts: 8,129
    edited 2008-06-14 00:57
    Dan,
    On your DEVICE line, you have "OSC4MHZ" that means to use the internal 4MHz.
    Change it to OSCXT1 for the 4MHz resonator.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com

    ·
  • DosManDanDosManDan Posts: 179
    edited 2008-06-14 04:13
    Bean...I feel so dumb...that was it. This was the first time I used an external oscillator. Lesson learned.

    Could I also use?: OSCHS1

    Thank you very much!!!

    Dan


    Post Edited (DosManDan) : 6/14/2008 5:37:21 AM GMT
  • BeanBean Posts: 8,129
    edited 2008-06-14 11:32
    Dan,
    No problem, it is a common mistake.
    I ususally use OSCHS1 for 20Mhz.
    Sometimes you have to experiment with the different OSC settings to get the resonator to run properly.
    I usually start at the lowest and move up until it works reliably.
    Using a setting that is too high will cause the SX to draw more current, and could damage the resonator.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com

    ·
  • DosManDanDosManDan Posts: 179
    edited 2008-06-15 10:48
    Ooops, guess I should have read your response first. I did notice the voltage regulator on my PDB heating up. Guess I better change that device line fast!!

    Dan
Sign In or Register to comment.