This project is a deep dive into the heart of radio frequency (RF) design: the Phase-Locked Loop (PLL) Frequency Synthesizer. Think of it as the tuner in your radio; it's the circuit that generates stable, precise signals to select different stations. I built and compared two different versions: one using classic, hardwired 74-series TTL logic chips and another using a flexible, programmable PIC microcontroller.
Why did I decide to make it?This was part of the laboratory projects of an university course: Electronic Circuits III. The lab guide asked for a basic circuit, but I saw an opportunity to truly understand the concepts by pushing myself further. I wanted to answer the question: "How does moving from fixed hardware to programmable software change the game in electronic design?" I wanted to conquer topics that intimidated me at the time—PCB design, microcontroller programming, and RF principles—and solidify them into practical skills.
Step 1: Understanding the Core - The Phase-Locked Loop (PLL)
Every synthesizer needs a brain. A PLL is a control system that compares the phase of an input signal (a stable reference) with a signal derived from its own output. It then adjusts the output to match the reference in frequency and phase. It's magic feedback control!
The Key Components:
- Phase Detector: The "comparator."
- Low-Pass Filter: The "decision-maker, " it smooths out the commands.
- Voltage-Controlled Oscillator (VCO): The "muscle, " it generates the output frequency based on a control voltage.
- Frequency Divider (/N): By dividing the VCO's output by `N`, the PLL locks onto a frequency that is `N` times higher than the reference. This is how we synthesize new frequencies!
Step 2: Design #1 - The Classic TTL Approach
My first design used a classic CMOS PLL chip (the CD4046 or NE565) and a 7493 binary counter as the frequency divider. The 7493 can only divide by fixed factors (like 2, 4, 8, etc.). This approach is rock-solid, simple, and teaches you the fundamentals of how the feedback loop works.
The Challenge: To change the multiplication factor, you have to physically rewire the circuit. It's powerful but inflexible.
Step 3: Design #2 - The Programmable Microcontroller Approach
This is where I went beyond the lab guide. I replaced the fixed TTL counter with a PIC16F628A microcontroller. Now, the division ratio `N` wasn't set by wires but by code I wrote in C. This transformed a rigid circuit into a flexible, intelligent system.
The Firmware: The PIC's code continuously checks its input pins. After counting `N` pulses from the VCO, it toggles its output. This simulated a programmable divider, allowing me to change the synthesized frequency on the fly, a concept crucial for modern devices like your smartphone.
// Snippet of the code that makes the PIC a programmable divider
void main() {
// ... setup ...
while(1) {
while (input_pin == 1) {} // Wait for a pulse
counter++;
if(counter >= target_value) { // 'target_value' is set by DIP switches!
counter = 0;
output_pin = !output_pin; // Toggle the output
}
while (input_pin == 0) {} // Wait for the pulse to end
}
}
Step 4: Bringing It to Life - Custom PCB Design
A circuit this complex couldn't live on a messy breadboard, especially with RF signals involved. I designed a custom printed circuit board (PCB) for the microcontroller version using EasyEDA. This was a huge learning experience—component placement, routing traces, and designing for manufacturability.
Step 5: Simulation vs. Reality
Before soldering a single component, I simulated everything. Simulation is a powerful tool to verify your math and avoid costly mistakes. Seeing the simulated waveforms almost perfectly match the real ones on my oscilloscope was an incredibly rewarding moment that confirmed my understanding.
Caption: The real-world output! The PLL is locked and synthesizing a clean new frequency.
How does it work? The Final ResultWhen you power it on, the PLL goes through a "lock" process. The phase detector compares the reference frequency (from a simple 555 timer circuit) to the divided-down signal from the VCO. It sends corrections through the filter to the VCO, constantly adjusting it until both signals match perfectly. Once locked, the VCO's output is a clean, stable frequency that is exactly `N` times the input. The TTL version does this with hardware logic, while the PIC version does it by executing the instructions I gave it.
Video placeholder
This project was my journey from following instructions to truly understanding and innovating. It took theory and made it tangible.
Comments