Announcement

Collapse
No announcement yet.

32 BIT PIController ... DSPi32

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

  • 32 BIT PIController ... DSPi32

    ...the PI DSP controller lives

    Testbench code operational.

    5 x individual pulse generators for TX or RX pulsing.
    5 x "analogue" control inputs ( ADC reads a pot )
    3 x rotary quadrature encoder
    8 x pushbuttons
    6 x 24 bit differential ADC inputs with programmable gain amplifier on all inputs.
    5 x analogue outputs for generating nice audio/sinus waves and damping control etc.
    1 x High speed RS232 over USB ( FTDI chip ) .... 300 to 230400 bps .
    2 x SPI port ( one is used by ADC )

    CPU board UNO32 ...value at $30
    ADC good value also at $3.50
    The CPU board and ADC are usually the most costly part of the PI electronics.

    Capture time for 6 channels is 5 microseconds.

    DSP filter code executes in 14 microseconds.

    Performance is at least twice the speed of the UNIPI chip.

    moodz.

    Click image for larger version

Name:	DSPi32_ADC.JPG
Views:	1
Size:	46.8 KB
ID:	367748

    Click image for larger version

Name:	DSPi32.JPG
Views:	1
Size:	66.6 KB
ID:	367749

  • #2
    hello moodz,

    nice progress on the uno 32, if you would like, i have a pickit3 and UNO32 ready to try your program here's my email, [email protected] i don't have the adc yet.

    I've been looking at adc's, in particular the MCP3903, what i can't seem to figure out is using the 10 MHz SPI interface, with 24 bit resolution, 10000000/24=416ksps /6 = 69.4ksps witch would equal 14.4 us. per channel ?.

    when you configure the adc what was the OSR setting you used?

    thanks for being patience,
    I'm just trying to make sense of it all

    Philip

    Comment


    • #3
      here's a idea,

      say if our metal detector front end had 3 op amps in the front end (or more), the first op amp might have a gain of 15 (were keeping the gain down to preserve the noise rating of the op amps) then the second stage and the third stage has a gain of 10.

      Then we could connect the adc 1 of the uno to the output of stage 2, and the adc 2 of the uno to the output of stage 3.

      this would serve as a "autorangeing" input to the uno, so the software could select the best input for the DSP, even though the uno is only 10 bits it's also 500ksps!,

      of course their more to it,

      does this idea have any merit?

      Philip

      Comment


      • #4
        Originally posted by hdphilip View Post
        hello moodz,

        nice progress on the uno 32, if you would like, i have a pickit3 and UNO32 ready to try your program here's my email, [email protected] i don't have the adc yet.

        I've been looking at adc's, in particular the MCP3903, what i can't seem to figure out is using the 10 MHz SPI interface, with 24 bit resolution, 10000000/24=416ksps /6 = 69.4ksps witch would equal 14.4 us. per channel ?.

        when you configure the adc what was the OSR setting you used?

        thanks for being patience,
        I'm just trying to make sense of it all

        Philip
        Only wired that up yesterday ...have not drawn the schematic. The code will not run unless there is an adc hanging off the spi2 port. The code is still changing a lot as I moved stuff around the ports ( lots of future goodies ) so I reckon it won't serve a purpose to send it except to indicate you adc is wired up ok.

        LOL .... Misled you with the adc sampling rate .... It takes 5 microseconds to transfer the 6 channels across the Spi bus ... The actual sample rate is 5 kHz or 200 microseconds. 10 MHz clock / prescale by 2 / OSR 256 + conversion time. This is not going to be a direct sampling device .....however this is way higher than we need ... Target detection is a demodulation process and the modulation source is way slower than this sample rate........here is a question...in the style of Aziz quiz show...Aziz is not allowed to answer.

        What is the source / generator of the modulation signal that we want and it's approximate bandwidth. ....free book prize for most correct answer ... I am the judge.

        Moods.

        Comment


        • #5
          Originally posted by hdphilip View Post
          here's a idea,

          say if our metal detector front end had 3 op amps in the front end (or more), the first op amp might have a gain of 15 (were keeping the gain down to preserve the noise rating of the op amps) then the second stage and the third stage has a gain of 10.

          Then we could connect the adc 1 of the uno to the output of stage 2, and the adc 2 of the uno to the output of stage 3.

          this would serve as a "autorangeing" input to the uno, so the software could select the best input for the DSP, even though the uno is only 10 bits it's also 500ksps!,

          of course their more to it,

          does this idea have any merit?

          Philip
          It does .... but would it not be more elegant to provide a feed back loop using a ADC and a DAC to feed a correction offset back to a single opamp. This would allow finer control of the dynamic range ....and use less op amps and adc ports .... Just a possible refinement of you idea ...

          Moodz

          Comment


          • #6
            The actual sample rate is 5 kHz or 200 microseconds.
            so with 200 microseconds it may take a few cycles to take the actual required samples,
            which would be more than adequate.
            so with the 24 bits of resolution, it would be better to see small changes of amplitude which means smaller targets, verses taking a whole lot of samples, which the small changes may go unnoticed

            It does .... but would it not be more elegant to provide a feed back loop using a ADC and a DAC to feed a correction offset back to a single opamp. This would allow finer control of the dynamic range
            you'd be usuing the feedback lot to act like a agc (old radio term)?

            What is the source / generator of the modulation signal that we want and it's approximate bandwidth.
            this will take a bit of thinking


            moodz,

            were you thinking about using one of the channels of the adc connected across the differential coils so the computer could provide an "auto damping" function? that would be pretty slick


            Philip

            Comment


            • #7
              I know now, why the members don't contribute to my quiz show. Obviously there is no prize to win.

              Aziz

              Comment


              • #8
                UNIPI 32 project on the UNO32 with 24 bit ADC 3903 SOURCE CODE INCLUDED !!!

                Here is some code for you ..... the basic UNIPI code ported to the 32 bit UNIPI ... there are 5 output compares synced to each other for generating variable pulses.

                The serial port is through the mini USB port on the UNO32 ( mine runs at 230400 bits / sec ). I use termite from compuphase.com as a terminal .... freeware.

                Below are the build results for the project file ...

                Release build of project `C:\WORK\METAL\UNO32\DSPi32\DSPi32.mcp' started.
                Language tool versions: pic32-as.exe v2.02, pic32-gcc.exe v2.02, pic32-ld.exe v2.02, pic32-ar.exe v2.02
                Fri Sep 21 23:03:44 2012
                ----------------------------------------------------------------------
                Clean: Deleting intermediary and output files.
                Clean: Deleted file "C:\WORK\METAL\UNO32\DSPi32\objects\main.o".
                Clean: Deleted file "C:\WORK\METAL\UNO32\DSPi32\objects\serial.o".
                Clean: Deleted file "C:\WORK\METAL\UNO32\DSPi32\objects\SPI.o".
                Clean: Deleted file "C:\WORK\METAL\UNO32\DSPi32\objects\MCP390X.o" .
                Clean: Deleted file "C:\WORK\METAL\UNO32\DSPi32\.\objects\DSPi32.e lf".
                Clean: Deleted file "C:\WORK\METAL\UNO32\DSPi32\.\objects\DSPi32.h ex".
                Clean: Done.
                Executing: "C:\Program Files\Microchip\MPLAB C32 Suite\bin\pic32-gcc.exe" -mprocessor=32MX320F128H -x c -c "source\main.c" -o".\objects\main.o" -MMD -MF".\objects\main.d" -g -O3
                source\main.c:1:0: warning: Compiler option (Optimization level) ignored due to an invalid license
                source\main.c:1:0: warning: Disable the option or visit http://www.microchip.com/c32 to purchase a full standard-edition license.
                Executing: "C:\Program Files\Microchip\MPLAB C32 Suite\bin\pic32-gcc.exe" -mprocessor=32MX320F128H -x c -c "source\serial.c" -o".\objects\serial.o" -MMD -MF".\objects\serial.d" -g -O3
                source\serial.c:1:0: warning: Compiler option (Optimization level) ignored due to an invalid license
                source\serial.c:1:0: warning: Disable the option or visit http://www.microchip.com/c32 to purchase a full standard-edition license.
                Executing: "C:\Program Files\Microchip\MPLAB C32 Suite\bin\pic32-gcc.exe" -mprocessor=32MX320F128H -x c -c "source\SPI.c" -o".\objects\SPI.o" -MMD -MF".\objects\SPI.d" -g -O3
                source\SPI.c:1:0: warning: Compiler option (Optimization level) ignored due to an invalid license
                source\SPI.c:1:0: warning: Disable the option or visit http://www.microchip.com/c32 to purchase a full standard-edition license.
                Executing: "C:\Program Files\Microchip\MPLAB C32 Suite\bin\pic32-gcc.exe" -mprocessor=32MX320F128H -x c -c "source\MCP390X.c" -o".\objects\MCP390X.o" -MMD -MF".\objects\MCP390X.d" -g -O3
                source\MCP390X.c:1:0: warning: Compiler option (Optimization level) ignored due to an invalid license
                source\MCP390X.c:1:0: warning: Disable the option or visit http://www.microchip.com/c32 to purchase a full standard-edition license.
                Executing: "C:\Program Files\Microchip\MPLAB C32 Suite\bin\pic32-gcc.exe" -mprocessor=32MX320F128H "objects\main.o" "objects\serial.o" "objects\SPI.o" "objects\MCP390X.o" -o".\objects\DSPi32.elf" -Wl,--defsym=__MPLAB_BUILD=1,-Map=".\objects\DSPi32.map"
                Executing: "C:\Program Files\Microchip\MPLAB C32 Suite\bin\pic32-bin2hex.exe" "C:\WORK\METAL\UNO32\DSPi32\.\objects\DSPi32.e lf"
                Loaded C:\WORK\METAL\UNO32\DSPi32\.\objects\DSPi32.elf.
                ----------------------------------------------------------------------
                Release build of project `C:\WORK\METAL\UNO32\DSPi32\DSPi32.mcp' succeeded.
                Language tool versions: pic32-as.exe v2.02, pic32-gcc.exe v2.02, pic32-ld.exe v2.02, pic32-ar.exe v2.02
                Fri Sep 21 23:03:45 2012
                ----------------------------------------------------------------------
                BUILD SUCCEEDED

                MPLAB configuration ....

                MPLAB 8.84.00.00 Certified
                Windows XP 5.1.2600.2 Service Pack 3n\a
                ICDDB 7.51.00.01 n\a
                MasterDB 2.24.85.76 n\a
                PCMDB2k 2.22.01.15 n\a
                PMFDB4k 2.22.03.00 n\a
                DLLInfoRec 8.62.01.0 Certified
                DMCI 1.10.0.6 Certified
                FieldOrientedControlTI1.00.09.00 Certified
                ICD2 8.53.6.1 Certified
                KeeloqPlugin 1.0.0.18 Certified
                MemGauge 1.00.00.00 Certified
                MP32MXSK 1.3.0.0 Certified
                MP32SKCBP 1.1.3.0 Certified
                MP4KE18E 2.70.00.00 Certified
                MP4KE18X 2.60.00.00 Certified
                Mp4keDSC 2.60.00.00 Certified
                MPAppInOut 1.0.0.0 Certified
                MPBootloader 1.0.0.5 Certified
                MPChecksum 2.22.02.18 Certified
                MPDebugger 3.10.00.00 Certified
                MPDevice 2.40.00.00 Certified
                MPDiff 1.01.00.00 Certified
                MPDisplay2 3.76.00.00 Certified
                MPDisplays 3.76.00.00 Certified
                MPE12xxx 4.44.00.00 Certified
                MPE16xxx 4.62.00.00 Certified
                MPE17XXX 4.44.00.00 Certified
                MPE18EXX 4.44.00.00 Certified
                MPE18HC3 4.44.00.00 Certified
                MPE18XXX 4.44.00.00 Certified
                MPEditor4 4.56.00.00 Certified
                MPEditorStg 1.02.00.00 Certified
                MPExpress 2.30.00.00 Certified
                MPForum 3.02.00.00 Certified
                MPI2KVerify 1.0.0.153 Certified
                MPICD3 1.0.3.75 Certified
                MPIce2K 4.64.00.00 Certified
                MPICE4K 2.64.00.00 Certified
                MPIceState 1.22.00.00 Certified
                MPIceStopwatch 1.22.00.00 Certified
                MPLAB SIM12 2.10.00.00 Certified
                MPLAB SIM16 2.10.01.01 Certified
                MPLAB SIM18 3.20.00.00 Certified
                MPLAB SIM30 4.30.00.00 Certified
                MPLAB SIM32 0.00.10.06 Certified
                MPLoader 2.22.00.00 Certified
                MPLogicDisplay 1.51.00.00 Certified
                MPMemory 2.3 Certified
                MPPICkit3 1.0.1.68 Certified
                MPPICkit3OB 1.0.1.32 Certified
                MPPm3 2.40.1.51 Certified
                MPProgram 2.2 Certified
                MPProject 3.8.0 Certified
                MPPromate2 8, 0, 0, 3 Certified
                MPRealICE 6.0.8.9 Certified
                MPRecorder 1.01.00.00 Certified
                MPSim 8.62.01.0 Certified
                MPSimBreakpoints1.60.0.0 Certified
                MPSimulator 1.60.00.2 Certified
                MPSKDE 1.00.01.39 Certified
                MPSMSK 1.00.01.12 Certified
                MPStimulus 2.52.00.00 Certified
                MPStopwatch 2.51.00.0 Certified
                MPTags 2.00.00.00 Certified
                MPTask 1.1.1.0 Certified
                MPTranslator 2.31.00.00 Certified
                MPUSrcvw4 4.00.01.06 Certified
                MPWatchUpdateSupport1.1.2.0 Certified
                PICkit 1 2.0.0.3 Certified
                PICkit2 0.0.3.63 Certified
                Picstart 4.40.0.14 Certified
                RTOSTool 1.10.0.0 Certified
                SCLStimulus 3.60.00.00 Certified
                Suite_CCSPic 2.0.0.7 Uncertified
                Suite_dsPIC 3.10.1 Certified
                Suite_LSCProxy 2.1.2.0 Certified
                Suite_Microchip 3.10.8 Certified
                Suite_PIC32 5.1.8 Certified
                Suite_XC16 3.10.1 Certified
                Suite_XC32 8.84.00.00 Certified
                Vault_CVS 1.2.0.0 Certified
                Vault_PVCS 1.0.0.3 Certified
                Vault_VSS 1.4.0.2 Certified


                Click image for larger version

