• AVR Freaks

Helpful ReplyHot!Simulator, UART with DMA, PIC32, MPLAB X IDE

Page: 12 > Showing page 1 of 2
Author
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
2019/03/15 06:23:28 (permalink)
0

Simulator, UART with DMA, PIC32, MPLAB X IDE

Does the simulator for PIC32MX470F512L support UART with DMA operation? 
I wrote a program that transmits a character using UART with DMA, but does not work. 
I used Dynamic USART driver with Buffer Que Data Transfer model using DMA.
#1
GeorgePauley
Moderator
  • Total Posts : 1183
  • Reward points : 0
  • Joined: 2009/12/01 13:59:30
  • Location: Chandler AZ
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/15 11:28:12 (permalink)
0
If you click on the "click for simulated peripherals" line you will get a display showing which peripherals are simulated for the current project's selected device.  PIC32MX470F512L shows both UART and DMA, so it all "should" work. 
#2
Mysil
Super Member
  • Total Posts : 3469
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/15 12:41:02 (permalink)
+1 (1)
Hi,
UART in PIC32 devices have a FIFO buffer in hardware,
and some interrupt options in UxSTA register.
Make sure the UART is configured to make interrupt signal for every character transmitted or received,
it will be used by DMA to know when to send the next character.
 
    Mysil
#3
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/17 23:08:15 (permalink)
0
Hi,
 
Thanks for your reply!
 
UART and DMA may work individually.
My query is that, if UART transmit and receive using DMA works in 'MPLAB X SIM' simulator in 'MPLAB X IDE'?
#4
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/17 23:12:08 (permalink)
0
Hi,
 
I use Harmony to generate driver for UART.
PFA with this post. It includes screenshots of "UART driver" configuration and "DMA configuration under system service".
Please check and let me know, if there is anything wrong with the configuration.

Attachment(s)

Attachments are not available: Download requirements not met
#5
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/18 02:50:05 (permalink)
0
https://microchipsupport.force.com/5001N00000pd9Jp
As per the info from support team (above link), the simulator does not support UART communication using DMA.
#6
qhb
Superb Member
  • Total Posts : 9999
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/18 02:55:58 (permalink)
+1 (1)
dvvrcognizant
https://microchipsupport.force.com/5001N00000pd9Jp
As per the info from support team (above link), the simulator does not support UART communication using DMA.

I suspect only you can read that page.
 

Nearly there...
#7
GeorgePauley
Moderator
  • Total Posts : 1183
  • Reward points : 0
  • Joined: 2009/12/01 13:59:30
  • Location: Chandler AZ
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/18 08:59:01 (permalink)
0
I can't read it!  :P
 
#8
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/18 22:58:55 (permalink)
0
I have attached screenshots of the support case 00393356 with this post.
Please see the "Case Comments" section. See "screenshot_part_4.jpg".

Attachment(s)

Attachments are not available: Download requirements not met
#9
qhb
Superb Member
  • Total Posts : 9999
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/18 23:16:57 (permalink)
0
As usual, the first response reveals a failure to read more than a couple of words in the question.
After that exchange, I'm still not convinced "Sherwin" even understands the question.
 

Nearly there...
#10
GeorgePauley
Moderator
  • Total Posts : 1183
  • Reward points : 0
  • Joined: 2009/12/01 13:59:30
  • Location: Chandler AZ
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/19 09:00:14 (permalink)
+1 (1)
I don't see where it says simulator does not support UART communication using DMA?  (Probably just missing it...)
 
Anyway, the next step would be to have you post your project here in the forum.  Its difficult to know what's wrong (your code, simulator, Harmony, etc) without seeing the code.
post edited by GeorgePauley - 2019/03/19 09:51:40
#11
qhb
Superb Member
  • Total Posts : 9999
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/19 12:16:37 (permalink)
+1 (1)
GeorgePauley
I don't see where it says simulator does not support UART communication using DMA?  (Probably just missing it...)

In image#4, in an attempt to stop the "helper" just posting boiler plate responses, the OP asked:
My question is not answered. You have given a generic answer.
Please confirm if the simulator forPIC32MX470F512L support UART communication using DMA.
 
I need an YES/NO answer for my question.
If the answer is YES then we can see what's wrong with my code.

Sherwin then proceeded to post "the answer is no" three times in a row.
 
The OP then requested that "the simulator does not support DMA to the USART" be added to the "resolution", but appears to have got a boiler plate response again.
 
 

Nearly there...
#12
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/20 08:31:42 (permalink)
0
PFA my project attached to this post.
Please let me know what's wrong with my code or harmony configuration.

Attachment(s)

Attachments are not available: Download requirements not met
#13
GeorgePauley
Moderator
  • Total Posts : 1183
  • Reward points : 0
  • Joined: 2009/12/01 13:59:30
  • Location: Chandler AZ
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/20 09:53:09 (permalink)
+1 (1)
Meh, I can't build this.  Missing many include files.  Try right-clicking on the project in the Projects pane and selecting package.  This should give you a zip file that has everything that is needed to ship and build the project.

