Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 19, 2024, 03:52:30 03:52


Login with username, password and session length


Pages: 1 2 [3]  All
Print
Author Topic: CCS & MikroC Compiler Comparison  (Read 63046 times)
0 Members and 1 Guest are viewing this topic.
ikefu
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 4
-Receive: 0


« Reply #50 on: September 22, 2013, 09:31:52 21:31 »

I think one thing to consider in comparing compilers is the speed at which the programmer can crank out a prototype program. MikroC has closed libraries which makes it less flexible, but it has so many built in libraries and I find myself coming back to it for all my prototyping needs. For instance, I can use the built in PWM library and just put in a frequency without having to do the calculations I would need without it. So I think you need to consider how you're going to be using it before you pick a compiler. For most school/hobby/prototyping projects the compiler you can program the quickest in is the best. If you go professional and are coding for a product that will be sold the world over and needs super fast optimized code then you'll probably want to look outside of MikroE or the other higher level compilers.
Logged
Vineyards
Active Member
***
Offline Offline

Posts: 168

Thank You
-Given: 62
-Receive: 37


« Reply #51 on: September 22, 2013, 10:45:56 22:45 »

As a matter of fact, it is not right to consider MikroC a hobbyist only platform. We tend to overestimate commercial products. The golden  rule for today is that the eqipment doing the job in the most cost efficient and practical way sells the best. You are welcome to doing with any compiler. If you want to end up in Siemens or Sony they will tell you what platform to code in anyway. In a nutshell, learning  a compiler very well is a hundred times better than wasting your time comparing them. They are all good in different ways.
Logged
mario2000
Active Member
***
Offline Offline

Posts: 162

Thank You
-Given: 330
-Receive: 515


« Reply #52 on: February 03, 2014, 05:59:49 17:59 »


Mikroc:
Code:
unsigned time;
void main() {
  delay_ms(time);
}
Error: void Delay_ms(const unsigned long time_in_ms);

CCS:
Code:
int8 time;
void main()
{
    delay_ms(time);
}

Copiling, complete no error.  

Note that this function in ccs can work with constants and variables, mikroC added new features to its latest version to support variables in this function.

New funtion's in mikroc:
void Vdelay_ms(unsigned time_in_ms);
Creates a software delay in duration of time_in_ms milliseconds (a variable). Generated delay is not as precise as the delay created by Delay_ms.
Note that Vdelay_ms is library function rather than a built-in routine; it is presented in this topic for the sake of convenience.


void VDelay_Advanced_ms(unsigned time_in_ms, unsigned Current_Fosc_kHz);
Creates a software delay in duration of time_in_ms milliseconds (a variable), for a given oscillator frequency. Generated delay is not as precise as the delay created by Delay_ms.
Note that Vdelay_ms is library function rather than a built-in routine; it is presented in this topic for the sake of convenience.


Logged
mclinic
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 0
-Receive: 0


« Reply #53 on: July 02, 2014, 08:49:41 20:49 »

i preffer ccs , stable & less lines of code
Logged
danifox
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 38
-Receive: 2


« Reply #54 on: January 03, 2015, 09:43:04 09:43 »

I've worked with CCS compiler for 2 years without big issues, and when I started I had never programmed a PIC before. For that reason, I think CCS is also good for beginners. I haven't tried mikroE, but CCS is way easier than XC8.
Logged
gan_canny
Junior Member
**
Offline Offline

Posts: 89

Thank You
-Given: 101
-Receive: 26


« Reply #55 on: January 03, 2015, 02:46:11 14:46 »

CCS definitely has advantages. CCS unlike many doesn't wait months or years to fix bugs. There is is the option of compiling with several earlier versions so any issue with a rapid update is easily avoided. It is the best of both worlds and the built in functions make for a short learning curve.
Logged
kaem1189
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 4
-Receive: 3


« Reply #56 on: September 10, 2015, 07:42:21 07:42 »

I used CCS, mikroC, xc8 compilerss..

xc8
    *you only need one reference for programming which is the datasheet of the controller that you are using.
    *advisable for advanced user because of mplabx ide debugging capability(with the use of ICD3 or REALICE)
    *ANSI compliant coding
    *can control each and every part of the code which can be helpful for advanced users..
    *access to registers are easy
    *advanced libraries that has a LOT of settings that can be customized
    *always supports the latest controllers

