VK5TM

Home Rants Contact

News, Updates and Other Minutiae

September 2023 Long time between drinks, but not much happening on the tech front at the moment. Added another couple of rants to the rant page.

January 2023 Updated the AD9833 VFO code to use a 12F1840.

December 2022 Added rant about todays useless (internet) search engines.

November 2022 NEW Project An AD9833 Based Simple VFO. FT101ZD VFO project updated.

October 2022 A replacement internal DDS VFO for FT101Z/ZD rigs. Because the worlds postage system has gone totally bonkers and it is not possible to send a small pcb anywhere except at extreme cost, I am slowly making available the option to purchase pcb's from Pcbway. First up is the Simple DDS VFO 2017 project pcb. Others will be added over time. Noise Canceller kits available again- see Noise Canceller page.

Privacy Policy uploaded. GPDR and all that stuff In accordance with various bits of legislation around the world, either currently in force, about to come into force or proposed, you will now find that annoying "We use cookies" notice at the top of this website. The full Privacy Policy is available at the Privacy Policy link in the footer at the bottom of the page. (If you don't know what GPDR is, Google it. Real scary shit for ANYBODY with a web presence.)

Encoder Headaches

Or - a trap most have fallen into?

While working on another custom modification of the DDS Module, I spent about a week banging my head against the wall, cussing, using other nasty words and throwing things around the workshop. Why? Because the !#%$* encoder wouldn't work properly when the DDS code was modified and migrated to an 8 pin PIC. Nothing to do with the encoder changed in the code transplant other than the pins it was connected to. Even looking at an oscilloscope wasn't helping (it showed the problem, but wasn't helping). Instead of getting this:

encoder quadrateur phase

I was getting this:

faulty encoder quadrateur phase

What on earth was going on? It was a brand new (if cheap) mechanical encoder. Tried changing pullup resistors and the value of the filtering caps but nothing made any difference. Even went so far as to try Schmitt inverters and 'D' Flip Flops to try and cure the problem. Here is the snippet of the schematic as it relates to the encoder and I can tell you, the problem is right there, staring you in the face.

encoder circuit

Have you worked it out yet? Come on, it's simple when you know - keep trying. And no cheating by scrolling down. Annoying aren't I! Oh, all right, here's another clue - how are the caps supposed to discharge? Via the encoder when it's contacts connect to gnd I hear you say? Maybe so, but it's already too late by then. Besides, what are the caps supposed to do? Eliminate contact bounce, right? All right, stop yelling, here's the answer: Question, how can the caps eliminate contact bounce when they (the caps) are already fully charged and the software is configured as 'active low'? With 100n caps, the bounce time of the contacts is too fast to properly discharge the caps and the input pins of the PIC are high enough in resistance that they aren't going to help either, so nowhere for the spikes of contact bounce to go. Solution:

modified encoder circuit

This way, the caps are held discharged so that when the encoder contacts connect to ground, they are more easily able to absorb the small voltage fluctuations. With the values shown, I now get nice clean quadrature signals (don't be tempted to increase the value significantly, the trailing edge will develop a nasty curved appearance that will cause problems). Get out your scopes and cheapy mechanical encoders and try it. I know it solved my problem. (I had a couple of narky emails saying what a load of bull, but you can bet they didn't actually try it. Also, a couple of experimenters have reduced the caps to 1n and commented that it worked out better for them.)

Obligatory Legal Stuff Copyright © 2011 - 2024 T Mowles VK5TM. (All rights reserved) Privacy Policy Unless otherwise noted, all content on this website belongs to the site-owner. No person, corporation or other legal entity is permitted to make use of this content in any fashion or for any use other than personal use, without the express written permission of the site-owner except for fair use provisions as allowed by appropriate copyright law. See website Terms & Conditions. Content contained in offsite links and all trademarks belong to their respective owners. Valid CSS!