B&K 4070A user manual Appendix B, Television Remote Control Example

Page 82

Appendix B

Television Remote Control Example

This chapter contains an example program written in Microsoft QuickBasic for controlling the 4070A remotely. It is used here to drive an infrared LED to issue commands to a TV or a VCR. It uses the 4070A in Burst mode to emulate the same waveforms used in many infrared remote control transmitters.

Background

Many TV remote controls operate by flashing an infrared LED at a carrier frequency rate in the ultrasonic frequency band (usually 30-40 KHz). Short bursts of these pulses are used to form various remote control commands to command the TV power on or off, change the channel, etc. Often it is the number of bursts, which determines which command is which.

Some TV's and VCR's count the number of pulses to distinguish between commands. The pulse sequence for a TV receiver was determined by examining the signal generated by the remote control unit. An oscilloscope was used to observe the waveform across the remote transmitter's LED. Using the oscilloscope, the carrier frequency, and pulse on time, pulse off time, and number of pulses for several commands was measured.

These parameters were then entered into the Basic program. The Basic program takes these parameters and issues commands to the 4070A to generate the same pulse train using the Burst mode of operation. A program menu asks the user which command to generate.

Hardware Setup

You must connect a serial cable between your computer and the RS-232 port connector on the rear of the 4070A. For more information on how to do this, refer to chapter 6.0.

The program assumes you are using serial port 1 (COM1). If you are using another serial port, change the OPEN COM1... statement in the beginning of this program. It also assumes that the 4070A baud rate is set to 9600. To check the 4070A baud rate, press the Mode then offset keys.

You must also wire the output of the 4070A to an infrared LED. The diagram below shows how to do this. Don't forget to aim the LED towards the device you wish to control.

To

3 9 0

 

SYNC Out

 

Connector

 

I n f r a r e d

L E D

( A i m t o w a r d

t e l e v i s i o n )

Figure B-1: Infrared LED hookup

This program does the following:

1.Clear the screen

2.Open the serial communications port for communicating with the 4070A

3.Make sure there is a 4070A connected to the serial port. If we can't find one, wait until it is connected up.

4.Command the 4070A to enter Burst mode.

5.Set up the burst frequency, on time and off time. On time is the burst duration, off time is the burst delay.

6.Present a menu to the user asking which remote control command to issue (i.e. power on/off, change channel, etc.)

7.When a command is selected, command the 4070A to generate the same number of pulses associated with the selected command.

NOTE: This program uses the same subroutines as those listed in Appendix A.

77

BK Precision 4070A User Manual Rev.2.2

Image 82
Contents User’s Manual Page Model 4070A User’s Manual +K Precision CorpTable of Contents Arbitrary waveform system Warranty informationRemote operation DC Operation OptionIntroduction Description Feature summary ModesSync out connector Installation and setupSIG Out connector External Modulation In connector External Trigger/Gating/FSK/BPSK input RS232 Interface connector External Reference Input / Ext Arb. Clock connectorExternal Arb Sync In / Out connector Line in connectorField arrow keys Mode keyOperating controls and keys Recall / Store keyNumeric keys 0 to 9, Trigger keyÉ, ê, è, ç keys Clear key One Touch Mode KeysMHz/dBm, KHz/Vp-p/Sec, Hz/mVp-p/mS keys Changing frequency Operating mode selectionOperating guide Changing levelModifying an existing value Changing valuesEntering a new value Basic Sinewave CW Mode Mode descriptionsSinewave Mode 000,000.00 Hz 10.0 dBm Internal AM Mode External AM Input gain 000,000.00 Hz PEP level -10.0 dBm External AM ModeExternal AM Mode Parameters Input GainInt FM 1,000 Hz Pk dev 10,000 Hz 000,000.00 Hz 10.0 dBm Internal FM ModeInternal FM Mode Parameters Peak Frequency DeviationExternal FM Mode Parameters External FM ModeExternal FM Pk dev 10,000 Hz 000,000.00 Hz 10.0 dBm Peak Phase Deviation Internal PM ModeInternal PM Mode Parameters Int PM 1,000 Hz Pk dev 180 deg 000,000.00 Hz 10.0 dBmExternal PM Mode Parameters External PM ModeExternal PM Pk dev 180 deg 000,000.00 Hz 10.0 dBm Sweep Mode Up / Down sweep Sweep timeMark Frequency Internal FSK ModeInternal FSK Mode Parameters Space FrequencyExt FSK Mark 1,000,000.00 Hz Space 2,000,000.00 Hz 10.0 dBm External FSK ModeExternal FSK Mode Parameters Ext FSK InputBurst Mode Trig Ton 10,000 mS 000,000.00 Hz Off 10.0 dBm Burst Mode IntroductionBurst frequency Int SSB 1,000 Hz Upper Sideband 000,000.00 Hz 10.0 dBm Internal SSB ModeInternal SSB Mode Parameters Upper/Lower Sideband selectionsExternal SSB Mode Parameters External SSB ModeExternal SSB Upper Sideband 000,000.00 Hz +10.0 dBm Dtmf Generation Mode Parameters Dtmf Generation ModeDtmf generation # Duration 200 mS Delay Level -10.0 dBm BackgroundDtmf Delay Dtmf DurationDtmf detection on Ext Mod input 3 # a Dtmf Detection ModeDtmf Detection Mode Parameters Dtmf detected digitsPower Level Power & Voltage Measurement ModePower & Voltage Measurement Mode Parameters Voltage LevelRemote Mode Arbitrary ModeOther mode Internal Bpsk Mode Parameters Internal Bpsk ModeInt Bpsk 1,000 Hz 000,000.00 Hz 10.0 dBm External Bpsk Mode Parameters External Bpsk ModeExternal Bpsk 000,000.00 Hz 10.0 dBm Dualtone Generation Mode 10,000 Hz F2 Ton 000 mS Toff 10.0Dualtone Examples Data Modulation Mode Parameters Data Modulation ModeUsing the Data Modulation Mode Baud RateDownloading Modulation Message Data Example MessageTriggering the Transmission Saving the MessageStart End 1,000,000.00 Hz 10.0 dBm Voltage Controlled Oscillator VCO ModeVCO Mode Parameters End FrequencyRemote Operation ConnectingChecking your connection with Hyper Terminal Remote Control Operation Remote Control Programming Rules× Ø Remote Control CommandsReset 4070A to Sine wave mode Returns CE1,0 Enable, Disable LCD echo to terminal K1.0 Enable, Disable front panel keys and rotary knobReport hardware and software versions ? or H Print help menu Linear Trig Up Time 10,000 mSF0-9 Move cursor to field 0 to Return a CRemote Control Examples ExampleQuick Start Guide Arbitrary Waveform ModePin 9-pin cable Pin 25 pin cable adapter Introduction to the Arbitrary Waveform System Description of the Arbitrary Waveform GeneratorFunction Generator Switching ModesFeature Summary Pulse GeneratorPhase Arbitrary Waveform ModeInt Clock / Ext Clock / Lock Master Lock slave mode Continuous/Triggered modeWaveform Function Generator ModeFunction Gen Wave Pos Ramp Rep Freq 100,000 Hz 000 mV Repetition FrequencyPositive Only Pulse Generator ModeDuty Cycle Saving Arbitrary Waveforms Using WAVELOAD.EXEDownloading arbitrary waveforms Cwaveload /COMx /y /baudz filename.extUsing your own program Floating Point Format Data FormatsRules for Floating Point format Time & Value Floating Point Format Example #2Digital Format Integer Format Rules for Hexadecimal format Hexadecimal FormatExample The data value E468 is handled as follows Rules for Binary format Binary FormatExample Arb Multiple Units LockingGenerator Starting Address = Number of waveform points * Phase Offset More on Phase OffsetsPhase Resolution Waveform Size RestrictionsExample Arb Program Program Listing ARB.BASClose System Subroutines Return Print #1, a Send integer value to 4070A Return Return Wiring Diagram DC Operation Option4070A Specifications Operating ModesSoftware CD RemoteHardware Setup Appendix aCLS CLS Print Print Subroutines END SUB Television Remote Control Example Appendix BCLS Make sure a 4070A is attached to the serial port Print Limited Two-Year Warranty Service Information Savi Ranch Pkwy Yorba Linda, CA 92887 USA TEL