some general questions about Arduino prototyping

Hi,

I have never worked with Arduino before and wanted to clarify few points. I'd appreciate it if you could help me.

Question 1:
I understand once you are done with your prototyping and want to move to actual micro-controller, you can install Arduino bootloader onto the micro-controller chip and then burn the program you previously wrote in Arduino IDE, as is shown in this video.

Can you use the Arduino shields with the micro-controller directly without any additional interface circuitry?

Question 2:
This web page says, "Shields for Arduino typically use the Arduino Uno R3 footprint."

Is the statement generally true?

Would it mean that a shied which has been designed for Arduino Mega cannot be used with Arduino Uno?

Thank you!

Can you use the Arduino shields with the micro-controller directly without any additional interface circuitry?

Shields plug directly into the Arduino board, usually a Uno or Mega so, by definition, you do not need any additional interface circuitry. If you are intending to use shields with a standalone micro controller than you will, of course, need to provide the same footprint of sockets as the Uno/Mega if you want to plug the shield into your hardware. However, do not confuse shields, which plug in directly, with modules that use connecting wires.

"Shields for Arduino typically use the Arduino Uno R3 footprint."
Is the statement generally true?

Yes

Would it mean that a shied which has been designed for Arduino Mega cannot be used with Arduino Uno?

The Mega has extra pins and there may be shields that use some of them. If so, they would not work with the Uno

painterguy:
Can you use the Arduino shields with the micro-controller directly without any additional interface circuitry?

If you want to use a shield then the simplest thing is to use it with the Arduino board it is designed for. I can't see any advantage in building your own micro-controller if you need to use a shield.

Conversely, this may be a good reason for not using a shield in the first place. The only shield I have is a RAMPS shield for a Mega - it is a convenient way to connect stepper motor drivers. And in fact I have never used it - I had visions of "upgrading" a newly arrived 3D printer but it has worked excellently with the original electronics so "don't fix it if it works"

I have built several boards with Atmega 328 micro-processors when I wanted something that the standard Uno does not provide - for example 3v operation for a wireless remote control or a convenient way to connect servos. I have also used regular Megas where that seemed the simplest solution. In many ways the Mega has become my basic Arduino.

...R

UKHeliBob:
Shields plug directly into the Arduino board, usually a Uno or Mega so, by definition, you do not need any additional interface circuitry. If you are intending to use shields with a standalone micro controller than you will, of course, need to provide the same footprint of sockets as the Uno/Mega if you want to plug the shield into your hardware. However, do not confuse shields, which plug in directly, with modules that use connecting wires.

Thank you!

Personally, I would prefer to use modules which use connecting wires so that later I could move to standalone micro-controller without using any Arduino board. Do the shields have their equivalent versions in forms modules as well?

Thanks for your time!

Thank you.

Robin2:
If you want to use a shield then the simplest thing is to use it with the Arduino board it is designed for. I can't see any advantage in building your own micro-controller if you need to use a shield.

What if someone wants to move to actual circuit without the need for any Arduino board.

Robin2:
Conversely, this may be a good reason for not using a shield in the first place.

Wouldn't it take too much time if one is not using shields during prototyping phase? In my opinion, during prototyping you want to look at the project from high level without delving too much into building and customizing circuitry. Once you are satisfied, you can move to later stage of customizing. Do I make sense?

Thanks for your time.

You will have to search; the modules are usually called break-out boards.

You can also directly prototype using e.g. Nanos, a little Nano shield with screw connectors (no unreliable breadboard connections) and modules.

Nano screw shield example

Proto boards examples

I never bothered with shields for prototyping but I also never moved off of a uC board completely. My projects use nano or esp32 boards and I build pin headers into my pcb to accept them. That way I can work on programming a blank uC and simply insert it into my project to replace the old one with new functionality. This is useful if the projects are remote and you don’t want to bring a computer and update things locally. In essence my projects are just custom shields. I did plan and design with the atmega chip but it was a load of extra work and wasn’t really any smaller overall.

I prototype with the uC on a breadboard and then add the lowest level equivalent of a component. You don’t need fully functioning modules for prototyping you just need an equivalent input or output. LEDs are useful indicators of output. Potentiometers are good for inputs.

The modules or shields are the things I don’t want in standard form. They are bulky and a bit chaotic when multiple are used. Better to recreate them all into one board IMO like a custom shield

painterguy:
What if someone wants to move to actual circuit without the need for any Arduino board.

Why would anyone want to move to a DIY circuit if the Arduino board would be more convenient?

Wouldn't it take too much time if one is not using shields during prototyping phase?

It depends on what you mean by prototyping. If I was testing a design with external hardware that was different from my planned final choice I would consider it experimenting rather than prototyping. To my mind a prototype is as nearly as possible the same as the final design.

To be honest I don't think shields save much time compared with separate modules if you are confident about connecting things.

Shields can also prevent access to other features of an Arduino board or may use some I/O pins that you might wish to use for another purpose. I suspect most shields have been designed without any thought to their use alongside other external components.

