Helpful ReplyHot!Is MCC just a complete waste of time?

Page: 12 > Showing page 1 of 2
Author
Charlie E
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2009/08/24 14:20:00
  • Location: 0
  • Status: offline
2018/05/01 10:45:39 (permalink)
0

Is MCC just a complete waste of time?

Does anyone else feel that MCC is just a complete waste of time?  I was porting an existing project to a new processor, because I needed some of the features (I2S) the new processor had.  I made the silly decision to use MCC to generate drivers for those features, as well as for the features I was already using.
 
So far, it has been an awful idea.  First, the drivers are only the very lowest, most basic level functions.  No gets() or puts() on the uarts, no basic drivers for any devices, and most of those basic level functions are using some strange philosophy of handling the peripheral that I have never heard of, and that IS NEVER EXPLAINED ANYWHERE!@!@
 
Latest issue?  The SPI bus.  Basically, the only functions defined are initialize, exchange (????) a byte of data, exchange a byte of data to a buffer (NEVER EXPLAINED!!!)  and a status check function.  No explanation of how to actually USE these odd functions to access a device. 
 
I just wish I could figure out how to go back to the old peripheral libraries that has so much more functionality that this stuff...
#1
jtemples
Super Member
  • Total Posts : 10946
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 11:06:30 (permalink)
5 (3)
exchange (????)

 
I've never used MCC, but why do you feel an "exchange" function is puzzling?  SPI is bidirectional and you can't do just a read or just a write; you're always doing both at the same time, hence "exchanging".
#2
du00000001
Just Some Member
  • Total Posts : 2120
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 11:23:42 (permalink)
5 (2)
I'm using MCC as sime "quickstart package", for which purpose it is not that bad.
But then I switch to optimizing and partly reorganizing - "manual work".
 
I would not consider it "worthless" just because it does not deliver puts() / gets(), as these functions are easily implemented by calling putc()/getc(). It is intended to deliver some help, but it cannot be some "graphical application generator".

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#3
Mysil
Super Member
  • Total Posts : 2885
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 11:23:52 (permalink)
5 (2)
Hi,
My experience is somewhat the opposite, of message #1.
There are bugs, inconsistencies, and mistakes both in old Plib libraries, and in code generated by MCC,
Even then, I have got useful stuff out of MCC.
In my opinion, the use of macros that was practiced in Plib is obscure and difficult to debug.
 
You may still download (Legacy) Plib from Microchip Archive webpage:
Or pick it up from XC8 v1.33 or earlier.
Precompiled libraries may need to be compiled with new versions of compiler and corresponding device support files.
Or just pick up the parts of source code needed, and integrate with your own project source.
 
Plib are built around a header file with definitions of what variant of various peripherals are present in different devices. You will have to update it for new hardware released after Plib maintenance ended.
 
MLA have been updated, to not depend on Plib, and is in some ways aligned with MCC.
The last version of MLA before some parts of it was dropped, was MLA v2013-06-15, it may also be downloaded from archive webpage. It is labeled: Legacy MLA
 
   Mysil
post edited by Mysil - 2018/05/01 11:37:52
#4
JorgeF
Super Member
  • Total Posts : 3283
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: PT/EU @ Third rock from the Sun
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 11:49:35 (permalink)
0
Hi
 
Mysil
In my opinion, the use of macros that was practiced in Plib is obscure and difficult to debug.
 

I agree, but OTOH I've noticed that those macros generate better code that inlined functions, at least when parameters are used.
Of course this is for a free version of XC8, probably with a pro licence the result would be better.
 
As for MCC, by my , somewhat limited experience, the code generated was not that bad, and its quite easy to understand, althought some minimal documentation would be usefull, at least a decent function description in the form of comments alongside the declaration.
 
 
Best regards
Jorge
 
#5
du00000001
Just Some Member
  • Total Posts : 2120
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 11:57:34 (permalink)
0
Macros are scary to debug (unless you have some means of intervention between the preprocessor and the compiler run) but are certainly capable to deliver code that's more efficient than function inlining (same effic8ency given some preconditions) - irrespective of some optimization level.
This has to do with the way macros resp. inline functions are processed.
Single-line macros are of lesser concern - issues start raising with multi-line macros. But even these have their right to live given some preconditions (mostly consistency issues).

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#6
RISC
Super Member
  • Total Posts : 5271
  • Reward points : 0
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 12:28:03 (permalink) ☄ Helpfulby cobusve 2018/05/01 19:18:05
5 (3)
Hi Charlie,
 
I'm surprised with your comments.
I personally have saved tons of hours thanks to MCC because it has made PIC configuration so simple thanks to the graphical menus.
 
Additionally, there are plenty of examples and drivers developed for click boards which make prototyping much easier.
For the click boards you can donwload the comlete library here :
http://www.microchip.com/mplab/mplab-code-configurator/click-into-mcc
 
Then, you have lots of generic MCC libraries here including some protocol stacks :
http://www.microchip.com/mplab/mplab-code-configurator  (under current download tab).
 
