Pros and Cons of C++

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BeBe_4666191
Level 1
Level 1

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.

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

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

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
3 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

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

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
BeBe_4666191
Level 1
Level 1

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

0 Likes

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

Len
"Engineering is an Art. The Art of Compromise."
0 Likes