...R

There are many ways to go from an Arduino board to something custom.

You can use a Promini as the heart of your new system, plugging in an FTDI Basic for downloading code and debugging, then removing it when done. And adding other 'components' around it, such as shields that you connect with discrete wires, or other chips, or other modules that do not have the shield footprint.
For example, here's is a ProMini, an RF transmitter, and a keypad wired up as an RF remote control.

You can recreate the guts of the Arduino on perfboard, it's just a chip, crystal, few caps and a resistor, and make your own board. You can see the base components at the lower left here.

You can go from that to a PCB. Here you can see the '328P at the bottom middle.

You can treat a shield, or any other module, the same as any other IC and wire them into your circuit the same way.

@sterretje Thank you!

pmagowan:
LEDs are useful indicators of output. Potentiometers are good for inputs.

The modules or shields are the things I don’t want in standard form. They are bulky and a bit chaotic when multiple are used. Better to recreate them all into one board IMO like a custom shield

Thank you. I agree with you but I think to begin with using shields is not a bad idea. Once you understand the system better, you can finalize the design using custom approach. If you are a student, you can use Arduino board and shields to implement a robot system and see how it works, modify it and add more feature. Once you are satisfied and want more thorough understanding, then you can start implementing your robot system using custom created circuits or modules and get rid of those stacked shields.

Robin2:
It depends on what you mean by prototyping. If I was testing a design with external hardware that was different from my planned final choice I would consider it experimenting rather than prototyping. To my mind a prototype is as nearly as possible the same as the final design.

Thank you. I agree with you about the "experimenting".

Robin2:
To be honest I don't think shields save much time compared with separate modules if you are confident about connecting things.

Shields can also prevent access to other features of an Arduino board or may use some I/O pins that you might wish to use for another purpose. I suspect most shields have been designed without any thought to their use alongside other external components.

I'm going to repeat what I said above. I think to begin with using shields is not a bad idea. Once you understand the system better, you can finalize the design using custom approach. If you are a student, you can use Arduino board and shields to implement, say, a robot system and see how it works, modify it and add more features. Once you are satisfied and want more thorough understanding, you can start implementing your robot system using custom created circuits or modules and get rid of those stacked shields.

CrossRoads:
There are many ways to go from an Arduino board to something custom.

You can use a Promini as the heart of your new system, plugging in an FTDI Basic for downloading code and debugging, then removing it when done. And adding other 'components' around it, such as shields that you connect with discrete wires, or other chips, or other modules that do not have the shield footprint.

Thanks. But it looks like all shields, at least majority of them, do have a footprint which sits on top of Arduino board.

In the past I have used PIC18F micro-controller with C language. Though it has been a while, I can still remember the details if I have to.

Question 1:
I have this development board, Microcontroller board for hobbyist and students base using Microchip Pic32 technology which is fully compatible with Arduino; compatible both in terms of software and hardware with Arduino. The mentioned development board is based on Arduino Uno and uses PIC32 micro-controller. My friend had it and he is going to give it to me for free. Do you think this board is good choice. I plan to make a simple wheeled robot.

Question 2:
I have done basic programming in C++ and also used C. Is Arduino language too much different from C? Can I simply use C instead of Arduino language? What would you recommend?

Question 3:
The mentioned development board, uC32, uses 3.3V logic level? I have read that Arduino Uno supports 5V logic level. Would it create issues in the long run?

Thanks a lot for your help and time!

I have done basic programming in C++ and also used C. Is Arduino language too much different from C? Can I simply use C instead of Arduino language? What would you recommend?

There is no such thing as the "Arduino language". The Arduino IDE uses C++

If you want to depart from the Arduino setup()/loop() code format then you can use plain C or C++ by providing your own main() function which, in the Arduino environment is hidden from the user, but is still there

painterguy:
I’m going to repeat what I said above. I think to begin with using shields is not a bad idea. Once you understand the system better, you can finalize the design using custom approach. If you are a student, you can use Arduino board and shields to implement, say, a robot system and see how it works, modify it and add more features.

I don’t disagree with that, though I think you may find that you are overestimating the convenience of shields. However I see that as the learning or experimenting phase rather than prototyping.

…R

painterguy:
I agree with you but I think to begin with using shields is not a bad idea.

This sounds fine, but the range of shields is really not that wide, and it is amazing how a store-bought simply doesn't do what you want. For instance, I have never seen a clock shield with anything other than a DS1307 on it, and I have never seen a Mega-specific shield. There are plenty of shield proto-boards though, and you can mix them in with store-bought, some of which are indeed no-brainers. I have never made a custom board though - no need, and I'm not aware of a click-in Mega anyway.

That UC32 looks and walks reasonably like a Uno but, while the price is right, its quack may put you at a disadvantage. I would be suss, as every Uno shield I know of is 5v - for obvious reasons. If there are compatible shields for the UC32, you may find you are being held by the short and curlies with the price. That thing costs more than a Mega.

Nick_Pyner:
... and I have never seen a Mega-specific shield.

