Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Guys and Gals,

I am new here as of today and I need some advice.

I want to program PIC's and was told to learn C for them.
Also I will add I want to make and design my own PCB and have parts and tools.

But I also want to make a desktop app with GUI and was told to learn C++ as C is harder to make GUI with.
Since I am new to programming (about a week) my question(s) is what would be better to learn first C or C++?

I though maybe C++ and once I learn it then learn C.
I am busy doing home courses on C++ and lots of reading.



Thanks in advance
Ice

What I have tried:

I have searched on google and other sites to figure out what to invest my time in at this early stage.
Posted
Updated 5-May-21 20:49pm
Comments
Richard MacCutchan 5-May-21 17:05pm    
You have set yourself quite a challenge. I would suggest you decide which of these three things you want to do first, and focus on that. And if you are only a week in, you have a long way to go before you are likely to be comfortable with any of them.
merano99 6-May-21 1:27am    
As Richard wrote, this are at least 4 different things.

Programming a PIC microcontroller (16/32 Bit) in C is common.
But it is very different from a C program that you can use for a System with operating system. One needs knowledge of the architecture and accesses hardware directly.

Developing the hardware yourself requires electronic knowledge. One creates circuit diagrams and layout, orders the circuit board or do that yourself.

Then you have to assemble the components. Good soldering skills are required for this
and measuring devices as well as knowledge of components and how to find defects.

If you want to connect the finished circuit to the PC, that stays nowadays only the USB interface.

If you don't want to write a driver yourself, it makes sense to make it HID-compatible. Just set the clock in the PIC for USB correctly is quite a task.

Accessing the USB interface on the PC side works with many Programming languages. If you wanted to stay close to the hardware there too ISO C ++ certainly not a bad choice.

I have already realized these things in exactly the same way many times.

Whereby I usually order the SMD board, because you can hardly do it yourself with PICs that have many connections and I also want to avoid working with acid.

To start with, I would recommend buying a ready-made PIC-based demo board with a USB interface.

Then you can deal with the programming and gain experience with the hardware.

If you try everything at the same time, with some certainty nothing will come of it in the end.
Alternatively, you could form a team and split the work.

Icejet 6-May-21 2:19am    
Hello merano99,

Thanks for fast reply to my post/question.

As for electronic knowledge, soldering, diagrams and layout I have decent knowledge on those. I was an aircraft mechanic in Military so have plenty of knowledge from that as well as my old civilian job.

As for components I have lots of parts such as: Arduino's, Pi's, breadboards, prototype boards, Pic's of various sizes and types, resistors, smd's, caps, wire and the list goes on.

As for soldering, that is no problem (except smd as I dont have a hot air station yet). I have several microscopes ( 3 digital x500, x1000, x1500 and 1 desktop stereo microscope), 1 bench Power supply multi output, oscilloscope and several multimeters (digital and analog) and several other items. And i have several pic programmers and related software for them.

I did program a long long time ago back when basic was around and some html off and on over the years.

Everything electronic I want to do is for fun home projects and to expand my knowledge. As for making my own software or apps that is so I can make a freeware and/or shareware programs.


My first goal if I had to choose would be software programming followed by pic programming.


Anyway thanks again for the fast reply and help.
Ice

Depending on the PIC of your choice, you may possibly also use C++ with it (e.g. PIC32).

Since your GUI application and the microcontroller probably will communicate using a (virtual) serial port, if you are working on Windows, the easier approach would be using C# for GUI programming.
 
Share this answer
 
its basically the same concept but different syntax and other stuff, i suggest learning C first and once your good at it you would know c++ ina week or 2.

that is my opinion and im not making you do it,your choice.
good luck.
 
Share this answer
 
Comments
Icejet 5-May-21 18:37pm    
Hello,

Thanks for the fast reply and advice.

I will switch me learning to C then and after that do C++.

Thanks again for the help.
Ice
It is better to start with C and than C++ and GUI programming. It isnt so problematic because the most issues will explain you the compiler.
Start learning with some C tutorial and later use some framework your the GUI programming. Most used are MFC from Microsoft or Qt.

Take a serious look at Qt development tools.

Take the time to cleary structure your code with functions and structs in C and classes in C++.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900