Jump to content
 
  • 0

Simulator, UART with DMA, PIC32, MPLAB X IDE


dvvrao
 Share

Question

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.

PFA the package file of the project.

Please let me know if there is any thing wrong with the code or harmony configuration.

usart_loopback.zip

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 1
  • Member

Please feel free to upload code, pictures, videos, whatever you need to make it clear over here, that is the reason we made this forum, to overcome exactly that problem, so thank you for doing that!

George writes the simulator, so there is no better person to help you!

Link to comment
Share on other sites

  • 0
  • Member

Quick look I see that DMA is supported and so is UART, so I would expect that this would be covered. Will get some time on the weekend to try this out and will let you know if I find something interesting.

I am sure there are others on here who have more experience at this and can just throw up an answer though 🙂

Link to comment
Share on other sites

  • 0

I had to create this post here to upload my code and mention the link on that forum.

There i could not upload the code as it was exceeding the 500KB limit.

When i get a solution for my problem in that forum i will update here.

Link to comment
Share on other sites

  • 0
  • Member

Follow up: From George's response on the Microchip Forum this was verified as a bug in the simulator DMA implementation. 

He also posted that this "should" be fixed in MPLAB X 5.20, which means it may end up only being included in 5.25

Response on the forum was this:

 
Quote

 

Re: Simulator, UART with DMA, PIC32, MPLAB X IDE 3 days ago (permalink)
Thanks, that was the missing piece of information that I needed.  I am now convinced the simulator is "broken".  I will write a trouble report to get this fixed.  Unfortunately I would guess this gets fixed in 5.25 not 5.20 😞 More unfortunately, I do not think there is a workaround that can be used for the current version of MPLAB X that you are using.

For those of you who enjoy observing the sausage being made (you know who you are...):  The simulator's DMA peripheral is writing directly to memory instead of to the SFR wrapper objects the simulator uses emulate SFRs.  The simulator's UART is faithfully observing (ala gang of four Observer pattern) the TXREG SFR for notification of a new value being written.  Unfortunately that notification never comes because the DMA did an end-run around the SFR by writing directly to memory.  

This all works perfectly when you use the DMA in the other direction, ie receive a bunch of characters and copy them to a memory buffer.

 

 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

 


×
×
  • Create New...