1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

race condition? between relays and 89C51 uC

Discussion in 'Embedded' started by Mak, Sep 17, 2011.

  1. Mak

    Mak Guest

    hello everyone,

    I have a RS485 based slave relay driver with 8 relays. The relays turn
    on at logic 0. Since the 89C51 has all ports as HIGH during reset, my
    relays should remain off. The problem that I am facing is that when I
    turn the power supply on, all the relays turn on momentarily and then
    back off. Is there a race condition during which the microcontroller
    is not gaining control of the relay command lines even though I have
    the 89C51 in reset since start? The reset is standard 10uF + 10k
    resistor to the ground, should I be focusing on changing those? I cant
    seem to find any other reason that would trigger the relays.

    Can someone please explain what areas I am over looking...

    Thanks in advance
     
    Mak, Sep 17, 2011
    #1
    1. Advertisements

  2. Mak

    Rich Webb Guest

    The 89C51 is on the slave relay board? And this board is a commercial
    product that is supposed to hold the relays in the un-powered state
    until commanded otherwise over the 485 line?

    Got a schematic?

    Scope the power supply, the reset line, the individual output bits, and
    the voltage across the relay coils.
     
    Rich Webb, Sep 17, 2011
    #2
    1. Advertisements

  3. Mak

    Arlet Ottens Guest

    Perhaps you're configuring the port direction as outputs, and then
    writing the port value as '1', instead of writing the port value first ?
     
    Arlet Ottens, Sep 17, 2011
    #3
  4. Mak

    cbarn24050 Guest

    I think 8051 ports are high z at reset, try putting pull up resistors
    on the port.
     
    cbarn24050, Sep 17, 2011
    #4
  5. Mak

    Tim Guest

    That's what I was thinking. If you have an oscilloscope try capturing
    the turn-on transient to know for sure.
     
    Tim, Sep 17, 2011
    #5
  6. Mak

    Joerg Guest


    Can you post a schematic? Else it'll be stabs in the dark. Ok, I'll take
    one: Could it be that the supply voltage for the relay driver comes up
    before the supply voltage for the 89C51 does?

    As Rich and Tim suggested, the quickest way to find out what's going on
    is a digital scope. Can be a very simple one.
     
    Joerg, Sep 18, 2011
    #6
  7. As others have said, use a scope to check.
    Also note that not all 89C51 variants have Async-Reset on the port
    pins;
    Many require the oscillator to be running, and that start-up time can
    give pin uncertainty.
    Which exact 89C51 variant are you using ?
    -jg
     
    Jim Granville, Sep 19, 2011
    #7
  8. Am 17.09.2011 16:23, schrieb Mak:
    Old 51-MCUs had different circuitry for port 0 and the other ports.

    cheers
    Gunther
     
    Gunther Mannigel, Sep 19, 2011
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.