Name:	UNO32 + 24 bit.JPG
Views:	1
Size:	138.5 KB
ID:	333457

                Click image for larger version

Name:	termite.JPG
Views:	1
Size:	81.6 KB
ID:	333459

                HERE IS THE SOURCE CODE / PROJECT FILE => DSPi32.zip

                Warning ... this aint no metal detector ... it only illustrates how to get get the serial, SPI, interrupts, pulse generators and read a 24 bit ADC off a UNO32 board. There is a basic menu on the serial port.

                It works but there are probably bugs, typos etc ... so no warranty etc yada yada...


                have fun ....

                Comment


                • #9
                  Thanks moodz,

                  this is going to be a big help for me in understanding more about the pic32, I have a spare UNO32, And a pickit3 programmer. looking forward to experiment with your code.

                  now i need to get the 24 bit adc chip....

                  On a side note.

                  I've been usuing my unipi controller as a variable pulse generator, and as everyone knows I've been having a few issues with it locking up.So what i did, I reduced the clock xtal to about 8.8 mhz, and now it works great, and it's still close enough for what i need it for.

                  I'm thinking about usuing a 5 mhz xtal and just doubling the LCD display by 2.


                  Philip

                  Comment


                  • #10
                    Hi Moodz any more on this project ?

                    Comment


                    • #11
                      UNO32 HEX RELEASE update UNO32

                      Originally posted by 6666 View Post
                      Hi Moodz any more on this project ?

                      Based on the same code that runs on my nextgen PI machines this is the backend code for making your basic 32 bit PI controller.

                      Features ...

                      - 5 independant pulse generators for TX or RX sampling ... you choose depending on your design.
                      - serial port menu and status through UNO32 usb port.
                      - Audio generation pin ... just connect a speaker or headphones via 100 ohm resistor.
                      - ADC input for target voltages .... 0 to 3.3 volts .. this is a motion detector ... the voltage must change to produce a audio out .... No output for constant voltage.

                      Internally there is a SAT and 10th order low pass filter with brickwall cutoff at 20 hertz to keep those nasties out of your target sigs.

                      PORT F1 is audio out.

                      OC1 - 5 are the 5 pulse outputs for TX / RX

                      AN2 is the target input voltage ADC

                      here is the hex ....DSPi32.zip

                      Comment


                      • #12
                        Thanks Moodz

                        Comment


                        • #13
                          Moodz, I propose to buy the UNO32 platform development, what are the component, modules I have to buy, and some questions:
                          a) in your first post above i) 8x push buttons, ii) 3x QEI encoders, iii) MCP3903 are specified - are you using this front-end from :
                          http://www.geotech1.com/forums/showt...790#post147790, or other? Which PSU and bias genarator that is better for the quoted post plain vanilla or the ones srinkled with TC4421?
                          b) I propose to develop the above as a shield using MAX32 template from http://code.google.com/p/svofski/sou...Fmax32template, will adapt it for UNO32 - shall it be double sided / single for reducing switching noise? - the shield shall mount buttons, QEI, LCD & front-end.
                          c) what will be preferencial connection points from UNO32? post #8 above does not show connections for LCD, QEI, buttons etc.
                          d) I hope the hex you've provided will be able to drive the above scheme.

                          I've ordered UNO32 from element14 but other components will still take time to reach me till then I have sufficient time to fiddle with shield.

                          Comment


                          • #14

                            My shield for UNO32.

                            Comment


                            • #15
                              Ooops, here's my base shield to go in for preparation....
                              Click image for larger version

Name:	uno32.png
Views:	1
Size:	42.4 KB
ID:	335038

                              footprint for UNO32.

                              Comment

                              Working...
                              X