Re: [PIC] Learning C
Allen Mulvey <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.pic |
|---|---|
| Message-ID | <[email protected]> |
You are describing me. 12 or 14 years ago I spoke to a guy who used Arduino for exactly the same reasons why I did not use it. I didn't want to use some compromise board and have to fit all my projects to it. I made my own boards to my own specifications with the Pic micro-controller of my choice. But things change. I have completely gone over to "the dark side." Arduino now supports multiple micro-controllers and a vast number of dev boards. I still make my own boards but most do not host a micro-controller instead they host a small dev board (usually an ESP32-WROOM-32UE or ESP-32S) which provides USB and sometimes other features cheaper and much more easily than I could provide them. There is a vast amount of information available online for free. I tend to rely on https://randomnerdtutorials.com and other such sources. Yes, pointers in C can be hard to grasp but you can find a multitude of tutorials online. It took me a bit of time to find the right one for my mind to grasp but it is worth the search. Actually it isn't pointers that are hard to grasp. The notation for referencing or de-referencing can be confusing. (Do you want the value of the pointer or the value of the location it points to.) I studied Fortran 4 in college but my first real programming was with the Commodore-64. With a one meg clock assembler was the only language that did not run in super slo-mo. Originally I only used C to write small utilities much like people use Python today. My applications were written in OPAL, Object Paradox Application Language which I think has now gone the way of the Dodo. Now, I love C and would never go back to assembler. Allen Mulvey On 11/11/2024 8:53 AM, RussellMc wrote: > On Tue, 12 Nov 2024 at 02:12, David C Brown<[email protected]> wrote: > >> I must stress that I want to learn C as a desktop language before >> converting to PIC use.. >> Recommendations for a good book would be appreciated >> >> > At the risk of being cast into outer darkness (weeping, wailing, > gnashing of teeth, ...) > I'll have another try at mentioning Arduinos. > > Here is a PIC implementation > > https://www.instructables.com/Pinguino-Project-a-PIC-Microcontroller-Based-Ardui/ > > And here is a page that mentions several , but they me be somewhat more > arcane > > https://forum.arduino.cc/t/arduino-and-pic/868085 > > BUT Arduino using AVRs is an exceedingly useful extra string to a > multistring bow. > The complete hardware, software, IDE ... (& even the power supply) for your > first attempt will cost you under GBP10. > Possibly under GBP5. > They are exceedingly easy to try and MAy lure you to the dark side. > > You don't even have to load the "flash a LED" / hello world equivalent > code. Tey tend to have LED flash preloaded. > Powering? - connect via USB cable to a PC (Windows / Linux / Mac) > Software - download the latest IDE from here > https://www.arduino.cc/en/software > Examples? There are many dozens of include examples, starting with flas a > LED, read a button. > Plus ADC, DAC (PWM on many, true DAC on some), Serial, USB, SPI, ... . > Typical sensors interfacing. More > > In many cases you can use a p[remade "sketch" and tweak it as required. > A competent programmer can usually follow the code well enough without > extra input, and detailed tutorials are available. > > The system is not, of course, perfect and gets somewhat arcane and messy as > you start to do more complex things, but millions of people have walked the > same path and there is much advice easily avaialable. > > Something like youe=r data logger, if maybe not quite trivial, would be > extremely easy once you'd understood the basic system. > > This is an add on to other abilities and systems, but not one that should > be lightly ignored. (I claim :-) ). > > > Russell