pointless snippet . how is adc setup ?Ok, here is the part of code which reads the keys:
good luck trying to use adc value without passing it through a lpf
a pic of blank pcb is not a schematic
pointless snippet . how is adc setup ?Ok, here is the part of code which reads the keys:
good luck trying to use adc value without passing it through a lpf
a pic of blank pcb is not a schematic
Warning I'm not a teacher
DEFINE ADC_BITS 8 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in microseconds
Here is ADC setup. All PBP defaults.
Unfortunately, I don't create schematics - I directly draw PCB, since I can read it in same way, as schematics![]()
that just explains so muchUnfortunately, I don't create schematics - I directly draw PCB, since I can read it in same way, as schematics
good luck with your endeavors i'm out
Warning I'm not a teacher
Well, added 0.1uf capacitor at ADC input, so far, works fine.
This just shows that you have strong interference in the analog inputs because of EMI noise. Where it is coming from?
Well, you can read the PCB as schematics, so as Richard said, good luck here!
If you make a lot of ADC readings, say 20, and then sort them in order, through away the 5 first and last numbers, with the rest 10 make a mean number, then you may get rid off the 100nF capacitor and be more confident of the readings. This makes for a low pass filter in software.
Personally, NEVER use raw adc readings. This is just looking for troubles. A spike can ruin your day. Make many readings and get the best of them to be sure of noise free readings.
Ioannis
As mentioned above, that noise comes from PWM, PWM is used to adjust brightness of the nixie tubes
The HPWM output from the chip is used to modulate bases of all MPSA42 transistors, emitters of which, individually, go into ports of MCU, and collectors are tied to nixie tube cathodes.
That PCB is quite large - about 88x44mm, now I've designed even more compact one, just 70x30mm. Good I haven't put it into production yet - will add capacitor place to PCB.
Actually, reading schematics via PCB is not that hard - just you need to learn it, as you do with normal schematics.
I would try first the software filtering as I described to you.
Last resort to capacitors. If something changes, then you would remove old caps and put new, larger or smaller???
Ioannis
well if you look at my code, you can see that I here have an special delay loop, which counts how long same value from ADC is being read, but as it turns out, that was not enough.
Oh, and as a note, before soldering capacitor, I tried to add ferrite beads onto wires going to buttons - that helped a bit, previously, if issues were at PWM value of 170, after ferrite beads, only values below 80 were causing issues.
So as I can estimate, the issues from wires acting as antennas. This means, for next revisions, I should add spread spectrum modulation, to reduce EMI sent into air, and maybe, even use shielding.
Bookmarks