What about all the TFT shields?

(Groan) Indeed. I even have one. Aren’t they obsolete these days? (Not that that’s an excuse)

And then, just minutes ago I saw this

UKHeliBob:
There is no such thing as the "Arduino language". The Arduino IDE uses C++

If you want to depart from the Arduino setup()/loop() code format then you can use plain C or C++ by providing your own main() function which, in the Arduino environment is hidden from the user, but is still there

Thanks a lot for the confirmation. It's nice to know that Arduino uses C++ with only addition of setup() and loop(). Once I start working with Arduino, I will try to figure out how to avoid setup() and loop().

Robin2:
I don't disagree with that, though I think you may find that you are overestimating the convenience of shields. However I see that as the learning or experimenting phase rather than prototyping.

...R

I agree with you that it's rather an experimenting or learning phase. In the context of our discussion, prototyping phase comes after experimenting/learning phase and one can try to do custom circuits and get rid of unnecessary shields.

Also, you are right that I might be overestimating the convenience of shields. The reason being that I have never used Arduino or any shield so far.

Nick_Pyner:
That UC32 looks and walks reasonably like a Uno but, while the price is right, its quack may put you at a disadvantage. I would be suss, as every Uno shield I know of is 5v - for obvious reasons. If there are compatible shields for the UC32, you may find you are being held by the short and curlies with the price. That thing costs more than a Mega.

The following excerpt is from the reference manual of uC32: https://reference.digilentinc.com/reference/microprocessor/uc32/reference-manual

The uC32 is the same form factor as the Arduino Uno board and is compatible with Arduino shields.
[...]
3.3 5V Compatibility
The PIC32 microcontroller operates at 3.3V. The original Arduino boards operate at 5V, as do many Arduino shields. There are two issues to consider when dealing with 5V compatibility for 3.3V logic. The first is protection of 3.3V inputs from damage caused by 5V signals. The second is whether the 3.3V output is high enough to be recognized as a logic high value by a 5V input.

The digital I/O pins on the PIC32 microcontroller are 5V tolerant. The analog capable I/O pins are not 5V tolerant. To provide 5V tolerance on those pins, the uC32 contains clamp diodes and current limiting resistors to protect them from 5V input voltages. The fact that all I/O pins are 5V tolerant means that it is safe to apply 5V logic levels to any pins on the board without risk of damaging the PIC32 microcontroller.

The minimum high-voltage output of the PIC32 microcontroller is rated at 2.4V when sourcing 12mA of current. When driving a high impedance input (typical of CMOS logic) the output high voltage will be close to 3.3V. Some 5V devices will recognize this voltage as a logic high input, and some won’t. Many 5V logic devices will work reliably with 3.3V inputs.

The quoted text above is saying that some shields would works and others won't. I'm not sure to what extent this is true that 5V shields could work with 3.3V logic level of uC32. I believe anyone who has used uC32 or any related development board could confirm this.

Also I find the following quoted text is from an old thread, https://forum.digilentinc.com/topic/1903-uc32-shield/?do=findComment&comment=6454

Aside from these chipKIT shields the uC32 was designed to have the same shield pin out as the Arduino Uno therefore all compatible Arduino Uno shields should also fit on the uC32. The issue with this approach is that there will be no libraries readily available for the uC32 so you will either have to write your own libraries or port them over.

I couldn't understand the part in bold. Could you please help me with it?

Thank you all of you for your help and time!

Helpful link:
https://learn.sparkfun.com/tutorials/logic-levels/all

I don't know anything about the UC32 apart from what I have read on this Thread.

To my mind if you want to work with the Arduino system you should start with a "regular" Aduino board such as an Uno or Mega - or nano if you want the small form factor and pins rather than sockets.

Using a "strange" board will IMHO just introduce more complications. For example, with an Uno if something doesn't work you will be wondering if it's your software or the way things are connected. With a "strange" board you will also be wondering if it's a problem with the design or specifications of the board - and there will be very few people on this Forum with experience of the UC32 board from whom to get advice.

If you have a free UC32 I suggest putting it to one side and developing your project with a regular Arduino. When it works then you can see if it will also work with the UC32.

...R

From the uC32 reference manual:

The uC32 can be programmed using the Multi-Platform Integrated Development Environment (MPIDE), an environment based on the original Arduino IDE modified to support PIC32. It contains everything needed to start developing embedded applications. In addition, the uC32 is fully compatible with the advanced Microchip MPLAB® IDE and the PICkit™ 3 in-system programmer/debugger.

So not the Arduino IDE, but something derived from it.

painterguy:
I couldn't understand the part in bold. Could you please help me with it?

It sounds like it's just not using the Arduino environment. I suggest that you install that specific IDE and try out what works; e.g. digitalWrite, digitalRead, millis, etc. If that works, there is some hope. But libraries that make use of conditional compilation based on processor will need to be rewritten.

=====
If you want a 32bit processor and the convenience of the Arduino IDE, I would suggest that you go for a Due (Mega form factor) or one of the newer boards like MKR.