3 Replies Latest reply on Mar 21, 2020 7:03 AM by LePo_1062026

    Pros and Cons of C++

    BeBe_4666191

      I am going to be using PSoC for a fairly large project. I was thinking of using C++ since it would make my code easier to organise. However latency will be farily important for my project. I will also be implementing 2 PID controllers for the project. From what I understand using C++ would cause my PSoC to slow down and might also cause memory issues. How much of a drop in speed are we talking about. How likely are the memory issues. Are there any other problems I should be aware of.

        • 1. Re: Pros and Cons of C++
          LePo_1062026

          bebe,

           

          Which type of PSoC were you planning on using?

           

          C++ compilers used to be bloated.  But advances in optimizing compiling has reduced code size and, depending on the setting, reduced executing time.  Additionally most C++ compilers still allow for modules to be coded in C or assembler to further improve execution time.

           

          If you are planning on using PSoC Creator as the IDE for your project, I am not aware of C++ being available.

          However, if you plan to use a PSoC6 for your project, ModusToolBox as C++ as well as there are versions of the PSoC6 with up to 2MB of FLASH and 1 MB of SRAM.

           

          Len

          • 2. Re: Pros and Cons of C++
            BeBe_4666191

            I am going to be using PSoC for a fairly large project. I was thinking of using C++ since it would make my code easier to organise. However latency will be farily important for my project. I will also be implementing 2 PID controllers for the project. From what I understand using C++ would cause my PSoC to slow down and might also cause memory issues. How much of a drop in speed are we talking about. How likely are the memory issues. Are there any other problems I should be aware of.

            omegle  discord xender

            • 3. Re: Pros and Cons of C++
              LePo_1062026

              BeBe,

               

              Although there probably will be some FLASH overhead when using C++ over C, the code "bloat" of the old days using C++ is mostly gone.

               

              One trick I would use is to code in C++ as desired.  If I'm pushing the code size limit or need better performance I convert my C++ code to C (or assembler) as needed.

               

              Len