ccs
    *smallest output hex file compared to the other compiler
    *simplified usage of codes eg. LATX.XY = output_high(PIN_XY) which is very helpful for beginners
    *setup of controller and accessing features are already optimized for the user and requires lesser lines of coding
    *some parts of the code like the interrupt routines automatically resets the flags
    *very understandable functions and routines. Refer to CCS manual
    *very easy to change controller using the same codes..
   
mikroC
   *ANSI compliant coding
   *similar to xc8 coding style
   *lots of libraries for different ICs
   *graphics support and a lot of handy plugins
   *very easy setup of controller


Hope these will help you in choosing your compiler Cool Cool


Logged
Vineyards
Active Member
***
Offline Offline

Posts: 168

Thank You
-Given: 62
-Receive: 37


« Reply #57 on: September 10, 2015, 09:28:44 09:28 »

I used CCS, mikroC, xc8 compilerss..

xc8
    *you only need one reference for programming which is the datasheet of the controller that you are using.
    *advisable for advanced user because of mplabx ide debugging capability(with the use of ICD3 or REALICE)
    *ANSI compliant coding
    *can control each and every part of the code which can be helpful for advanced users..
    *access to registers are easy
    *advanced libraries that has a LOT of settings that can be customized
    *always supports the latest controllers

ccs

    *simplified usage of codes eg. LATX.XY = output_high(PIN_XY) which is very helpful for beginners

I generally agree with you however that item could actually be just one more addition to the code spagetty that boggles peoples minds while preventing them from learning the real thing.
I wouldn't want to be limited to one language variation that is meaningless elsewhere in the presence of all that needs to be learned and memorized.
Logged
kaem1189
Inactive

Offline Offline

Posts: 3

Thank You
-Given: 4
-Receive: 3


« Reply #58 on: September 16, 2015, 08:23:06 08:23 »

I generally agree with you however that item could actually be just one more addition to the code spagetty that boggles peoples minds while preventing them from learning the real thing.
I wouldn't want to be limited to one language variation that is meaningless elsewhere in the presence of all that needs to be learned and memorized.

I totally agree with you.. I stopped using CCS very long time ago and used xc compilers now (xc8 and xc32) if you want to learn every part and all of the microcontroller. Go for XC compilers.. you can customize your code as if you control almost all of the microcontroller.

PS. if you adopted this coding style, its easy to migrate to other controllers eg. AVR freescale , their native IDE and compilers uses the same "register" based control of the chip
Logged
picdev2
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 21
-Receive: 43


« Reply #59 on: September 20, 2016, 08:46:27 08:46 »

I installed the new MPLABX with XC8 compiler, the peripheral libraries are not supported , the Code Configurator produce the library fuctions with no documentetion or examples!
For test I configure the i2c , I couldn't understand what the functions do. Why such a mess ?
« Last Edit: September 20, 2016, 08:51:10 08:51 by picdev2 » Logged
mars01
V.I.P
Hero Member
*****
Offline Offline

Posts: 536

Thank You
-Given: 693
-Receive: 1763



« Reply #60 on: September 20, 2016, 10:44:40 10:44 »

If you look into the generated header files (.h files) by Code Configurator you will find documentation in the comments for each function, data structure. There are also some examples in those comments.

One example. Here is the comment for the I2C1_MasterRead function:

