RS-232 to 100 MHz RF desktop channel adapter using ATtiny2313 microcontroller


AVR Studio assembler source code 2jun2002version.asm
AVR Studio hex file 232lin.hex

This is an adapter that allows a terminal to communicate via a 100 MHz data channel with peripherals on the same desk top. Keystrokes from the terminal are are received through the RS-232 connection and sent through the 100 MHz RF data channel. See the page, Digital Wireless for the Desktop, on this site, for the basics of the transmitter, receiver, and data format. The reason I made this was to make a simple method of switching between instruments on my desktop. I was staring to accumulate a number of microcontroller-based devices that I want to be able to switch my computer among quickly and this provided the simplest desktop networking solution I could think of.

Any data received over the 100 MHz RF data channel addressed to the terminal is decoded and sent to the terminal. The transmit and receive address of the terminal is set by the user and stored in EEPROM. The address field has a range of 0..7, and the transmit and receive address can be changed by entering an escape sequence. The sequence{<ESC>,T,3}, for example, sets the transmit address to 3. This flexibility allows the terminal to “connect” on any of multiple devices on the desktop by merely entering the appropriate escape sequence. It is planned that most devices will be test instruments and will speak only when spoken to (that is, in response to a request), and that they will all send data to the terminal. This simplifies things a lot because only the transmit address will have to be changed.

A frequency meter, based on the AT90S2313 frequency meter and pulse generator described
elsewhere on this website was chosen as the first desktop instrument to control over this link.
Here is a description of the Frequency Meter with RF Data Channel.

All transmission and reception occurs at 100 MHz, which means that communications are simplex only. RS-232 is 9600 baud. No need to go faster since the RF data rate is quite a bit slower. Note that at boot time the microcontroller fetches the send and receive addresses from EEPROM, so the first time it is run, the addresses will be garbage until they are set from the keyboard, unless you write the EEPROM while programming the chip. This part is left as an exercise for the student.
The code described here is written for an Atmel AT90S2313. I decided to use the ‘2313 because it has a hardware UART and RAM for a nice deep stack, so I didn’t have to worry about stack usage. The hardware UART made it possible for the microcomputer to both poll the UART and check for incoming data over the RF link frequently enough to avoid loosing data. The RF data channel format is bit-banged and occupies much of the CPU’s time.
Here is the RS-232 to RF adapter assembly code . For convenience, here is the Intel hex file.

Schematic diagram of the RS-232 to 100 MHz desktop data channel adapter.
Schematic diagram of the RS-232 to 100 MHz desktop data channel adapter.
Click on image to see full size schematic (8k GIF).

The transmitter and receiver are those described in the Digital Wireless for the Desktop pages on this site. In this particular instance, I didn’t have any 22uf capacitors, so the input bias and decoupling capacitor is 100 uf. This is unfortunate because it will slow down receiver recovery from overload. Since the transmitter operates at 100 MHz, the signals are in the middle of the FM broadcast band, and even though the signals are of short duration, you need to be careful about causing interference to this service.
The RS-232 Interco was borrowed from Atmel’s AVR910 application note.
The power supply is a rechargeable NiMh 8.4 volt transistor radio battery. The battery is connected to a 7805 voltage regulator when negative voltage from the RS-232 input is detected, thus there is on on/off switch as the adapter turns it self on whenever it is connected to a working terminal, and turns itself off whenever the terminal is off or disconnected. This makes the period between battery charging longer. This also makes for a very easy to connect peripheral -just connect the RS-232 connector and start using it.
Circuit Assembly and Construction.(Also read the relevant sections of Digital Wireless for the Desktop pages on this site.)
All the circuitry was built on prepunched phenolic with pre-etched donuts around each hole, and the components connected point-to-point. Placement of components was carefully selected so as to minimize the use of jumper wires – for the most part, connections are made by bending the component leads over to the leads of the components they need to connect to, and soldered in place. This method of wiring results in a compact assembly with a minimum of parasitic to make the circuit less predictable. If you can make this on a ground plane printed circuit board, it might even have better performance, but make sure to clear the ground plane away from under the inductors. The loading effect, particularly on the transmitter’s coil, will reduce the range.
The ICs are socketed. A six pin ISP connector was added because you just never know when you might want to improve the firmware. Besides, this particular AT90S2313 had had a hard life (this is its third project) and one of its pins is about to fall off, so it won’t be going in an out the socket anymore.
The coils for the transmitter and receiver were wound on a 3 mm diameter bamboo satay stick using 24 gauge vinyl insulate solid copper wire. The insulation was stripped and the coils slipped off the stick and installed in the circuit.

Housed in a pencil box
Housed in a pencil box, this project approaches my ideal of no I/O connections.

There are two adjustments on this board. The coils for the transmitter and receiver need to be stretched or otherwise deformed to tune it to 100 MHz. Using an FM broadcast receiver turned to 100 MHz, adjust the transmitter first. The receiver can then be adjusted using a transmitter as a signal source. Adjustment of the coils is quite critical, so use a pair of small (or pointy) dieletric instruments (in this case, I used two bamboo sticks, one with a sharp point, and the other carved to resemble a screwdriver blade. Find out where the transmitter is transmitting by tuning around the FM band. Once you find it, you can increase the transmitter’s frequency by stretch in the coil, and lower the frequency by compressing the coil. Patiently stretch and squeeze the coil until it is tuned to 100 MHz.
For more detail: RS-232 to 100 MHz RF desktop channel adapter using ATtiny2313 microcontroller

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top