Hot!Where did DMA go, in dsPIC 33EP128GS702 ?

Page: 12345 > Showing page 1 of 5
Author
CinziaG
rome burns :D
  • Total Posts : 3135
  • Reward points : 0
  • Joined: 2016/12/07 14:20:36
  • Location: Wien
  • Status: offline
2017/07/25 08:52:08 (permalink)
0

Where did DMA go, in dsPIC 33EP128GS702 ?

Datasheet says that there are some DMA channels, say 2 or 4 (I only need on);
Include file knows nothing about it, and so does the GLD file - XC 16 v1.31 (should be latest)...
 
So...
Will I have to add manually all of its definitions? Smile I will do and post the file then...
#1

84 Replies Related Threads

    du00000001
    Just Some Member
    • Total Posts : 1234
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/07/25 09:09:14 (permalink)
    0
    Hi,
    have a closer look at the peripherals matrix (DS Rev. D, page 2): the GS7* have no DMA.
    4 DMA channels are only available on GS8*.
    Sorry for that...
    #2
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/07/25 09:27:14 (permalink)
    0
    Argh, wirklich? :)
     
    I only have DS70005258B document and can't seem to find a more recent "D": it does mention DMA without exception, and the GLD and H file have the interrupt vectors defined, and other stuff too....
    #3
    du00000001
    Just Some Member
    • Total Posts : 1234
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/07/25 09:46:36 (permalink)
    4 (1)
    Sorry, the D was a typo. Should have been a B.
    Look at the matrix on page 2! This seems to be only location (aside from the product page @microchip.com where DMA is not mentioned as well).
    Thus the DMA chapter (8) could be considered "a bit sluggish") as it is denoting the 7* derivatives as well - that do not have DMA support according to page 2.
    #4
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/07/25 09:49:22 (permalink)
    0
    Ok Smile
    Yeah you're right, now I see it, no 28 pins part...
    I added the missing stuff into the H and GLD file and I can compile, but am not ready to test yet. Funny is, in the IFS0 register the DMA thing was removed, but in the IEC it is still in there, like the vectors etc...
     
    So, well, I may raise a support ticket, or perform some debugging - but I need a serial port Smile
     
    thank you!
    #5
    du00000001
    Just Some Member
    • Total Posts : 1234
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/07/25 12:05:00 (permalink)
    3 (1)
    Maybe a bit sluggish in the header files as well. Anyway, I do not expect you to find significant remainders of the DMA.
    What about using MAPS to find some replacement device? I do not know your "must" requirements...
    #6
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/07/25 13:29:54 (permalink)
    0
    Possibly Smile
    Let's see. It's no real project, I am trying again to get this thing working
    http://www.microchip.com/forums/m699076-p2.aspx
    now with a more powerful PIC and moreover with a pcb suitable for prototyping it. But only on the 28 pin version...
     
    Without DMA, it takes some 10-15 instruction to fetch ADC's output and store it into a buffer, which means some 150-200nS per interrupt. I'd need 3Msamples/sec for some proper FFT in MW range...
     
    Of course, this is just academic, since basically there are no longer radio stations on MW and LW in Austria and surroundings...
    #7
    du00000001
    Just Some Member
    • Total Posts : 1234
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/07/25 13:59:45 (permalink)
    0
    Start with DCF77 and alike - these time signal transmitters should all be available on LW.
    As f9r the 28 pins: seems you'll have to upgrade to 40+ pins.
    For the Explorer-16, "something" fitting your need should be available.
    #8
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/07/25 14:37:46 (permalink)
    0
    Ah you're right, that one can be a starting place Smile !
     
    I may make up some 44pin pcb, yeah...
    #9
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/23 14:42:11 (permalink)
    0
    Let me get back upon this :)
     
    I am implementing the ping-pong and buffering via DMA. Now I have a doubt...
     
    FFT functions need Q15 format and "complex" data. I know the ADC can provide me the proper format, already: but am I still in need of converting the DMA'ed bunch of samples into a real+imaginary parts?
    Say, like in this thread:
    http://www.microchip.com/forums/FindPost/820328
    (and in CE147/CE018 by Microchip)
     
    Is there a trick in the ADC (a dsPIC33E but maybe others have ie too) or in the DMA that can let me obtain the (anyway zeroed) complex part for each sample?
     
    Just to avoid a waste of time...
    #10
    du00000001
    Just Some Member
    • Total Posts : 1234
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/23 14:55:09 (permalink)
    0
    An ADC is "only" capable of capturing "real parts". Imaginary parts come only into play if you sport some I/Q sampling (e.g. in SDRs).
    Basic signal theory: the FFT of purely real signals has only real results !
    I do not know whether the Microchip libs hold such a (simpler) FFT implementation. Eventually you will have to "strip" the FFT implementation available by the imaginary component. If you do not want to start from scratch: this should be a viable option.
    #11
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/24 01:36:44 (permalink)
    0
    Yep I agree about ADCs Smile actually I am missing a bit of theory about "complex"signals: something like real and apparent power, cosfi?
    Well, anyway I plan on working on "real" signals, yeah (waiting for Fringe events in the future...!)
     
    So yours would be a good idea! zeroing the complex part in the FFT code: now I wonder if that source is available by Microchip...
    I've been doing FFT in Windows but that code would work poorly on a PIC...
     
    thank you!
    #12
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/24 01:56:01 (permalink)
    0
    Yep, sources are available Smile let's take a look...
    #13
    du00000001
    Just Some Member
    • Total Posts : 1234
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/24 02:54:09 (permalink)
    4 (1)
    Yep - "complex signals" are - amongst others - the "apparent power thing": the apparent power is the vector sum of the active ("real") and the reactive ("imaginary") power components.
    (In SDR technology, I/Q sampling is nothing more that taking the I-samples ("in-phase") at 0, 180 ° of some reference clock, the Q-samples ("quadrature signal (?)")at 90 and 270 °. If your ADC is fast enough, you can do this with a single ADC. In this case, I and Q values would alternate in the output data stream. Perfect for the complex FFT. ☺
    If you'd love more about this: https://en.wikipedia.org/wiki/IQ_imbalance )
    #14
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/24 09:53:43 (permalink)
    0
    Yeah!
    Perfekt, thanks. Moving on now...
    #15
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/24 13:12:26 (permalink)
    0
    Got it! 44100 sampling, 256 Block-size, I feed 1KHz simulated wave and obtain a nice result in bin 6 (170*6 Hz) Smile
     
    This is simulation. Now we try with ADC and possibly DMA...
    #16
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/24 13:13:56 (permalink)
    0
    Anyone feels like modifying fft.s file from DSP source, in order to use only Real component and zeroing complex? At the moment I feel like I am not able to...
     
    This should be the core code to be modified:

        ; Butterfly proper.
        clr    a,[w8]+=2,w6,[w10]+=2,w4    ; a  = 0 (for dual fetch only)
                            ; w6 = Wr
                            ; pTwidd-> Wi
                            ; w4 = Ar
                            ; pUpper-> Ai (=Ci)

        push DSRPAG
        movpag #0x0001, DSRPAG

        nop
        sub    w4,[w11++],w4            ; w4 = Ar - Br
                            ; pLower-> Bi (=Di)


        pop DSRPAG

        mpy    w4*w6,a,[w8]-=2,w7,[w10]-=2,w5    ; a  = (Ar - Br)*Wr
                            ; w7 = Wi
                            ; pTwidd-> Wr
                            ; w5 = Ai
                            ; pUpper-> Ar (=Cr)
        ; Update twiddle pointer.
        add    w0,w8,w8            ; pTwidd-> for next group

        mpy    w4*w7,b                ; b  = (Ar - Br)*Wi

        push DSRPAG
        movpag #0x0001, DSRPAG
        nop


        sub    w5,[w11--],w5            ; w5 = Ai - Bi
                            ; pLower-> Br (=Dr)
        msc    w5*w7,a,[w11]+=2,w7        ; a  = (Ar - Br)*Wr
                            ;    - (Ai - Bi)*Wi = Dr
                            ; w7 = Br
                            ; pLower-> Bi (=Di)
        mac    w5*w6,b,[w11]-=2,w5        ; b  = (Ar - Br)*Wi
                            ;    + (Ai - Bi)*Wr = Di
                            ; w5 = Bi
                            ; pLower-> Br (=Dr)
        sac.r    a,#1,[w11++]            ; save 1/2*Dr
                            ; pLower-> Bi (=Di)
        sac.r    b,#1,[w11++]            ; save 1/2*Di
                            ; pLower-> Br (next)
        lac    [w10++],a            ; a  = Ar
                            ; pUpper-> Ai (=Ci)
        lac    [w10--],b            ; b  = Ai
                            ; pUpper-> Cr

    ...
     
    #17
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/24 14:38:24 (permalink)
    0
    We have some 290uS for a 256points FFT (@140MHz), plus some 110 for the complex zeroing and Square/Vectoring...
     
    I was thinking FFT was faster, strange...
    #18
    du00000001
    Just Some Member
    • Total Posts : 1234
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/24 15:23:42 (permalink)
    0
    FFT is strong - compared to the "normal" FT. But 2 * 8 * 256 multiplications (gross guess) plus some 2 * 8 * 256 additions take their time. Still much faster than the normal FT (more like 2 * 256 * 256 multiplications and additions). When working on "real only", you can omit the square/vectoring as well ☺.
    #19
    CinziaG
    rome burns :D
    • Total Posts : 3135
    • Reward points : 0
    • Joined: 2016/12/07 14:20:36
    • Location: Wien
    • Status: offline
    Re: Where did DMA go, in dsPIC 33EP128GS702 ? 2017/08/25 02:23:33 (permalink)
    0
    If anyone can help me modifying the routine... or I will studi DSP assembler later Smile
     
    So yes, what you say makes sense... 280uS makes some 20000 instructions @140MHz (14nSec): we're off by a factor of 2 but ok.
    #20
    Page: 12345 > Showing page 1 of 5
    Jump to:
    © 2017 APG vNext Commercial Version 4.5