USB FM Radio design with C85F2 Microcontroller

USB FM Radio design is intended as a reference for incorporating FM radio functionality into a USB product. The design consists of two major components, the Si47 FM radio receiver and the C85F2 microcontroller with a built-in universal serial bus (USB) peripheral. Due to the high level of system integration of both of these components, the total design is very small with fewer external components than many other solutions.

Overview

The C85 microcontroller controls the Si47 using the serial peripheral interface (SPI). The Si47 audio outputs are sampled using the C85F2’s analog-to-digital converter (ADC) and sent to the host across the USB interface. The Windows application plays the audio using the PC speakers or headphones.

ESD Protection-The design includes electrostatic discharge (ESD) protection on both the antenna and USB connection using Littlefuse’s SP5BAHT and California Micro’s CM2, respectively.

Analog Audio Filter-The Si47 audio outputs are amplified and filtered before the C85F2’s ADC samples them. The dual package op-amp, ON Semiconductor’s MC22, is used to create a single-pole low-pass filter with a corner at 245 Hz and a gain of .

Antenna Input-The antenna signal is conditioned using C, C2, and L as recommended in “AN2: Si47/ Headphone and Antenna Interface.”

Reference Clock Generation-The 2.768 kHz reference clock for the Si47 is generated using a watch crystal. The C85F2 drives the crystal to oscillate and runs this signal through an asynchronous comparator creating the required reference clock.

Firmware

The overall organization of the firmware is straightforward. It begins by initializing all necessary device peripherals and the Si47 FM tuner. Once this is complete, the microcontroller operates in one of two modes, command or audio. In command mode, the device can accept control commands from the USB host for operations such as seeking, tuning, or saving presets. In audio mode, the microcontroller sends ADC samples and a small amount of status information up to the host. The MCU enters audio mode once the host has started polling for audio data, and exits when it receives any command from the host.

USB Profile-This device presents four different interfaces to the host when it enumerates. Three of these are active at any given time. The audio control interface is used by the host to control different parts of the audio functions. There is also a zero-bandwidth streaming interface and a full-bandwidth streaming interface. Only one of these interfaces is used at a time. Finally, there is a Human Interface Device (HID) interface used for all other required device communication, such as controlling the Si47 and upgrading the C85F2 flash image.

ADC Sampling-The -bit ADC on the C85F2 is used to sample both the audio channels. The ADC sample rate is 92 kHz, and it switches between the right and left channel between successive conversions using the onchip ADC multiplexer. The audio sample rate for stereo samples is consequently 96 kHz, and each audio sample is 4 bytes in size. These are sent to the host in signed two’s complement format.

USB Transfer Type-The audio streaming interface uses isochronous USB transfers to send audio data to the host. Since the audio sample rate is 96 kHz and each sample is 4 bytes in size, the device transfers 84 bytes per millisecond across the bus.

Microcontroller Flash Upgrade-The firmware includes a command interpreter that is capable of upgrading the device’s flash image. This code is capable of parsing HID commands to read/write and check integrity of flash pages. However, it is not a true boot loader because it not functional without a valid external code image to handle USB enumeration. This means that if the flash upgrade process fails, the device will be inoperable.

Leave a Reply

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

*