USB on PIC uPs

For stand-alone microprocessors

Re: USB on PIC uPs

Postby Doug Coulter » Tue Jun 28, 2011 6:23 pm

A bit more progress -- along with an object lesson on why I'm doing this. Here's a screen of output from the standard counter, counting a standard U source we have here:
Screenshot-9.png
Screenshot after reset


This is the output format I have so far -- speak up if you don't like this. Every column is separated by a comma and a space, and at present, the numbers are howevermany characters they are -- I didn't add zero left-padding to them (yet). First column is time, CPM1 is counts/minute based on one second, CPM10 is counts/minute based on the previous ten seconds of counting (no history before that). One object lesson is that even with a pretty quick count rate, it bounces around. Radioactive decay is the most random process known to man, and statistics bite for small counts.
You'll note that after the ten second buffer is "full" that even the ten second average bounces around a good bit. Those are the breaks of this game, and its worse when there's less counting, as in activations and trying to track a quick decay, like with silver. I'll be providing some plotting for this that can make interpreting the data a lot easier, and of course, any computer program that can eat serial data can do whatever you want with it.

But that's not the real object lesson here.....This same source counts ~10,500 cpm on the otherwise more sensitive (I thought) bigger pancake downstairs. While this background is in the 20-30 range, the one downstairs is in the 120-170 range (right now we're getting the afternoon cosmic increase). That seems natural enough, it's bigger (and newer and a different gas type fill).
Yet this counter counts 50% more! That's a crazy difference! The source is 3/8" diameter and laying on the counter in either case, and it's U oxide inside a washer covered by microscope cover slips -- alphas probably don't make it through well, but betas certainly do. It appears this newer Russian pancake sees either betas or gammas much better than the older (to me, newer in years of existence) halogen quenched tube does -- even though it counts less background. I'll do some more tests (and get them co-located to do them) but I kind of doubt this will go away. The larger tube does have a protective screen that might stop some betas (but not gammas) -- there are endless variables even when the technology involved is very very similar (the downstairs counter is also on a PIC, same HV supply design, and so on). The only difference is the manufacturer of the detector, and its size. I happen to know the gas fill is halogen quench in the downstairs one, and alcohol in these we have a lot of for standards - and that's about the total difference.

FWIW, this same source counts in the million/second range on the huge NaI/phototube setup that only sees the gammas. Thus, again, comparaing across labs is difficult, and when you see say JonR reporting 15k cpm off his silver on such a sensitive detector -- you now know how large a grain of salt to take with that -- it could in fact amount to less activation than 1500 counts/minute on one of these!

This points up how hard it can be to compare activations across labs -- without something like this where we all know we have the very same identical sensor, area, everything as "the same" as it is possible to make it. A real object lesson, eh?

Edited to add:

In some 10 min background counts (this is why the total count number is in there), I got backgrounds of 22.6,55.9 and 22.7 this evening. Obviously that middle one caught a real hot burst of cosmics. This is the sort of thing you have to work with in low-count data. The information this is putting out is what's needed to fish though data and recognize (and maybe reject) such events in a PC where the "heavy lifting" is a lot easier to do. You find that there's this (rather low) minimum in the distribution (on just about any timescale) and some adder due to what outer space happens to be doing. Not a gaussian distribution so much. Hitting zero is far more rare than catching a big burst somewhere. Things with better time resolution are "worse" in this regard, actually as they can resolve the different speed particles in a cosmic shower as they get here and count them all in a burst. So, while I could make the 10 sec count "better" in some way (running bessell filter), it wouldn't handle that too well - at least the 10 second bucket drops that off after ten seconds, completely. A low pass filter that gave a smoother number would be perturbed for a lot longer. At any rate, since signal processing is best done in the PC, the only thing of concern here is to give it the right information to work with.
Last edited by Doug Coulter on Tue Jun 28, 2011 8:40 pm, edited 2 times in total.
Reason: add long term background counts
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: USB on PIC uPs

Postby Joe Jarski » Tue Jun 28, 2011 8:52 pm

Doug, the output looks good to me. If someone needs something different, then it's easy enough to do a "replace text" in an editor.

Do you think that the bottom of your small GM tube is lined with a high-Z material as a reflector to increase sensitivity?

Gotta go - more later...
User avatar
Joe Jarski
 
Posts: 231
Joined: Thu Sep 16, 2010 8:37 pm
Location: SouthEast Michigan

Re: USB on PIC uPs

Postby Doug Coulter » Tue Jun 28, 2011 9:40 pm

On the output, I'm attempting a balance between what a human can get off a dumb terminal, and what might be done with the data later. It's all there or can be trivially recovered from that.
Perl would "split" this into columns in an array per line by default, and if you use the fields that are numbers, it will just convert them and ditch the comma -- spooky, but it works.

If I had to assign a P to the Russians, it wouldn't be "Purist" but it might be "Pragmatic". (On the other hand, they get up to some Profound stuff too) I wouldn't put it past them to put a good photoelectron emitter in there to make is more sensitive to gammas -- these tube are usually pretty numb to them.

