Mikromedia dspic33EP DMA

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
jmusselman64
Posts: 31
Joined: 15 May 2018 21:05

Mikromedia dspic33EP DMA

#1 Post by jmusselman64 » 05 Sep 2018 15:09

Does the Mikrobasic dspic224/33 compiler support dma for the mikromedia dspic33EP board?

I'm beginning work on another section of code that will use DMA and the TX side of a UART, so I'm setting up a buffer with:

Code: Select all

dim testbuffer as byte[32] dma
just to make sure the compiler is happy...and it isn't:

Code: Select all

1 1015 Hint: Compiling unit "H:\Documents\Programming-JAM\BASIC\MikroBasic24\Projects\AR5_V3\AR5_V3_main.mbas" AR5_V3_main.mbas
162 1010 Hint: Unit "AR5_V3_main.mbas" has been recompiled AR5_V3_main.mbas
0 134 Compiled Successfully H:\Documents\Programming-JAM\BASIC\MikroBasic24\Projects\AR5_V3\AR5_V3_main.mbas
0 139 All files Compiled in 47 ms  
76 362 Not enough RAM 'testbuffer' AR5_V3_main.mbas
0 453 Unsuccessful linking 'AR5_V3.mbpds' Unsuccessful linking 'AR5_V3.mbpds'
0 102 Finished (with errors): 05 Sep 2018, 07:01:12 AR5_V3.mbpds
The .def file seems like it has the correct info regarding DMA memory..am I missing something?

Thanks,
Jerry

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Mikromedia dspic33EP DMA

#2 Post by filip » 19 Sep 2018 12:00

Hi,

Try this :

Code: Select all

dim testbuffer as byte[32] dma far
Regards,
Filip

jmusselman64
Posts: 31
Joined: 15 May 2018 21:05

Re: Mikromedia dspic33EP DMA

#3 Post by jmusselman64 » 03 Feb 2019 19:01

The DMA RAM section of the compiler appears to have a bug
The following test code reserves a simple DMA buffer in DMA RAM.

On the DSPIC33EP512MU810, DMA ram is from 0x00E000 - 0x00DFFF

Code: Select all

program asmtest
'  Processor : DSPIC33EP512MU810

' Declarations section 

dim testbuffer as word[16] dma far
dim testbuff_addr as longword

main:
'   Main program 
testbuff_addr =  @testbuffer

DMA0STAL = loword(testbuff_addr)
DMA0STAH = hiword(testbuff_addr)

while (1)
wend

end.
The variable 'testbuff_addr' ends up outside the chips RAM space at at 0x01DFE0 . It should be 0x00DFE0.

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: Mikromedia dspic33EP DMA

#4 Post by petar.suknjaja » 04 Feb 2019 17:31

Hi,
We'll investigate this and I'll let you know if I find something new.
Kind regards,
Petar

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”