13.07.2015 Views

AVR415: RC5 IR Remote Control Transmitter

AVR415: RC5 IR Remote Control Transmitter

AVR415: RC5 IR Remote Control Transmitter

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The SoftwareMainThe assembly code found in the <strong>AVR415</strong>.ASM file contains the latest <strong>RC5</strong> <strong>Transmitter</strong>software.The main program flow is shown in the flowchart in Figure 7. The program execution canbe divided into two routines. Both of them are interrupt driven, and use different Powerdownmodes to reduce power consumption. The program is designed to use only onelevel of hardware stack, leaving two levels for user code.The main program loop is shown in Figure 7. First all registers are initiated; The hardwaremodulator is configured for correct frequency and duty-cycle. In this application38 kHz is used as the carrier frequency. This differs from the <strong>RC5</strong> standard, which specifies36 kHz for the carrier wave. The <strong>RC5</strong> signal will however be the same, and moststandard <strong>RC5</strong> Receivers should have no problem receiving and decoding the signal.Once the IO modules are initialized the purpose of the main loop is to decide what sleepmode to use after the next wake-up.Figure 7. Main Loop FlowchartStartInit Registers.Init Port Pins to Idle State.Enable <strong>IR</strong> Driver.Enable Hardware Modulator.ExecuteInterrupt CodeIs LastTransmissionFinished?NoYesEnable Low Level Interrupt.Enable Power-downEnable IdleModeEnable Interrupts.Enter Sleep4 <strong>AVR415</strong>2534A–AVR–05/03

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!