HeroMicro HM0038 KEELOQ® Hopping Code Encoder Usage Guide

The HM0038, introduced by HeroMicro, is a KEELOQ® hopping code encoder specifically designed for high-security Remote Keyless Entry (RKE) systems. It employs a patented nonlinear encryption algorithm to ensure that every transmitted code is unique, effectively thwarting common security threats like "replay attacks" and "code scanning." This chip is an ideal solution for one-way wireless control applications such as automotive security, garage door openers, and home security systems, particularly in low-voltage, battery-powered scenarios (2.0V to 6.3V).

1. Key Features Overview

Based on the datasheet provided by HeroMicro (HM0038.pdf), key features include:

  • High Security:

    • 66-bit Transmission Code: Comprises a 32-bit hopping code (unique each time), a 28-bit unique serial number, and 6 information bits (4 button + 2 status).

    • 64-bit Read-Protected Key: Stored in internal EEPROM and inaccessible via external pins.

    • Non-Volatile Synchronization Counter: Guarantees code uniqueness for over 64,000 (up to 192,000) transmissions.

  • Ultra-Low Power & Wide Voltage:

    • Operating Voltage Range: 2.0V to 6.3V, making it perfect for coin-cell or AA/AAA battery-powered applications.

    • Extremely Low Standby Current: Typical value of only 0.1μA, greatly extending remote battery life.

  • Simple to Use:

    • Four independent button inputs (S0-S3), enabling up to 15 different functions through combinations.

    • No external components required; it can be directly connected to an RF transmitter circuit.

    • Built-in oscillator and pull-down resistors simplify hardware design.

  • Intelligent Features:

    • Low-Voltage Detection & Indication: Can send a low-battery signal to the receiver and flash an LED to alert the user.

    • Auto-Shut-Off: Prevents excessive battery drain if a button is stuck (stops transmitting after ~25 seconds).

    • Seed Code Transmission: Pressing all four buttons simultaneously sends a fixed 32-bit seed code for a "Secure Learn" process.

  • Package: SOP8/DIP8

2. Pin Configuration (8-Pin)

PinSymbolFunction
1S0Button Input 0
2S1Button Input 1
3S2Button Input 2 / Programming Clock
4S3Button Input 3
5VSSGround (GND)
6PWMPWM Encoded Output / Programming Data
7LEDLED Drive Output (Active Low)
8VDDPower Supply

3. Critical Design Guidelines

(1) Typical Application Circuit

  • The application circuit is extremely simple. Connect one side of each of the four buttons (S0-S3) to ground and the other side to the corresponding chip pin. Internal pull-down resistors ensure the pins are low when no button is pressed.

  • The PWM pin (Pin 6) connects directly to the data input of an RF transmitter module. This pin outputs the modulated code signal, ready to drive a simple ASK/OOK transmitter.

  • The LED pin (Pin 7) can drive an external LED (with a current-limiting resistor to VDD). The LED stays on during normal transmission and blinks at ~5Hz when the battery is low.

(2) Understanding the "Learn" Process

  • Before use, the transmitter (HM0038) must be "learned" by the receiver. This pairing process requires the receiver to acquire and store the transmitter's serial number, synchronization counter value, and decryption key.

  • Secure Learn: By pressing all four buttons simultaneously, the HM0038 transmits a pre-stored 32-bit seed code. The receiver uses this seed to generate the same key as the transmitter, completing the highest level of secure pairing.

(3) Programming (Burning)

  • The HM0038 is blank from the factory and must be programmed with critical parameters via its programming interface, including:

    • 28-bit unique serial number

    • 64-bit encryption key

    • Initial synchronization counter value

    • Configuration word (for setting baud rate, low-voltage threshold, auto-shutoff enable, etc.)

  • Programming Method: Pull the S2 (or S3) pin high for a specific duration, then pull the PWM pin high to enter programming mode. Thereafter, S2 (or S3) acts as the clock line, and PWM as the data line, to serially write the 192-bit configuration data.

  • Critical Warning: To prevent accidental entry into programming mode, the circuit connected to the PWM pin (e.g., the base of a PNP RF transistor) must never pull it high.

(4) Configuring the Low-Voltage Threshold

  • The VLOW SEL bit in the Configuration Word (CONFIG) selects the low-voltage alarm threshold.

    • VLOW SEL = 0: For 3V battery systems (e.g., CR2032).

    • VLOW SEL = 1: For 5V/6V battery systems (e.g., 4xAA batteries).

(5) Multi-Button Combinations

  • Pressing multiple buttons simultaneously expands functionality. For example, pressing S0 alone is one function, while pressing S0 and S1 together is another. Up to 15 distinct hopping code commands can be implemented.

4. Typical Applications

Automotive Key Fobs: For door lock/unlock, trunk release, panic/locate functions.

Garage/Gate Remote Controls: Provides secure and reliable wireless access.

Home/Commercial Security Systems: For arming/disarming and emergency alerts.

Identification Tokens: As a low-cost, high-security physical token.

5. Summary

HeroMicro's HM0038 offers a complete, cost-effective, and highly secure solution for various low-voltage, battery-powered one-way wireless remote control applications, thanks to its robust KEELOQ® hopping code security, ultra-low power consumption, and minimal external components. Designers only need to focus on the buttons, RF transmitter, and power supply to quickly develop reliable and long-lasting remote control products.


Relevant content