That's kinda the reason to be doing this. Every sensor under the sun has some different cal curve for each of alpha, beta, gamma. If we're trying to compare stuff (a level of difficulty below having true absolute numbers) we all need the same basic sensor that has the same ratios (and they vary by energy of each thing too!). That's where Bill came in -- got a batch of these all the same for us so we can do all this without excruciating pain trying to cross calibrate. And if one guy gets the absolute numbers in some convincing way -- then we all have them too.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: USB on PIC uPs

Postby Joe Jarski » Wed Jun 29, 2011 12:44 am

I went back to the datasheet out of curiosity and translated another part of it that I hadn't previously. This may be the answer....

"SI1ZB counter with adjustable sensitivity switching is designed to measure beta radiation."

So apparently it's intended to be more sensitive to betas?? And I suppose the third electrode ("operating electrode") is used for a sensitivity adjustment? Maybe I should translate the rest of the datasheet... :oops:
User avatar
Joe Jarski
 
Posts: 231
Joined: Thu Sep 16, 2010 8:37 pm
Location: SouthEast Michigan

Re: USB on PIC uPs

Postby Doug Coulter » Wed Jun 29, 2011 8:04 am

Really. I've just left the odd pin N/C and it hasn't seemed to have drift due to that, but it'd be nice to know what they think they were up to with it.

Edit:
On further checking, it's betas it's responding to better. Tested this by comparing with a beta-free source, (all gamma) and the numbers are closer. Still haven't tried anything with the extra pin, as I don't have a clue what I should be trying. So yeah, if that data sheet gives any clues to what to do there, it'd be interesting to know about.

As a side note, an interesting thing about these newer pics that have multistage clock startup. If you set rs-232 fast (I just changed it to 57.6kbaud) you can start putting out characters before the clock is stable enough for the other end to get them correctly. I might have to add a startup delay. Or force wait till the USB has been enumerated (which takes awhile). I'm loath to do that just yet as the way it is, you could use the serial output and power it from USB or your own special cable (it's what I'm doing for debug, to avoid the "where's my port" issue). That won't matter if we don't put the rs232 converter chip in the final design...to save a few bucks.
Last edited by Doug Coulter on Wed Jun 29, 2011 12:24 pm, edited 1 time in total.
Reason: New information
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: USB on PIC uPs - schematics

Postby Doug Coulter » Thu Jun 30, 2011 1:58 pm

Are being put here for this project.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: USB on PIC uPs

Postby Joe Jarski » Thu Jun 30, 2011 7:21 pm

Here is some more of the translation, from a different translator. A lot of it was the standard "don't poke your finger through the window". I think this is what you're looking for though...

Operating voltage range -- 350-550V
Operating electrode (grid) voltage range -- 150-400V
Sensitivity change from nominal over the operating electrode voltage range -- not less than +/- 7.0%
User avatar
Joe Jarski
 
Posts: 231
Joined: Thu Sep 16, 2010 8:37 pm
Location: SouthEast Michigan

Re: USB on PIC uPs

Postby Doug Coulter » Thu Jun 30, 2011 7:41 pm

Hmm, so it's more of a "gain calibration" electrode. Interesting -- the thing works fine with it left floating, but I will try putting a variable supply on there and see what changes.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: USB on PIC uPs - code

Postby Doug Coulter » Thu Jul 14, 2011 8:00 pm

Here's how the code is coming along. Joe Jarski can read this for sure, since he got the CCS compiler. I've torn up their USB code quite a lot, but I'm not supposed to share it anyway....so don't look ;) I've added the code to also count another counter input (Timer-3), and toggle whether it displays or not, but haven't yet got the comparator and so on setup to it can "eat" the output of our preamp -- that's coming, but if I can untangle all the possible uses for one of the pic pins, we get another input, analog, with a reference, comparator, hysteresis, for use with neutron detectors in the same package with this, with co-current counting and display between the internal geiger tube and some external thing with a preamp. I'll add some code for the PC to be able to set up the reference voltage, and if I get ambitious enough, store the default in the pic's eeprom between power cycles, so you won't have to set it all the time. If I can't get that pin untangled, you'd have to have your own external thing to make TTL input pulses for the second counter input.
Attachments
USB.zip
Source code for std counter
(253.77 KiB) Downloaded 404 times
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: USB on PIC uPs

Postby Doug Coulter » Sat Jul 16, 2011 6:14 pm

Well, I couldn't quite get the comparators turned on without wrecking the counter 0 input for counting. Seems the details of pin multiplexing on the pin there won't allow me to turn off the comparator output that goes to counter 0's input pin, but still use that pin as counter zero's input. It's possible perhaps with a rewiring there so that the geiger tube goes through comparator 1 anyway, but that's more work and more wiring (with no proof it works until I do), so...

I'll see what I can do to get some kind of comparator going without the built in ones (which from experience, aren't that great anyway) The Vref does work as advertised. I'll see what I can dream up that doesn't use too many more parts, else the 2nd counter input (the idea would be to put your neutron counter there and get it all in time-sync) will have to accept straight CMOS level inputs, which isn't what our preamp puts out, quite.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Previous

Return to Embedded software

Who is online

Users browsing this forum: No registered users and 1 guest