I went rooting through the DMA code in the simulator.  I can't see a reason why it shouldn't work.  It is triggered by seeing the specified interrupt flag, and then transfers from the specified source address to the specified target address, for the specified number of words.  In particular, I was worried that this particular DMA partition might rely on the UART to communicate when the transfer should occur.  But that's not the case for this DMA, it's just flag, source,target and size.  The DMA actually doesn't "know" what if any peripherals are involved.
#14
qhb
Superb Member
  • Total Posts : 9999
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/20 12:19:04 (permalink)
+1 (1)
dvvrcognizant, GeorgePauley is the best possible person to look at your problem, so please go out of your way to supply him with the files he needs to run your code.
 

Nearly there...
#15
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/20 22:53:08 (permalink)
0
Hi George,
 
I am unable to attach the packaged version of the project as it exceeds the 500KB which is limitation.
Please suggest a way.
 
Thanks & Regards,
Vishnuvardhan
#16
qhb
Superb Member
  • Total Posts : 9999
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/20 23:25:34 (permalink)
+1 (1)
www.dropbox.com
or, attach it to a message in one of the alternative forums, and then post a link to that message here.
http://picforum.ric323.com
https://www.microforum.cc/
 

Nearly there...
#17
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/21 00:43:17 (permalink)
+1 (1)
Hi George & qhb,
https://www.microforum.cc/topic/52-simulator-uart-with-dma-pic32-mplab-x-ide/
This is where i put the "package" form of the project.
#18
GeorgePauley
Moderator
  • Total Posts : 1183
  • Reward points : 0
  • Joined: 2009/12/01 13:59:30
  • Location: Chandler AZ
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/21 11:12:27 (permalink)
0
The plot thickens!  :)

Fortuitously, some bald red-shirted dummy inadvertently left debugging statements in the DMA peripheral.  When I run your project it looks like DMA is having a grand old time transferring data.  If you go to the output window, simulator tab, you should see debuggin statements like...


  --       READING 0x024C 0x1F806020 (0) (read  = 0x33323130)
  --      WRITING1 0x024C 0x1F806020 (0) (write = 00000030)
  --UPDATING_PTRS1 0x024C 0x1F806020 (0)
  --       READING 0x024D 0x1F806021 (1) (read  = 0x00333231)
  --      WRITING1 0x024D 0x1F806020 (1) (write = 00000031)
  --UPDATING_PTRS1 0x024D 0x1F806020 (1)
  --       READING 0x024E 0x1F806021 (2) (read  = 0x00003332)
  --      WRITING1 0x024E 0x1F806020 (2) (write = 00000032)
  --UPDATING_PTRS1 0x024E 0x1F806020 (2)
  --       READING 0x024F 0x1F806021 (3) (read  = 0x00000033)
  --      WRITING1 0x024F 0x1F806020 (3) (write = 00000033)
  --UPDATING_PTRS1 0x024F 0x1F806020 (3)
  --       READING 0x0250 0x1F806021 (4) (read  = 0x37363534)
  --      WRITING1 0x0250 0x1F806020 (4) (write = 00000034)
  --UPDATING_PTRS1 0x0250 0x1F806020 (4)
  --       READING 0x0251 0x1F806021 (5) (read  = 0x00373635)
  --      WRITING1 0x0251 0x1F806020 (5) (write = 00000035)
  --UPDATING_PTRS1 0x0251 0x1F806020 (5)
  --       READING 0x0252 0x1F806021 (6) (read  = 0x00003736)
  --      WRITING1 0x0252 0x1F806020 (6) (write = 00000036)
  --UPDATING_PTRS1 0x0252 0x1F806020 (6)
  --       READING 0x0253 0x1F806021 (7) (read  = 0x00000037)
  --      WRITING1 0x0253 0x1F806020 (7) (write = 00000037)
  --UPDATING_PTRS1 0x0253 0x1F806020 (7)
  --       READING 0x0254 0x1F806021 (8) (read  = 0x003A3938)
  --      WRITING1 0x0254 0x1F806020 (8) (write = 00000038)
  --UPDATING_PTRS1 0x0254 0x1F806020 (8)
  --       READING 0x0255 0x1F806021 (9) (read  = 0x00003A39)
  --      WRITING1 0x0255 0x1F806020 (9) (write = 00000039)
  --UPDATING_PTRS1 0x0255 0x1F806020 (9)

 
So when you say "does not work", what exactly do you mean?  What were you expecting to happen?  Writes of what values to which addresses?
 
#19
dvvrcognizant
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/03/13 07:48:11
  • Location: 0
  • Status: offline
Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 2019/03/21 20:16:58 (permalink) ☄ Helpfulby cobusve 2019/03/21 21:54:24
+1 (1)
 
I was able to see data in "UART1 IO" window, when write data to UART1 in my program, if i configure the UART-driver to NOT to use the DMA. But when I configure UART-driver to use the DMA then i don't see data in "UART1 IO" window.
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5