Announcement

Collapse
No announcement yet.

chipKIT uno32 Arduino MD experiments

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

  • #31
    the light bulb is getting brighter..........

    hi moodz,

    i checked out the link, i see where your examples came from, I'll have to look into that further, The mistake I was making, I was thinking your were using the Spi library contained in chipkit's MPIDE, but i see now, they were referenced from the pic32's peripheral libraries.

    getting the timing optimized on SPI can take a bit of work
    i haven't had too much of a problem with the spi, except for speed (I'm using the spi / dspi (diligent) library, although to get the rated throughput of my adc, the data sheet specs is 2000ns
    1400ns for the conversion
    600 ns for the acquisition

    seems the dspi is the "faster of the 2 spi's

    I'm figuring to get rated throughput, I'll need to run my spi sclk pretty high, 600ns/16 bits = 37ns clock = a 27 mhz sclk or faster. right now i can't go above about 16mhz,

    i'm usuing pin 13 on the chipkit which is also hooked to the led, could be affecting my freq
    i'll need to put my scope on it.

    my goal is to get the 2us sampling time, right now i'm getting 3us which i know, doesn't seem like much, but on a 10us window is the different between 3 samples or 5 samples

    After the first sample window, i'll do the math, then the second sample, a little more math,

    Philip

    Comment


    • #32
      ...new toy ...even cheaper than the UNO32 ..twice the power and specs
      • STM32F407VGT6 microcontroller featuring 32-bit ARM Cortex-M4F core, 1 MB Flash, 192 KB RAM in an LQFP100 package
      • On-board ST-LINK/V2 with selection mode switch to use the kit as a standalone ST-LINK/V2 (with SWD connector for programming and debugging)
      • Board power supply: through USB bus or from an external 5 V supply voltage
      • External application power supply: 3 V and 5 V
      • LIS302DL, ST MEMS motion sensor, 3-axis digital output accelerometer
      • MP45DT02, ST MEMS audio sensor, omni-directional digital microphone
      • CS43L22, audio DAC with integrated class D speaker driver
      • Eight LEDs:
        • LD1 (red/green) for USB communication

        • LD2 (red) for 3.3 V power on

        • Four user LEDs, LD3 (orange), LD4 (green), LD5 (red) and LD6 (blue)

        • 2 USB OTG LEDs LD7 (green) VBus and LD8 (red) over-current

      • Two push buttons (user and reset)
      • USB OTG FS with micro-AB connector
      • Extension header for all LQFP100 I/Os for quick connection to prototyping board and easy probing

      ....and many more features ...you will have to read the chip spec.
      (eg 4 quadrature encoders, 17 pwm generators, DAC, 7.4 msps ADC, ethernet, multi SPI )

      ...for only $20 at farnell

      THIS NOT A BOARD FOR BEGINNERS ...you have been warned. LOL

      moodz

      Click image for larger version

