Technique by which garage door remote "learns" unique code

Discussion in 'Embedded Systems and Microcontrollers' started by PaulEE, May 5, 2012.

  1. PaulEE

    Thread Starter Member

    Dec 23, 2011

    At my house, I have a fairly new garage door opener system. The brand is Marantec.

    The system has a main control board and several remote controls by which you can open or close (or stop) the door.

    The system works by first programming each remote control with the same code and then pairing the remote with the main control board. In this way, each device, whether a remote or the control board, knows the code and can operate the door.

    To physically program one remote with another remote (such that both have the same code), you must connect a three-pin jumper cable between the devices and press the button (there is only one button on each remote) on the master remote, wait a few seconds, push the button on the slave remote, wait a few seconds, and then the code transfer is complete.

    My question is this:
    How, programmatically, does the slave remote "learn" the code?

    I am familiar with I2C, SPI, and RS232. I understand that you can move bytes back and forth. What I'm trying to understand is the topology of the algorithm that allows you to "program" one remote with another.

    Is it a state machine? Are interrupts involved? I assume the code has to be stored in EEPROM; otherwise, upon releasing the transmit button, it would lose its data.

    Any help, tips, direction-pointing, datasheets, application notes, or real life experience, would be great.
  2. Markd77

    Senior Member

    Sep 7, 2009
    Just a guess, but either remotes are always listening, or connecting the cable triggers a listening mode. When the button on the first remote is pressed the code is sent, pressing the button on the second saves the code. You would need a logic analyser or a scope to see what is actually happening. There could be two way communication (unlikely) and error checking.
    How it's implemented is unknown, it could be anything. It might be stored in EEPROM or RAM, you would be able to tell by removing the battery for a while and seeing if it loses it's code.
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    As Mark said, all we could do is guess.

    3 pins could be ground, data & clock for I2C or some other serial communication method. An ohmmeter (to find ground) and a scope could buzz these out.

    Assuming all units are the same, when the button is pressed a device would look at the 2 lines (third line is probably ground remember) for any changes. If nothing is detected it goes into master mode and continuously transmits it's code for several seconds.

    When the second unit is enabled it also looks at the two lines but it sees the master transmitting, so it receives the code, probably verifies it receives the same code over and over, and ultimately saves it somewhere somehow, such as flash memory.

    A procedure such as this means when no change is seen on the programming pins the unit is free to do other things, such as transmit it's code over the ether.
  4. PaulEE

    Thread Starter Member

    Dec 23, 2011
    Thank you both. It is most likely I2C; the two outer pins on the three-pin header are shorted and connected electrically to ground.