finally you have tutorials here : http://microchipdeveloper.com/
 
Regards
 
#7
PStechPaul
Super Member
  • Total Posts : 2038
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 13:09:20 (permalink)
5 (1)
I have found MCC useful, especially when using a new (to me) PIC. I have run into problems but often they were caused by my own lack of understanding and experience with MCC. It can be frustrating with so many header and source files, especially when trying to look at them in the editor when many others are loaded from other projects. It would be helpful to have a filter that can optionally exclude files from other projects. But I have learned to just use the list of project files in the sidebar and click on whichever I want to examine.
 
Sometimes I have taken the relevant code from the MCC files and inserted it in just my main C and H files, for small, simple projects. But the ability to create a package of all files used is easy enough.

 
#8
Gort2015
Klaatu Barada Nikto
  • Total Posts : 2645
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 14:38:44 (permalink)
0
I've never used it but a gui interface seems like a better method if you don't know your way around the modules and h/w registers.
 
There's always docs.

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#9
katela
Super Member
  • Total Posts : 954
  • Reward points : 0
  • Joined: 2013/06/11 05:25:18
  • Location: South Africa
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 15:21:42 (permalink)
0
Documentation is really limited compared to the old plib help files but in the MCC generated Header files, they always try to explain some times with short examples how to use the generated functions.
Once you are used to it, it can really save your time.
Like the SPI_Exchange8bit() routine, it explained in the comments above it and a short description how to use to send or receive data because with SPI there is no really difference between send/receiving data. The same function can be used to send and receive data. As one device sends a byte of data so the other transmit data:
This is a short description from spi.h file:

/**
@Summary
Exchanges a data byte over SPI
@Description
This routine exchanges a data byte over SPI bus.
This is a blocking routine.
@Preconditions
The SPI_Initialize() routine should be called
prior to use this routine.
@Param
data - data byte to be transmitted over SPI bus
@Returns
The received byte over SPI bus
@Example
<code>
uint8_t writeData;
uint8_t readData;
uint8_t readDummy;
SPI_Initialize();
// for transmission over SPI bus
readDummy = SPI_Exchange8bit(writeData);
// for reception over SPI bus
readData = SPI_Exchange8bit(DUMMY_DATA);
</code>
*/
uint8_t SPI_Exchange8bit(uint8_t data);

 
If you are confortable with the old PIC18F peripheral libraries, you can still use them. You can download them separately from the same compiler downloads area, they are now called Legacy Peripheral Libraries or use an earlier version of XC8 compiler (v1.34 or earlier) but you might experience some problems when using newer chips.

Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
YouTube Tutorials: https://www.youtube.com/user/StudentCompanionSA
#10
du00000001
Just Some Member
  • Total Posts : 2120
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 15:40:12 (permalink)
0
I have a hard limitation running MCC (still running Win XP on my main machine), but use - where available - MCC configuration files provided in the MPLABXpress projects.
N.B.: there's often more than a single way to (ab)use some tool.

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#11
JorgeF
Super Member
  • Total Posts : 3283
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: PT/EU @ Third rock from the Sun
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/01 15:45:12 (permalink)
0
Hi
katela

/**
@Summary
Exchanges a data byte over SPI
@Description
This routine exchanges a data byte over SPI bus.
This is a blocking routine.
@Preconditions
The SPI_Initialize() routine should be called
prior to use this routine.
@Param
data - data byte to be transmitted over SPI bus
@Returns
The received byte over SPI bus
 
@Example
<code>
uint8_t writeData;
uint8_t readData;
uint8_t readDummy;
 
SPI_Initialize();
// for transmission over SPI bus
readDummy = SPI_Exchange8bit(writeData);
// for reception over SPI bus
readData = SPI_Exchange8bit(DUMMY_DATA);
*/
uint8_t SPI_Exchange8bit(uint8_t data);

 
It looks like things improved since the last time (MCC version) I tested.
This was exactly wait I was refering in my previous post.
Althought it has a detail that might explain why I saw, somwhere in the forums, a code snipset were SPI_Initialize() was called inside a transmition loop, this is once for each exchange.
 
OTOH, I would rewrite the transmition example, or at least added another possibility

// for transmission over SPI bus
SPI_Exchange8bit(writeData);

In C we can allways ignore the return value of a function if we don't need it.
The original example only makes sense in the less commom full duplex scenario, 
 
Thank you for the update.
 
 
Best regards
Jorge
 
 
post edited by JorgeF - 2018/05/01 15:47:14
#12
Charlie E
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2009/08/24 14:20:00
  • Location: 0
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/02 16:52:15 (permalink)
0
Thank you all for interesting ideas.  In my case, I have an existing project that I needed to port to a new processor.  What happened was I needed to have an I2S bus for an upgraded audio chip.
 
Since I didn't have any drivers or software for I2S, I hoped that MCC might have something.  Well, it doesn't.  You can set up the register through it, but no help in actually USING it.  The concept of exchanging data was not foreign to me, but actually implementing it efficiently is a non-trivial exercize!
 
