CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

MPLAB X Simulator / DMA [SOLVED/MPLABX BROKEN]

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
newguy



Joined: 24 Jun 2004
Posts: 1767

View user's profile Send private message

MPLAB X Simulator / DMA [SOLVED/MPLABX BROKEN]
PostPosted: Tue Sep 14, 2021 2:53 pm     Reply with quote

I recently started using MPLAB, and given the advice of those here I downloaded and installed version 8.92 given all the negative experiences that seem to be common with MPLAB X.

The issue I'm having is that I simply cannot get the simulator to properly simulate anything involving DMA. When I started digging, I've found that the sim won't recognize setting the DMAxSTA (L/H) and DMAxSTB (L/H) registers. There's probably other issues, but this one is most obvious.

Has anyone tried to simulate DMA functionality on a dsPIC using MPLAB X? Did it work?


Last edited by newguy on Thu Sep 16, 2021 1:38 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21508

View user's profile Send private message

PostPosted: Tue Sep 14, 2021 8:05 pm     Reply with quote

What PIC ?
newguy



Joined: 24 Jun 2004
Posts: 1767

View user's profile Send private message

PostPosted: Tue Sep 14, 2021 10:24 pm     Reply with quote

dsPIC33EP512GP806. Sorry, should have included that the first time.
newguy



Joined: 24 Jun 2004
Posts: 1767

View user's profile Send private message

PostPosted: Thu Sep 16, 2021 1:37 pm     Reply with quote

Just to close this question for anyone curious....

I've spent most of the past week neck deep in MPLAB X and some very stripped down basic functionality involving a timer, the ADC, and DMA. The timer triggers the ADC and when the result is available, DMA transfers it to memory. The ADC is set up in channel scan mode and more than one sample (2 in this case) are scanned/stored for each channel. When all channels have been scanned twice, the DMA's interrupt fires and I can then examine the samples/do something useful.

I must point out that what I'm trying to simulate is based on something I've done in the past, except with a slightly different (older) dsPIC. That existing code works and works well, but at the time I spent quite a bit of time ironing out a bunch of issues related to the DMA (specifically that the data sheet/family reference manual were contradictory in several places, and that the final working version didn't quite match what the documentation said everything should be set to).

With all this in mind, I wanted to sidestep any commissioning issues once I have real hardware in hand by simulating the overall system first. That's why I dove into MPLAB X and its simulator (MPLAB 8.92 wouldn't even properly simulate simply setting the DMA registers).

At this point I'm abandoning the MPLAB X simulator in disgust and frustration because even very basic things like simply simulating a timer and its interrupt causes no end of issues with MPLAB X. It randomly hangs/stops execution, exits the simulator/debugger for no apparent reason, throws really weird/cryptic java exceptions, and shows 100% RAM utilization on the dsPIC33EP512GP806 for a simple "increment a counter" program. Come on - that processor has 52k of RAM!. One more thing that the simulator seems to have fumbled: both the data sheet and the family reference manual state that either timer 3 or timer 5 may be used as the trigger for ADC1. In the simulator only timer 3 can trigger the ADC, not timer 5.

Basic programs - like simply incrementing a variable in a superloop - simulate fine (subject to the 100% memory utilization issue). The more nuanced and complex situation I want and need to simulate, however - forget it.

I realize that MPLAB X is free but surely Microchip must realize that if a designer's first interaction with Microchip is MPLAB X, then they're potentially missing out on a lot of business given how truly broken their IDE actually is.
temtronic



Joined: 01 Jul 2010
Posts: 8227
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Sep 16, 2021 5:12 pm     Reply with quote

I've never held much, if any, faith in any simulator working 100%. Maybe because I 'cut my teeth' on computers that needed bootloaders toggled in, had teletypes as consoles and eventually 8" floppy drives..... program were hand coded using pencil and paper, 'playing computer' to see if the code worked BEORE having a paper tape made of it.
It is sad though that the uChip one fails. I think they should get it right 100% for say a handful of PICs, 1 or 2 of each series, offer a 'use at own risk' for you to simulate other PICs, that way the product DOES work, as advertised.
As for frustrations... I still can't see WHY 'they' flipped the RS-232 xmt and rcv pins when 'they' went fron 25 pins to 9.

Jay
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group