18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Chapter 12<br />

Basic tests<br />

When you have the circuits built and tested, if you have an oscilloscope or frequency counter,<br />

you can measure the frequency at pin 3 of U3 or pin 3 of U2A. If you’re using U3, adjust<br />

R8 as needed for a 40-kHz output. You can also measure at pin 12 of U1 to verify that its<br />

oscillator is about 1 kilohertz.<br />

To send a test transmission, set A1-A5 identically at U1 and U4, and set D6-D9 to the values<br />

you want to transmit. <strong>The</strong> schematics show the components set up to transmit the value 1000<br />

to address 00001.<br />

Aim IRED1 so that it points to MOD1’s photodiode window. To begin, place the transmitter<br />

and receiver a few feet apart. To transmit, press S1 momentarily to pulse pin 14 of U1 low.<br />

At U4, LED5 should flash to indicate that a valid transmission was received. At D6-D9, LED4<br />

should be on and LEDs 1-3 should be off, to show that the value 1000 was received.<br />

To change the data to be transmitted, move one or more jumpers or switches at U1’s D6-D9.<br />

Press S1, and LEDs 1-4 should change to match. With these circuits, I was able to receive<br />

data from 12 feet away, with only casual aligning of the transmitter and receiver.<br />

If you weren’t able to measure and adjust U3’s frequency, you can do so now. Jumper pin<br />

12 of U1 to ground to cause the transmitter to continuously transmit. With IRED1 aimed at<br />

MOD1, slowly adjust potentiometer R8 until LED5 lights, continue to adjust until LED5<br />

turns off, and then return R8 to about the middle of the range where LED5 is on. You can<br />

then keep the potentiometer, or replace it with a single resistor that matches the value you<br />

found experimentally.<br />

To add a second receiver, build another circuit identical to Figure 12-2’s, but with the address<br />

inputs set differently. In this way, you can transmit to a selected receiver by changing A1-A5<br />

at the transmitter. Even if a receiver detects a transmission meant for another receiver, it will<br />

ignore it, since the address doesn’t match.<br />

Computer-controlled Transmitter<br />

Figure 12-6 is a transmitter that is similar to 12-1, but with the manual controls replaced by<br />

outputs of an 82(C)55 PPI (from Chapter 6). Port A and bits 4-7 of Port C are configured as<br />

outputs.<br />

<strong>The</strong> two halves, or 4-bit nibbles, of the 8255’s Port A control the transmitted data and address.<br />

<strong>The</strong> high nibble controls data inputs D6-D9, and the low nibble controls address inputs A1-A4.<br />

<strong>The</strong> fifth address input, A5, is tied high, so you can control both the data and address with<br />

one 8-bit port. This reduces the number of decoders you can transmit to from 32 to 16, but<br />

this shouldn’t be a problem in most applications.<br />

208 <strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong>

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

Saved successfully!

Ooh no, something went wrong!