Radio Circuit DiagramsRemote Circuit DiagramsUSB Circuit Diagrams

USB Radio Terminal Schematic Circuit Diagram

The ‘USB radio terminal’ circuit outlined here establishes a connection between an RFM12 radio module and the R8C/13 microcontroller board utilized in the ‘Transistor Curve Tracer’ project detailed in the February 2009 issue [2]. This setup enables wireless data transmission between devices, such as transferring data from a PC terminal emulator program to another microcontroller and vice versa. Naturally, the remote microcontroller must also be equipped with a compatible radio module. As pre-assembled and tested boards are readily available (even the radio module can be sourced from Elektor [3]), constructing the circuit poses no significant challenge. The process primarily involves connecting six pins of K1 on the R8C/13 microcontroller board to corresponding pins on the radio module.

USB Radio Terminal Schematic Circuit Diagram

The power connections are straightforward, with the 5 V and ground pins directly linked to the corresponding pins on the radio module, allowing it to draw power from the microcontroller board. The SPI port on the radio module is controlled by port pins P1.0 to P1.3 on the microcontroller, as shown in the circuit diagram. When the microcontroller module is connected to a PC via USB, it receives power through the USB cable. The author has developed R8C firmware in C, available for download in both source and hex formats from the Elektor website. The C source code can be edited and compiled using Renesas’ ‘High-Performance Embedded Workshop’ IDE [2]. Additional details are accessible on the R8C pages of the Elektor website [4].

The Motorola hex file can be downloaded via the USB port using the Flash Development Toolkit [2][4]. To enter programming mode, jumper JP1 on the microcontroller board must be installed, and the reset button should be briefly pressed. After programming is completed, it’s essential to remove the jumper and press the reset button again. The firmware predominantly comprises BASCOM routines written by Burkhard Kainka [1], adapted and transformed into C. Additional functionalities have been integrated to manage the UART1 interface, connected to the USB interface chip.

On the transmission end, the program waits for characters from the USB port and stores them in an intermediate buffer. Upon receiving the <CR> <LF> sequence, the line of characters is transmitted to the radio module transmitter using a specific protocol. On the receiving end, the program awaits characters from the radio module receiver. Upon receiving the <STX> control code (‘start of text,’ 0x02), the subsequent characters are buffered until the <ETX> control code (‘end of text,’ 0x03) is received.

The transmitted message includes a trailing checksum. Consequently, the complete character sequence becomes <STX> <string> <checksum> <ETX>. If the checksum is accurate, it, along with the <STX> and <ETX> characters, is discarded. Then, <CR> <LF> is appended, and the resulting string is sent over the USB port to the PC. Naturally, strings and commands can also be transmitted via the radio link to other applications.

In certain cases, the protocol might require adjustments. Notably, due to the limited available RAM on the R8C/13 (1 kB), the intermediate buffer is only 200 bytes long. However, this size should suffice for most applications. As currently configured, the software employs a data transfer rate of 9600 baud, employing 8 data bits, 1 stop bit, no parity, and no handshake. The terminal program, such as Hyperterminal, must be configured to match these settings.

Tags

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button
Close
Close