Re: [PIC] Learning C

Spehro Pefhany <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.pic
Message-ID <[email protected]>
At 09:20 AM 2024-11-13, you wrote:
>Perhaps I need to rephrase my needs.
>
>I am a competent programmer and coding holds no fears for me.
>I have programmed in several languages and written some quite complicated
>programs in Pascal and Visual Basic.
>
>So  what I need  is to understand the syntax of the language - I have a
>copy of Kernighan and Ritchieand - and write few useful applications on my
>PC..
>Where I need real advice is on what IDE/compiler to use.  I am not averse
>to spending money on tsat


K&R, ANSI edition?

If you are only wanting to write C console apps for the PC, 
Embarcadero DevC++ is okay
- I switched to it when Turbo C executables would no longer run 
(still miss their
  extensions). I still reach for it when I want to write a quick < 
100 line program to
compute and pipe out a look-up table in C (or assembler, for that matter)
or something similar that isn't ridiculously easier in Python.


For an IDE, many, if not most, people would recommend VS Code (free) 
for programming in just
about any language on a PC, Mac or Linux (on a Raspberry Pi if you 
want). If you look for
tutorial videos  on YouTube they're likely to use VS Code. 
Eclipse/CDT (and Eclipse-based)
IDEs are also pretty common (eg. STM32Cube IDE for ST STM32 MCUs, and 
Mounriver IDE for
WCH RISC-V MCUs). The latter two make it easy to include middleware
libraries for things like FreeRTOS, lvgl (graphics), LwIP etc. as 
well as configure the
complex clock trees used in modern chips and tedious things like 
route and initialize IO.
(of limited value to you right now if you just want to play with generic C)

Whatever your target, unless it's something pretty resource-starved, 
the compiler will probably
be gcc and free. The same compiler front end for a PC or for an ESP32.

For the highest code density and performance there are (expensive) compilers
and IDEs such as Rowley, IAR, Keil, and Microchip's XC compilers 
which may be worth it in
specific situations.

I'm guessing you're not big on command line tools since you're asking 
about IDEs.

TL;DR: Get VS Code (any major platform) and follow tutorials or 
guided projects for setup and
Hello World (or blink), then move on once it works,  or grab 
Embarcadero DevC++ (PC only),
select "New Project" "Console Application" "C language", and grab your book.


Best regards,
Spehro Pefhany
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.