Name:	STM32F4.jpg
Views:	1
Size:	139.3 KB
ID:	331635

      Comment


      • #33
        yup, likes nice but.......

        too bad it only has 12 bit adc's on board,

        if it were 24 bit at 7.2 MSPS in triple interleaved mode



        Anyways, back to the spi optimizing,

        Philip

        Comment


        • #34
          Originally posted by hdphilip View Post
          too bad it only has 12 bit adc's on board,

          if it were 24 bit at 7.2 MSPS in triple interleaved mode



          Anyways, back to the spi optimizing,

          Philip
          ....yeh they dont seem to integrate fast 24 bit ADCs however the SPI will run at 40 Mhz and the chip has DMA which is handy for getting samples into the chip without processor overhead. ( The UNO32 has no DMA ... have to move to its bigger brother the MAX32 )

          I only posted it out of interest as a cheap CPU board ... the development environment is not as easy to set up as MPIDE.

          moodz.

          Comment


          • #35
            here's what i'm looking at on the uno32

            to get the spi clock above 20mhz, will be interesting....

            however the SPI will run at 40 Mhz
            I get it


            Philip

            oh, the post office just delivered the 8 ch logic analyzer.......

            Last edited by hdphilip; 05-05-2012, 06:43 PM. Reason: major event!!!!!

            Comment


            • #36
              16 bit success !!

              a quick update:

              i finally got rid of the gap between the 2, 8 bit samples. this should add a little more speed to the sampling process.

              next step: increase spi bus to adc rated spec

              in the picture below, spi is running at about 8 mhz

              Philip
              Attached Files

              Comment


              • #37
                Now were back on track

                here's an update of my progress so far,

                I have the Spi running in the 16 bit mode, and the spi bus at 16mhz,

                So I'll be sampling at 2.4 us, I'm happy with that at the moment.

                In testing the ADC, the method I used, is what I call the "battery method".

                I connected a 1.5 volt battery to input of the ADC, reason being, a battery is simple form of pure DC that I could come up with. The idea being if i put a stable DC reference on the input, I should see a stable voltage reading on LCD screen. If not, I would have to look around for noise problems in my power supply, or voltage reference circuit. Or the timing signals to the ADC.

                With a AA Duracell battery my reading was 1.60196 volts solid like a rock!!!

                If this reading was jumping around, it would be pointless to go farther....

                For the Front end,
                I've been thinking about basing it on Carl's HH2, well in theory, not sure which op-amp i'll use, I'd like to use a low voltage, rail to rail, high speed. etc,etc.

                For the audio,
                An idea I've been thinking about is to use a 555 connected to an output pin on the pic32 that way, the audio would be clean as a whistle, and easy to control. Use a smd pot to adjust it so it's just right!


                ok, back to business

                I can't really decide on which timing ideas would be the best to experiment with, so maybe the best idea would be is to try out many different ideas, and your metal detector will let ya know which is best!

                Now that's experimenting!!!!

                let's consider each start of a TX pulse as an "Event", and the Event ends at the start of the next Event, which could be called Event 2, and so on for Event 3,4,5 and back to Event 1.

                So what would be different between Events?
                Well maybe Event 2 would have a shorter TX pulse or maybe different math formulas than Event 1.

                and of course, The LCD display would let ya know which event pick up the gold first!

                We could also display the decay curve on the LCD, how? well, say our sample window is 20us wide and were sampling at 2.4us+math= 2.5us 20/2.5 = 8 samples, which would make for a poor display, what we could do is sample Event 1 again and call it Event 1a, it would have a timing offset in order to sample in the "acquisition time" of Event 1, so it would "fill in the gaps" sort of speak. now we have 16 "bars" on our display that would work.

                comments are welcomed!

                Philip
                Last edited by hdphilip; 05-12-2012, 10:42 PM. Reason: typo's

                Comment


                • #38
                  Hi Hdphilip,

                  The timing sweep sounds great! The good thing about direct front end sampling is jitter is allowed providing that once you start the tx, everything is locked to the tx start and happens damn well when you want them. The time between cycles can vary while you are completing your processing. You could also be doing some processing during the tx time!

                  Keep it up! Looks interesting.

                  Cheers Mick

                  Comment


                  • #39
                    Mick

                    I'm thinking the only interrupt would be is to service the LCD display, which would happen only if their is valid signal.

                    Philip

                    Comment


                    • #40
                      Hi Phillip,

                      With the LCD, they can be a bit slow with the data transfer. What you can do is send out 1 bit/cycle which will prevent it from holding up the system. The lcd does not need to be updated often, 60 times a second is more than enough.

                      One thing that could cause a bit of a problem with the decay curve scanning is emi. You may need to incorporate some averaging on the samples to reduce the effects. The other thing you can do is just join the dots every 2.5us. The decay curve will follow this anyway. If a decaying target is under the coil, the signal will always be decreasing. Any increasing on the samples from one to the next would be a result of emi. Averaging the samples taken 50 or 60 times a second will filter most emi out.

                      Thinking about jitter(random time between cycles) this could prove useful for reducing emi effects caused by repeating signals, eg power line harmonics radio transmissions etc by making the emi more random maiking it a lot more difficult for harmonics of these frequencies to get through....

                      Cheers Mick
                      Last edited by Mechanic; 05-13-2012, 03:53 AM. Reason: spelling

                      Comment


                      • #41
                        hi Mick


                        yea in relative time the LCD is slow, just to update my LCD takes 8ms,I'm looking at a update at 24fps.

                        good points you bring up on sampling, it's kinda of a fine line on the averaging the signal, too much and you could lose information, too little you may get a lot of false indications.

                        Philip

                        Comment


                        • #42
                          Hi Phillip,

                          The other thing you need to consider is increasing the time between tx's for further sampling. For the targets that are of interest the frequency responses range between 1khz and 100~150khz. To identify the slower targets you will most likely need more time to identify the target decay as a 1khz decaying signal does not decay much in 20us.

                          Also don't forget that the coil will be swept at about 1~1.5m/s so target response times are going to be <10 hz. So any signals(emi) that alter the decay curve faster than this need to be dealt with accordingly. You will also need a late sample containing little to ne target or ground signal to compare the other samples with to remove offset errors caused by moving the coil through the earth's static magnetic field, amplifier offsets and the opamps 0 to 10hz noise(this can be extended up to 1khz)

                          Keep up the good work!

                          Cheers Mick

                          Comment


                          • #43
                            Neat Project

                            Very cool project indeed, If you do decide to move to an 18bit adc be sure and keep us posted on how it works out for you.
                            Another chip you might want to look at is the ads8330, it's the same price as the ads8319 but has better specs an requires less drive circuitry, also has 2 channels so you can use 1 channel at each gain stage for a better GB sample later in the decay (very important)

                            How are you driving your coils?
                            You may want to look at the adum3220, it's a 2channel 4A isolated mosfet driver with very nice specs (extremely low jitter), Using that removes allot of the level conversion circuity required if you're driving your coil directly. Only drawback is needing a separate power supply but it's lower noise that way so I don't mind.

                            Are you going to be using this with mono or DD coils?

                            __________________________________________________ __________________________________________________ _________________
                            XPI, It's all about depth - http://www.miymd.com/index.php/projects/xpi/

                            Comment


                            • #44
                              jon

                              How are you driving your coils?
                              You may want to look at the adum3220, it's a 2channel 4A isolated mosfet driver with very nice specs (extremely low jitter), Using that removes allot of the level conversion circuity required if you're driving your coil directly. Only drawback is needing a separate power supply but it's lower noise that way so I don't mind.
                              looking at the adum3220 looks pretty slick, nice isolation, and with the 2 channels, one of the channels could be use for an mosfet controlled damping, wished it had a little higher voltage, like 24 volts that way w could use 2, 11.1 volt lipo's to drive a coil.
                              don't forget it's a soic-8 package, my favorite!!

                              i was looking at those adc's it seemed to me they were a little more complex, just to switch channels you had to write a register, where as a little spdt switch controlled by an i/o pin would make the code a little more simple, and faster too.

                              Philip

                              Comment


                              • #45
                                here's an update,

                                This is a screen shot of some of the timing pulses,

                                1 adc data out spi
                                2 spi clock (16 bits)
                                3 the logic "high" would be the sampling window
                                4 logic "high" controls a switch to allows the adc's preamp to be connected to the coil.
                                5 TX pulse

                                I've been working on the code for the sampling averaging. some of the ideas I've been thinking about are:

                                if theirs no detectable sample, start the TX pulse again.
                                only update the display with an valid sample.

                                jon,

                                Those xpi boards are cool ordered the parts tonite from digi-key




                                Philip
                                Attached Files

                                Comment

                                Working...
                                X