Code:
/**
    @Summary
        Handles one i2c master read transaction with the
        supplied parameters.

    @Description
        This function prepares a TRB, then inserts it on the i2c queue.
        Finally, it waits for the transaction to complete and returns
        the result.

    @Preconditions
        None

    @Param
        address - The address of the i2c peripheral to be accessed
    
    @Param
        length - The length of the data block to be sent
    
    @Param
        *pdata - A pointer to the memory location where received data will
                 be stored

    @Param
        *pstatus - A pointer to the status variable that the i2c driver
            updates during the execution of the message.

    @Returns
        I2C1_MESSAGE_STATUS

    @Example
        <code>
 
            #define MCHP24AA512_RETRY_MAX  100  // define the retry count
            #define MCHP24AA512_ADDRESS    0x50 // slave device address

            uint8_t MCHP24AA512_Read(
                                            uint16_t address,
                                            uint8_t *pData,
                                            uint16_t nCount)
            {
                I2C1_MESSAGE_STATUS status;
                uint8_t     writeBuffer[3];
                uint16_t    timeOut;
                uint16_t    counter;
                uint8_t     *pD, ret;

                pD = pData;

                for (counter = 0; counter < nCount; counter++)
                {

                    // build the write buffer first
                    // starting address of the EEPROM memory
                    writeBuffer[0] = (address >> 8);                // high address
                    writeBuffer[1] = (uint8_t)(address);            // low low address

                    // Now it is possible that the slave device will be slow.
                    // As a work around on these slaves, the application can
                    // retry sending the transaction
                    timeOut = 0;
                    while(status != I2C1_MESSAGE_FAIL)
                    {
                        // write one byte to EEPROM (2 is the count of bytes to write)
                        I2C1_MasterWrite(   writeBuffer,
                                                2,
                                                MCHP24AA512_ADDRESS,
                                                &status);

                        // wait for the message to be sent or status has changed.
                        while(status == I2C1_MESSAGE_PENDING);

                        if (status == I2C1_MESSAGE_COMPLETE)
                            break;

                        // if status is  I2C1_MESSAGE_ADDRESS_NO_ACK,
                        //               or I2C1_DATA_NO_ACK,
                        // The device may be busy and needs more time for the last
                        // write so we can retry writing the data, this is why we
                        // use a while loop here

                        // check for max retry and skip this byte
                        if (timeOut == MCHP24AA512_RETRY_MAX)
                            break;
                        else
                            timeOut++;
                    }

                    if (status == I2C1_MESSAGE_COMPLETE)
                    {

                        // this portion will read the byte from the memory location.
                        timeOut = 0;
                        while(status != I2C1_MESSAGE_FAIL)
                        {
                            // write one byte to EEPROM (2 is the count of bytes to write)
                            I2C1_MasterRead(    pD,
                                                    1,
                                                    MCHP24AA512_ADDRESS,
                                                    &status);

                            // wait for the message to be sent or status has changed.
                            while(status == I2C1_MESSAGE_PENDING);

                            if (status == I2C1_MESSAGE_COMPLETE)
                                break;

                            // if status is  I2C1_MESSAGE_ADDRESS_NO_ACK,
                            //               or I2C1_DATA_NO_ACK,
                            // The device may be busy and needs more time for the last
                            // write so we can retry writing the data, this is why we
                            // use a while loop here

                            // check for max retry and skip this byte
                            if (timeOut == MCHP24AA512_RETRY_MAX)
                                break;
                            else
                                timeOut++;
                        }
                    }

                    // exit if the last transaction failed
                    if (status == I2C1_MESSAGE_FAIL)
                    {
                        ret = 0;
                        break;
                    }

                    pD++;
                    address++;

                }
                return (ret);

            }
        
      </code>
  
*/

void I2C1_MasterRead(
                                uint8_t *pdata,
                                uint8_t length,
                                uint16_t address,
                                I2C1_MESSAGE_STATUS *pstatus);

« Last Edit: September 20, 2016, 10:48:39 10:48 by mars01 » Logged
picdev2
Newbie
*
Offline Offline

Posts: 14

Thank You
-Given: 21
-Receive: 43


« Reply #61 on: September 21, 2016, 08:21:34 08:21 »

I generate code for UART , this is not library, There isnt a fuction to change the baud rate , the baud rate is fixed.
The old Plibs was fine.
Logged
mars01
V.I.P
Hero Member
*****
Offline Offline

Posts: 536

Thank You
-Given: 693
-Receive: 1763



« Reply #62 on: September 21, 2016, 09:25:53 09:25 »

There are always some trade-offs. What's keeping you to make a function for this baudrate change? It's not that hard to add it.
The purpose of a compiler is to compile the code efficiently and correctly. The rest is just bonus.

If you need a compiler that give you a lot of libraries, use mikroC (or even CCS).
Logged
hanle
Inactive

 Warned
Offline Offline

Posts: 6

Thank You
-Given: 21
-Receive: 7


« Reply #63 on: May 23, 2017, 04:35:27 04:35 »

I used MikroC and MPLAB C18 to make a pure sinwave inverter, I had a big problem with MikroC about speeding calculator and interrupt services. However, when I used MPLAB C18 which quite good with the same algorithm.
Logged
Pages: 1 2 [3]  All
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC