Since introducing support into AnalysIR for the USB IR Toy we haven’t played too much with setting the different infrared carrier frequencies. After reading some mixed experiences on the Dangerous Prototypes forum we decided to put it to the test. So to start off we implemented a feature in AnalysIR to set the carrier frequency and to default to 38kHz at start up. Next we checked the mechanism described on the DP website about configuring the carrier frequency and everything seemed to work out OK.
We settled on the following common frequencies – 30kHz, 33kHz, 36kHz, 38kHz, 40kHz, 56kHz and 455kHz and the ‘Setup transmit modulation‘ commands issued to the USB IR Toy to set these frequencies are as follows:
0x06 + 0x63 + 0x00 – 30kHz (rare)
0x06 + 0x5A + 0x00 – 33kHz (rare)
0x06 + 0x52 + 0x00 – 36kHz (very common)
0x06 + 0x4D + 0x00 – 38kHz (very common)
0x06 + 0x4A + 0x00 – 40kHz (very common)
0x06 + 0x34 + 0x00 – 56kHz (common)
0x06 + 0x06 + 0x00 – 455kHz (rare, Bang & Olufsen)
The command is explained in more detail on the DP website. The first byte is the command for setting the carrier frequency (0x06). The second byte is the value for PR2 and varies for each frequency. The third and final byte sets the duty cycle to 50% (0x00). In some cases the carrier frequency setting does not match up exactly with the target frequency but relatively small variations will not be significant in most situations.
We then set about measuring and verifying the resulting carrier frequency generated by the IR Toy using an IR Led connected to the probes of our Oscilloscope and held right up against the IR emitter of the USB IR Toy.
Results: The results were quite good and more than adequate for use with nearly all Infrared remote control projects. The results for the 455kHz carrier frequency were the least accurate and this is because the PR2 values available for this PIC chip do not coincide exactly with 455kHz so it was a choice between 430kHz and 500kHz. However, we expect it will still provide a workable solution. (Now if anyone wants to donate some Bang & Olufsen equipment….we will test it out)
The first image above shows the results for the most common IR frequency of 38kHz and we have included all of the results for reference below.
All of the signals above were generated by AnalysIR, connected to a USB IR Toy V2 hardware & V22 firmware. The measurements are taken by the internal cursor function of the oscilloscope and have an accuracy of +/-0.5kHz at best, which is more than adequate for our purposes. Note: Using an IR LED directly connected to the oscilloscope probes means that the amplitude of the modulated signal is quite small.