20m2 count pulse is off expected count

captnemo

New Member
Time for some help. I'm counting pulses using an 20m2. Every thing was going fine for a couple of days and then the count was suddenly off by about 300, plus
the count started jumping around about +/-40 counts. I'm using a pulse generator to act as a counting source with a frequency counter monitoring the pulses to
make sure the 20m2 matched the correct count. Originally the frequency counter and the 20m2 oled display matched within +/- one count.
At first I thought the 20m2 was correct and maybe the frequency counter or pulse generator had gone south, but I connected a second frequency counter to the
circuit and it read the same as the original counter. Dead on with no jumping.
So the pulse generator is ok, the two frequency generators are correct, so it must be my program or the 20m2. First, I replaced the 20m2 and got the same result.
At this point is had to be my program. I downloaded an old program that does the same thing without any changes that had I made, the count was still off.
So, I took only the counting portion only of the program (shown below) and loaded it into a blank program. Same results, the debug screen's w10 was also off by about 300 counts. I even changed the input from c.6 to c.7, same results. Any thoughts? There is no "debug" command in the original program, so it can't be that.

picaxe 20m2
setreq m32
cin:
count c.6,8000,w10
debug
goto cin

While I'm at it, the program download is slow at 9600 baud any way to speed it up?
 

captnemo

New Member
It's been counting fine for several days. I have another Geiger counter which uses 20m2 (@32Mhz) and the same counting routine, it's still working fine after 10 years. I'm just building a smaller version using a128 x 64 OLED and without all the bells and whistles I have on the original Geiger counter.
I've tried several different pulse widths no difference until I used 2ms. which cut the frequency count by about half. I even tried putting a pull up resistor
on the count line to no avail. That's where I'm at now.
 

Technical

Technical Support
Staff member
Based on what you have said so far it is most likely to be an electrical wiring issue e.g. poor connection - the PICAXE chip itself won't suddenly change behaviour. In particular check all the grounds are firmly connected together.
 

captnemo

New Member
Found the problem. I removed the screen update routine after each calculation. The problem went away after I placed them back in.
Thanks for your advice.
 
Top