Shop OBEX P1 Docs P2 Docs Learn Events
EDE702 falling out-of-sync — Parallax Forums

EDE702 falling out-of-sync

DigitalManDigitalMan Posts: 42
edited 2006-06-21 15:16 in General Discussion
I'm having issues using an EDE702 serial LCD interface chip with my BS2. I was about to ask what was wrong with my code on the BASIC Stamp board, but apparently my code is fine. After coming across something online that said LED's draw as much current as they can (I'm better with code, still kind of new with the component stuff), I added a resistor to both the display's backlight, and the LED on the·chip-controlled digital output that I use to check if the serial connection is working. Originally, it would send data properly once, with "Hello world..." on the first line and "Hi 1" on the second, but adding resistors somehow made it work for an average of 3 times (it's different every time I hit the power switch).

By·messing around further with disconnecting current drains, I·confirmed that the serial data is being sent properly, and can be received properly up to four times. However, after a maximum of about·6 seconds, the EDE702 stops receiving the data once again. What could be causing the EDE702 (which I guess is just a PIC chip) to have that kind of problem? Am I better off with a time-independant shift register?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
;Long live the SX18AC/DP!

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2006-06-20 13:15
    IS this a repeat of another thread??
    Post your code and your wiring diagram.
    Remember, for rs232, you need to have a common ground between the two!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Todd PetersonTodd Peterson Posts: 3
    edited 2006-06-20 14:05
    LED's put directly across a power source will attempt to draw an infinite amount of current. You'll always need to put a resistor in series with them. You can calculate the value based on Ohm's law, but a good place to start is around 330 Ohms. Most likely when you tried to source that must current from the EDE702's output pin you damaged the part.

    -Todd Peterson
    eLab Engineering
    www.elabinc.com
  • DigitalManDigitalMan Posts: 42
    edited 2006-06-20 23:04
    No, the situation isn't that bad, nothing is broken. It's just too·fast, or·too·slow. The fact that serial data is processed properly up to four times is proof of this. And it's not RS232, it's a·normal positive-logic BASIC Stamp signal. Also, it should be noted that the EDE702 is implemented on a PIC that can handle directly driving an LED.

    http://www.elabinc.com/ede702.pdf

    I think the issue is that the 4MHz crystal isn't quite right. I never did like those things. I guess with the BS2 I have no other option, but if I used a PIC or SX, could I make them share the crystal somehow? Then the timing might be odd, but at least it'd be the same on both chips.

    And if it is a repeat I'd love to see the other thread, maybe that guy found a solution.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ;Long live the SX18AC/DP!
  • steve_bsteve_b Posts: 1,563
    edited 2006-06-21 00:49
    I don't think you could 'share' the crystal between two devices....but I'll let someone else decide that for sure.

    If you have access to an oscilloscope....measure your crystal frequency. Then, us that to determine your baudvalue in your bs2 (I think there's a formula in the PBasic help file under SERIN/SEROUT).

    If you don't have access to one....try changing it in increments (of what...dunno) and see if things get better.

    Do you have an SX? The extra crystals that Parallax supplies with them are more accurate than the frequency generated from their own programming keys...so basically, when using an SX, you have to use the external crystal!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • DigitalManDigitalMan Posts: 42
    edited 2006-06-21 02:06
    Pfft, I wish I had an oscilliscope, that'd be quite nice.

    This could be happening because I'm using a breadboard and the crystal has leads a half an inch long. But the long leads are quite usefull for positioning it, so I'm reluctant to make them shorter unless it's guaranteed to work. Then again, I have pictures of this setup working fine for other people.

    It's clear that it starts out being right, and·slips at a rate of probably·a few·nanoseconds every cycle. This would require a processor 100 times faster than the EDE702 in order to make such minute adjustments.

    What I might do, is just use a clock driver from an·ancient·PC. It's designed to output a timing signal for an older CPU and a peripheral chip, to keep them perfectly synchronized. You just give it a crystal of twice the frequency you need, and let it run. Alternately, if I need many chips synchronized (which is likely), I can use a PIC with a quadruple-speed crystal (which I actually have); make the outputs all low in one cycle, NOP two, make all outputs high in one cycle, then jump back·which takes two cycles. Waste of a chip, though...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ;Long live the SX18AC/DP!
  • DigitalManDigitalMan Posts: 42
    edited 2006-06-21 02:11
    Pfft, I wish I had an oscilliscope, that'd be quite nice.

    This could be happening because I'm using a breadboard and the crystal has leads a half an inch long. But the long leads are quite usefull for positioning it, so I'm reluctant to make them shorter unless it's guaranteed to work. Then again, I have pictures of this setup working fine for other people.

    It's clear that it starts out being right, and·slips at a rate of probably·a few·nanoseconds every cycle. This would require a processor 100 times faster than the EDE702 in order to make such minute adjustments.

    What I might do, is just use a clock driver from an·ancient·PC. It's designed to output a timing signal for an older CPU and a peripheral chip, to keep them perfectly synchronized. You just give it a crystal of twice the frequency you need, and let it run. Alternately, if I need many chips synchronized (which is likely), I can use a PIC with a quadruple-speed crystal (which I actually have); make the outputs all low in one cycle, NOP two, make all outputs high in one cycle, then jump back·which takes two cycles. Waste of a chip, though...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ;Long live the SX18AC/DP!
  • steve_bsteve_b Posts: 1,563
    edited 2006-06-21 15:16
    Looks like you double posted there.

    I'd certainly shorten the leads....use a small pair of foreceps/pliers to reposition it if you have to!
    Is there a capacitor associated with the crystal package? How accurate it is? Is it in good condition? Check it with a meter if you can....maybe try replacing it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Sign In or Register to comment.