Then, I found that all my I2C and UART routines were now broken!  I managed to fix my old SPI routines on the new chip, but all the rest are still pretty much broken.
 
And of course, not that I can finally COMPILE my code successfully, it won't load onto my board for debug.  It says it loads, but the debugging console says the load failed.  And of course, Microchip tech support no longer provides telephone support...
#13
Jim Nickerson
User 452
  • Total Posts : 5263
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/03 07:12:06 (permalink) ☄ Helpfulby cobusve 2018/05/03 18:11:04
5 (4)
Charlie E
And of course, Microchip tech support no longer provides telephone support...

I have found after opening a support case I receive a case number and usually within a day or so a case number and a phone number access code for technical support.


#14
cintet
Senior Member
  • Total Posts : 67
  • Reward points : 0
  • Joined: 2007/12/10 09:44:08
  • Location: 0
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/04 15:26:02 (permalink)
0
MCC is a very good "idea" but still full of bugs, with strange behaviors, for example when changing between projects, closing, saving; sometimes I prefer shutdown MPLABX and restar it again; and very, very, very slow. I hope they can improve it.
#15
RDS Cliff
Starting Member
  • Total Posts : 37
  • Reward points : 0
  • Joined: 2016/09/23 11:50:05
  • Location: 0
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/04 19:04:00 (permalink)
4.67 (3)
You didn't mention which processor family you are using MCC for.  Want to make sure we are talking about the same elephant.
 
I'm relatively new to Microchip PICs and used MCC to give me a quick start on a PIC18, an 8 bit processor.  I found MCC to be relatively complete and really liked how it automatically took care of frequency and time settings.  Automatically taking care of configuration conflicts was also a help to someone new to the chip.  I think I found only one bug that cost me a some time (PIO had an analog setting but the checkbox was missing in the pin manager).
 
After the success with MCC on the PIC18, I thought the move to a PIC24 would be easy. Not a chance. MCC for the PIC24 is very incomplete compared to MCC for the PIC18. All the macros that saved me from looking up all the bit controls for the peripherals were missing. Inconsistent coding styles. A lot of just plain missing functions. I've taken to writing wrappers for the header files to add the missing bit setting macros that I had grown used to in MCC for the PIC18. And a lot more bugs in both the generated code and the UI.  I have to constantly check the DMA configuration because the UI keeps forgetting the settings I put in.
 
So I think you need to keep in mind that MCC is not the same product for all processors.
#16
Mysil
Super Member
  • Total Posts : 2885
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/05 02:00:58 (permalink)
4.67 (3)
Hi RDS_Cliff,
 
I wonder if some of the differences experienced between PIC18 and PIC24, isn't due to MCC at all,
but instead is due to differences in the device support files  <xc.h>.
All the macros that saved me from looking up all the bit controls for the peripherals were missing.

These are not part of MCC, they are maintained and installed together with the compiler.  For PIC18 and 8 bit devices, there are a lot of macros to address single bits in control registers, and bits are documented in datasheet like TMR3ON, allowing to write like TMR3ON = 1;
 
In PIC24 and other 16 bit PIC devices, there may be 5 or more timers, that are very similar, and may be documented together, with description of  TxCON register with TON bit. 
For these devices with several instances if some more complicated peripherals, it is more difficult to have single bit names that are unique. It is then better to use Register and Bit name together, like REGISTERbits.BITNAME
It is mostly recommended to use struct expressions to address registers in these devices, like this:
    T3CONbits.TON = 1;   

There may be single bit macros defined for some registers, mostly for the first peripheral of a kind.
 
These struct definitions are also available for PIC18 and other 8 bit devices.
 
That said, there are differences between MCC for different PIC microcontroller families,
it is also my impression that some of the more complicated peripherals are not as well supported by MCC as they could be.
 
   Mysil
post edited by Mysil - 2018/05/05 02:12:19
#17
Charlie E
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2009/08/24 14:20:00
  • Location: 0
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/08 11:39:27 (permalink)
5 (2)
Jim,
Just because you have a telephone access number (What is with the 3 hour delay to get one!) doesn't mean you will reach a tech.  I have four open cases, and if I wasn't a Design Partner and could do an end run on them, I would never receive a call.  I had one case open for 30 days, but if you called in, there was never anyone available.
#18
Jim Nickerson
User 452
  • Total Posts : 5263
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/08 11:44:12 (permalink)
0
Charlie,
That has not been my experience, "without an end run".
But then I am only at most one time zone away.
#19
dan1138
Super Member
  • Total Posts : 2841
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: Is MCC just a complete waste of time? 2018/05/08 12:13:32 (permalink)
0
In my experience the MCC is almost a complete waste of time.
 
For me the MCC at its best provides example code that on careful study, reverse engineering and fixing provides the register settings and inefficient APIs to manipulate the on chip hardware function block.
 
The "application" methods MCC uses seem counter intuitive to my way of constructing a project, but perhaps I'm out of touch with modern coding practice.
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2018 APG vNext Commercial Version 4.5