News:

Let's find out together what makes a PIC Tick!

Main Menu

Arduino questions - please don't laugh at my ignorance :)

Started by trastikata, Feb 03, 2024, 12:43 PM

Previous topic - Next topic

trastikata

Decided to take a look at this Arduino thing and I am quite confused, so I have few questions I decided to ask since I can't make head nor tail from what I find in the internet resources. As the title says, please stay positive towards my ignorance in this topic. :)

- As I understand the Arduino's can be made from variety of Atmel (now Microchip) MCU's?

- So Arduino - is it the programming environment or the programming language - but I understand it is C?

- Do you need a ICSP programmer or there is a Bootloader in every chip - if so, then Arduino is actually the Bootloader and the flashing program?

- It doesn't make sense to me to put a small package MCU (with couple of basic external components) on a large DIL PCB socket and then start building your device around this large PCB?

- If you know how to build around that large PCB (Shield or whatever it is called) you can use DIP or SPDIP MCUs and build it the proper way?

- Why so many projects requiring advanced programming, technological and datasheet knowledge and understanding (for example drones, RC models, video and audio projects), seemingly made by knowledgeable people, are done with Arduino boards which compromise the program speed and the hardware design optimization?

Anyway, I am trying to understand the appeal in so many people of using this bulky and complex programming thing called Arduino.

david

I feel much the same way about Arduino but I think the attraction for it comes down to two things.

1.  You get a fairly stroppy chip at low cost that is breadboard and Veroboard ready.
2.  There's a vast library available to do almost anything so nobody really programs - they just bolt a whole mess of anonymous include files together.

Often the programs are quite verbose with little or no optimising for the intended application as this would require delving into the actual structure of the include files and this seems to be very much a last resort.  Sort of Lego programming....

RGV250

Hi,
As far as I am aware it is only for certain IC's.

It uses a bootloader but the same as PIC's you need to load that first if you have a bare device which would require ICSP.
I believe you can buy the chip with bootloader from various sellers.

As far as I am aware it is "messed" up C. Probably not allowed to put the word I would normally use.

The problem I have found the programs seem to use a lot of undocumented calls which makes it difficult to understand, it is also virtually impossible to merge programs (at least I find that).

The compiler/loader is a real piece of crap which throws up some really unhelpful messages if it fails to compile/load.

Bob

I use it for getting devices that there is a library for to make sure it first works and then try to convert it over to Positron where I then know how to modify it.

Wimax

Hello,

Leaving aside performance or integrability in a custom project, it is an environment that, thanks to an infinite number of libraries, allows small systems to be realised with just "a few lines" of C.
Many libraries correspond to as many devices that can be used, some of them quite well realised, I am referring to displays, sensors of various kinds, etc.
Personally, I have often had to spend time getting devices designed for Arduino to work with PIC24/DS33 devices only because they were accompanied by very poor documentation, but not the ever-present Arduino library!  ;)

tumbleweed


Wimax

Yes, that's true. The glitch is a good indicator of how little I know about Arduino compared to the ecosystem around it  ;D

trastikata

Is it to understand that Arduino is the Atmel's equivalent for AVR chips as is Microchip's MPLAB X to PICs?


flosigud

Atmel has its own compiler that is better than Arduino.

Dompie

With Arduino you can load all kinds of other processor boards via the board manager. There are already plugins for the ESP8266, ESP32 and STM32, but there are probably more plugins for other processors. So you can use the Arduino IDE to develop processors for AVR, but also for the aforementioned processors. As far as I know there is NO PIC plugin available. The board manager is of course also used to board specific suppliers such as AdaFruit and Sparkfun, but also M5Stack to name a few.
If you Google you will find a lot of information but nowhere a list of possible suppliers (as far as I could find)

But beware, there is an incredible amount of libraries in circulation for Arduino, but in general the quality is not high (even very low) and if you want to use something like that, you often have to troubleshoot someone else's library and that is difficult and time-consuming, especially if you are not an accomplished Arduino C++ programmer. So I stayed with Positron because here on the forum the quality of the software and the comments from the members are of a much higher level than most in the Arduino world.

Johan

normnet

What about the Arduino IDE's?  My search was limited however none I saw seemed to include much in the way of text editing features.

Stephen Moss

#10
Quote from: trastikata on Feb 03, 2024, 12:43 PMDecided to take a look at this Arduino thing and I am quite confused, so I have few questions I decided to ask since I can't make head nor tail from what I find in the internet resources. As the title says, please stay positive towards my ignorance in this topic. :)

