Announcement

Collapse
No announcement yet.

Which microprocessor for detector project?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Which microprocessor for detector project?

    I plan to begin a metal detector project and I want to get set up to program micro processors. I prefer software to hardware so I want to do as much as possible in software and use a minimal hardware design. I also prefer to concentrate on the metal detecting aspects rather than debugging the microprocessor circuitry, so I want to use a microprocessor demo or evaluation board that has enough prototyping space for me to add a few op amps and driver transistors.

    I don't want to spend my time building a programmer, I would prefer to buy one, but I only want to buy it once. So I would like to settle on a microprocessor family that has enough range to meet my needs even if I underestimate those needs the first time around.

    The VLF circuit I envision is a microprocessor with built in A/D, a few components to drive the transmit winding, a preamp, and the output of the preamp goes directly into the A/D. Demodulation and filtering would be done in the microprocessor. I would use a serial port to send data to a computer for display and to collect results.

    The transmit frequency would be about 7 kHz and I would like an A/D sample rate in that neighborhood. Actually I would like to sample at 28 kHz, but I can get by with something in the range of 5 to 10 kHz.

    Some of the filtering I would do is just noise filtering that can be done with a median filter which does not need multiplies. But I would also need to filter to get rid of ground signals which would require multiplies. I need to be able to do at least 1000 8x16 multiplies per sec, and I would prefer the ability to do 10,000.

    I am attracted to the PIC family because of the amount of support that is available for it, but I have never used it and I am a bit worried about its arithmetic capabilities. Perhaps someone who is using it could comment on its ability to do 16 bit arithmetic. For example how many instruction cycles to do a 16 bit f to f add. And how many cycles to do a 10 bit A/D sample.

    It has been almost 20 years since I worked with any single chip micro processors so I am not familiar with any current families. In fact, if I use a pre-built demo board it would not even have to be single chip, but I figure that the fewer traces there are on the board, the fewer things there are for me to screw up.

    I am looking for suggestions about which family to settle on. I want an E-Prom demo board, assembler, and programmer. I think I will skip the expense of an in-circuit emulator, but it would be nice if there is some existing debugging code. Just being able to dump a snapshot of RAM to a PC would help.

    Robert Hoolko

  • #2
    Re: Which microprocessor for detector project?

    7kHz... sounds like a Garrett! Don't know what Garrett uses but the XLT has a Motorola 68HC705 and the CZ7 has a PIC 16C74A. Personally, I'd chose a PIC, tons of support for them. The 16C74A has a built-in ADC, and I think another PIC has an added DAC. The DAC is nice for controlling external TX/RX blocks.

    Don't know about PIC math capacity, their web site has loads of info and there are plenty good PIC books available. Also, you're usually better off sampling at the highest possible rate, then you can use the additional sampled bandwidth for filtering.

    Been thinking about the same sort of project myself, but I'm knee-deep in PI right now.

    Comment


    • #3
      Re: Which microprocessor for detector project?

      The 7 kHz is because I have some White's coils I can use, and they are tuned to 6.6 kHz. The XLT processor would not be fast enough. The XLT does analog demodulation and filtering and only samples the results at 100 Hz. I want to do all the filtering in the processor which is why I am worried about the processor throughput. But it is probably not as bad as I made it sound because I can probably make a lot of the filter coefficients a power of 2 and just do a shift instead of a multiply.

      Robert Hoolko

      Comment


      • #4
        Median Filter

        Hi Robert,

        I was interested to see that you are going to use a median filter for noise. I was considering one for a PI in place of the normal sample averaging integrator. The advantages seem to be that noise spikes can be eliminated without a loss in response speed. Do any other IB detectors use this technique?

        Eric.

        Comment


        • #5
          Re: Median Filter

          Eric

          I don't know if a median filter is used in any detectors. It is very effective on spikes, but it has to be used before the spike passes through any other filters that could spread the spike out too much. If the detector uses an analog filter before the signal is sampled then it is too late to use a median filter.

          It does cause a delay equal to the width of the widest spikes you want to be able to suppress. In the simplest case the window size is 3, it will eliminate spikes that are 1 sample wide, and the delay is one sample time.

          While a normal low pass filter spreads the spike over time, or an integrator averages it, the median filter just throws it away. This is really nice if a lot of your noise is in the form of spikes.

          Robert Hoolko

          Comment


          • #6
            Re: Median Filter

            Robert,

            Many thanks. Spike noise is particularly prevalent in an industrial environment where there is electrical machinery. Much of my work is with conveyor mounted detectors checking for metal contamination in a product.

            Eric.

            Comment


            • #7
              Re: Which microprocessor for detector project?

              To get a feel for the PIC capabilities I downloaded the development platform and wrote a three point median filter. It was a very painful experience.

              It took 41 instructions to do an 8 bit 3 point median filter using indirect addressing. It only would have taken about half as many instructions if I had not used indirect addressing, but then the calling sequence would have been about 8 instructions longer every time it was called. That would be better if were only called from one place.

              I was worried that 16 bit arithmetic would be too slow. It appears that (excluding multiply) 16 bit only takes about 3 times as long as 8 bit. That is not much worse than what I am used to. But the killer seems to be indirect addressing which can take as much as 4 times as long as direct.

              So I am still unsure if the PIC family has enough horsepower to do the kind of metal detector processing I want, but unless someone starts shouting, "NO! you're going the wrong way", that is probably the way I will go.

              Robert Hoolko

              Comment


              • #8
                Re: Which microprocessor for detector project?

                Hi Robert

                Try the Ubicom (formerly Scenix) SX18 or SX28, its a PIC alternative, it runs at 50MHz and do a single instruction in 20 nS instead of 1 uS for a 16F84. 50 TIMES FASTER!!!!

                It has 136 RAM cells compared to I think 35 in a 16F84, and the build in counter runs as fast as 50 MHz.

                Its nearly code compatible with Microchip and price is fair, other members of the family runs at 75 or even 100 MHz!

                Important note:
                The SX18 or 28 do not have the 64 byte EEPROM that you can save data in like the 16F84, for this you need a external seriel EEPROM like 93C46 or 24V01 or equiliant.

                You can find the SX28 hier:
                http://www.ubicom.com/hardware/sx28ac.html

                Mark

                Comment


                • #9
                  You are assuming a 4Mhz clock for the 16F84 N/T

                  You are assuming a 4Mhz clock for the 16F84.

                  Comment


                  • #10
                    Re: Which microprocessor for detector project?

                    Mark

                    Thanks for the information about the SX chips. They are fast, but they do not have an A/D. I would have to do much extra work to add A/D to it.

                    Robert Hoolko

                    Comment


                    • #11
                      Re: You are assuming a 4Mhz clock for the 16F84 N/T

                      Hi Charles

                      Right!
                      The 16F84 divide its clock by 4 internal.

                      Mark

                      Comment


                      • #12
                        Re: You are assuming a 4Mhz clock for the 16F84 N/T

                        Yes but they are available in faster clock versions which means the SX wouldn't be 50 times faster

                        Comment


                        • #13
                          Re: You are assuming a 4Mhz clock for the 16F84 N/T

                          Hi Charles

                          Right I have read about a 10 MHz version of the 16F84. 10MHz / 4 = 2.5MHz internal ok we are down to 20 times faster.... Still pretty good.

                          Mark

                          Comment


                          • #14
                            Re: Which microprocessor for detector project?

                            Well, some other options may be:

                            1. Atmel chips. Like say ATmega163 (Don't be afraid the word mega in name, it's only 40 pin DIP 8 10-bit ADC channels, hardware multiplier, 8 mhz clock, 16 kb flash and so forth.
                            www.atmel.com

                            2. Analog Devices microprocessors. ADuC8xx, 12 or 16-bit(!) ADC, 8051 processor core,
                            16 mhz and so on.
                            www.analog.com

                            But they both may be too slow for heavy number crunching. Or may not, richer set of instructions makes calculations more efficient.

                            For a similar MD entry level testbed (which unfortunately exists still only in my mind) I was thinking to use Scenix (high speed leaves some reserve in programming) combined with some fine ADC from Analog Devices (way better quality than on-chip ADCs and unmatchable overall flexibility). And, after all, two chips are not too much more than one chip anyway.
                            (Ok, I'm biased - Scenix distributor resides in 5 min walking from my workplace

                            For hi end MD testbed, no doubts, real DSP processor is needed. Then choice strongly depends from, how much money and learning one wants to invest.

                            Comment


                            • #15
                              Re: Which microprocessor for detector project?

                              When I started looking at this I was concerned whether the PIC chips had enough processing power to do this job. At the moment I am most concerned about the ability of the built in A/D to read a 6600 Hz signal.

                              The ADuC812 has an A/D that is definitely fast enough, but it does not have any PWM. So I would need more interrupts to create the audio for the headphones. I was also having problems with the Analog Devices web site and I could not find out the cost of the evaluation board.

                              The ATmega163 sounds interesting but does it really exist? The data sheet I found is marked Advance Information and is not complete. It claims to have 3 or 4 PWM's depending on where you look. But that part of the data sheet is missing and the register summary does not have any registers dedicated to PWM's. I would like to use 2 PWM's, one to create the audio signal for the headphones, and one for the transmit signal. That would save a lot of interrupts. If it really has at least 2 independent PWM's that would be a plus.

                              Some of the PIC chips claim to have 2 PWM's, but they are not independent and only a marketing guy would describe it as 2.

                              The Atmel evaluation board does not have a prototyping area, so the extra circuitry I need would have to be mounted off board.

                              Basically I am a lazy person. There are a lot of projects I would like to do, but I am too lazy to even begin them let alone finish them. For me to really start on this it has to at least appear to be easy to get started. Every extra component I have to think about makes it less likely that I will ever start.

                              Robert Hoolko

                              Comment

                              Working...