- As I understand the Arduino's can be made from variety of Atmel (now Microchip) MCU's?
Yes, there are different versions and each version tends to use a different microcontroller. But be aware that being essentially a cheap children's toy means that the Arduino people have limited what certain pins can be used for, so for an experienced microcontroller programmer that may read the device data sheet it can create problems in that perfectly good code can appear to be not working because of that. Unfortunately, the only fix is to modify the files they supply with the IDE and keep a copy safe in case they are overwritten by an update.

Quote from: trastikata on Feb 03, 2024, 12:43 PM- So Arduino - is it the programming environment or the programming language - but I understand it is C?
Neither, Arduino is essentially brand name that covers both their various versions of basically a Microcontroller Motherboard with USB-PC interface, Shields (Daughterboard) and their programming IDE, which uses some version of C.


Quote from: trastikata on Feb 03, 2024, 12:43 PM- Do you need a ICSP programmer or there is a Bootloader in every chip - if so, then Arduino is actually the Bootloader and the flashing program?
I presume there must be a bootloader pre-programed into the device mounted on the Arduino boards as you connect the board to your PC via USB cable, select the board type and com port it is connected to from the IDE and it is programmed via the Arduino IDE.

Quote from: trastikata on Feb 03, 2024, 12:43 PM- It doesn't make sense to me to put a small package MCU (with couple of basic external components) on a large DIL PCB socket and then start building your device around this large PCB?
Remember that Arduino is designed to be simple to use as it is made for hobbyists to get and quick and easy start, not for serious use, so considering that is its purpose there is some logic to mounting it on a DIL based PCB so that it can be easily integrated into a large finished PCB via and DIL socket or plugged into a bread board for prototyping.

Quote from: trastikata on Feb 03, 2024, 12:43 PM- If you know how to build around that large PCB (Shield or whatever it is called) you can use DIP or SPDIP MCUs and build it the proper way?
Again you have to consider who Arduino's are aimed at, which is not someone with good electronics and Microcontroller programming knowledge, there are meant to be plug and play, if you want drive motors, Bluetooth and LCD then you just buy the applicable Shield (daughterboard) plug it into your Arduino "Motherboard", and program, no design work to do.

Quote from: trastikata on Feb 03, 2024, 12:43 PM- Why so many projects requiring advanced programming, technological and datasheet knowledge and understanding (for example drones, RC models, video and audio projects), seemingly made by knowledgeable people, are done with Arduino boards which compromise the program speed and the hardware design optimization?
Probably because an Arduino PCB is cheaper and easier then building it yourself, and if they do know their stuff either don't mind the inefficiencies or ignore using the Arduino commands set for writing their own faster code.
Then again, it could be that the whole point of Arduino is to make it simple for those less knowledgeable about such things to produce something that looks like they are more knowledgeable than they are, but as you say it likely comes at the cost of code efficiency.

Quote from: trastikata on Feb 03, 2024, 12:43 PMAnyway, I am trying to understand the appeal in so many people of using this bulky and complex programming thing called Arduino.
Again it comes back to being able to create something with little or no knowledge of electronics, Microcontrollers and Microcontroller programming as there are numerous (albeit often not well written) libraries and examples on the web in conjunction with predesigned Shields that can potentially enable someone to do in a few hours what they may otherwise never be able to do.

Quote from: Dompie on Feb 03, 2024, 07:35 PMBut beware, there is an incredible amount of libraries in circulation for Arduino, but in general the quality is not high (even very low) and if you want to use something like that,
I agree, you can use them if you want but because the Arduino is geared towards those with little or no Microcontroller or other programming knowledge you have to consider it is those same people who are writing many of the third party libraries many and example codes available on line so while they may work (at least on a basic level) to get you going the coding of them is likely to be bloated and inelegant.

Quote from: normnet on Feb 04, 2024, 09:38 PMWhat about the Arduino IDE's?  My search was limited however none I saw seemed to include much in the way of text editing features.
It depends on what you are looking for, if you are using Visual Studio already then it may be worth taking a look at VisualMicro, as you get all the editing features Visual Studio has. As I recall you get a 30 day trial then I think it is £30.
I did try it and preferred it to the Arduino IDE but that may just have been because it allowed me to use a familiar IDE and colour scheme. However, you still need to an Arduino IDE of some kind installed and are thus reliant on the compiler and programming language it uses as VisualMicro is essentially a front end and needs files that come with your Arduino IDE of choice for Compilation and uploading the program to the Arduino PCB.