Connect with us

***A stupid question maybe?! --- When you purchase a microcontroller

Discussion in 'Microcontrollers, Programming and IoT' started by Henri17, Jan 16, 2017.

Scroll to continue with content
  1. Henri17

    Henri17

    13
    0
    Jan 16, 2017
    Hi all,

    Imagine you go to an electronic parts store and you buy a micro-controller lets say an "Atmega328p". Is this chip raw without code or has a bootstrap in it?

    What I guess is that this micro comes raw and I need a flasher to put bootstrap in it for the first time.

    Not to mention that when you purchase an Uno Arduino it comes with an Atemga328p which is already flashed and all you need is simply use Arduino IDE and a USB cable to upload your own code.

    This says that the bootstrap is already loaded in the chip. Am I right?

    Would you please share your experience if you have already built a minimum system? I would like to discuss more about the details if possible! :)
     
  2. OBW0549

    OBW0549

    157
    117
    Jul 5, 2016
    Correct.

    Yes.

    I've been building systems with microcontrollers since the mid-1970s beginning with the Intel 4040, and have used many different microcontrollers since then, most recently Microchip's dsPIC33EPxxx series. Every one has its own unique features, depending on the mission. What is it that you want to know?
     
  3. Henri17

    Henri17

    13
    0
    Jan 16, 2017
    Thank you for your prompt reply. Then, this is like what exactly I was thinking! I started this topic to simply bring up the ideas of building a minimum system with micros as you said. Therefore, do you mind if I bug you later on and ask you hardware questions?

    Basically what I need to know is how to make my own Arduino! I watched the following video and found out that should not be a difficult project. You need to read through the micro's manual and have your own version of PCB eventually!




    I used a MAcbook and also a WIN XP 32bit laptop. However, I rather using my Mac or having a VMWARE on my Mac to have access to WIN 7! So as for this, what PCB maker or simulator do you recommend me to use? Would you use Protel? or any products from NI perhaps?
     
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,500
    2,840
    Jan 21, 2010
    I've build a number of small boards which consist of a an ATMega328, a 6 pin header and whatever else is required for power and the interface.

    If it's being operated from a suitable voltage, then aside from any interface stuff, that's all you need. You can set up the chip to use the internal RC oscillator, so no need for a crystal.

    see here.
     
  5. Henri17

    Henri17

    13
    0
    Jan 16, 2017
    Ok cool! Firmware-wise, would you please tell me, what equipment did you use to load the bootstrap to your micro? Did you use a programmer or you used ISP pins of another Arduino to flash the Atmega?
     
  6. OBW0549

    OBW0549

    157
    117
    Jul 5, 2016
    I'll help if I can; just post your questions in these forums.

    Can't help you much there, as I've never worked with AVR micros and have only played around with Arduino a little bit.

    I've never used any PCB makers nor have I ever used Protel or any NI products. For simulation I use Microchip's MPLAB IDE for the PIC micros (which is all I work with these days), and for analog simulation I use SPICE.
     
    Minder likes this.
  7. Henri17

    Henri17

    13
    0
    Jan 16, 2017
    Ok cool then. For PIC questions or general question of making minimum systems with micro, I will bug you! Many thanks!

    BTW, Would you please let me know what did you use to program your PIC micro? What equipment did you use to upload the bootstrap? Is there a specific hardware and software do I need to have for such purposes?
     
  8. OBW0549

    OBW0549

    157
    117
    Jul 5, 2016
    Keep in mind that I'm far from the only person here with experience using PICs; many, MANY others have, as well. Just post your questions in the forums and people will answer.

    I use Microchip's MPLAB integrated development environment, along with their PICKIT3 debugging/programming pod. MPLAB (which has been "improved" and it now called MPLAB-X) is a free download at the Microchip website, and the PICKIT3 is also available from them and from multiple distributors, for about $50.

    I don't ever bother with a bootloader; I just load the application code directly into the target via ICSP, using the software/hardware noted above.

    See above.
     
  9. Henri17

    Henri17

    13
    0
    Jan 16, 2017
    No worries! I will post my questions and let everyone answer to them. But your comments and feedback are greatly appreciated as well.


    I use Microchip's MPLAB integrated development environment, along with their PICKIT3 debugging/programming pod. MPLAB (which has been "improved" and it now called MPLAB-X) is a free download at the Microchip website, and the PICKIT3 is also available from them and from multiple distributors, for about $50.

    So, this tells me that PIC is slightly different than Atmega as I need to load the firmware to it first. Is that right?

    See above.
     
  10. Henri17

    Henri17

    13
    0
    Jan 16, 2017

    I guess I was mistaken! you used ICSP to load your bootstarp for the first time. But it is confusing when you said you did not use bootload!
     
  11. Minder

    Minder

    3,149
    680
    Apr 24, 2015
    I use PicMicro and MPLB IDE and the ICSP is used to load the application program only via Pickit3.
    M.
     
  12. OBW0549

    OBW0549

    157
    117
    Jul 5, 2016
    No.

    Bootloader firmware-- whether for PIC or AVR or any other microcontroller-- is only needed in cases where one wants to be able to load the application code via a conventional serial port. Note that the Arduino provides ICSP connections as well, and these are used in the same manner as what I described for the PIC, as an alternative to going through the bootloader via the serial port.

    Bootloaders are an optional convenience, not an essential feature.
     
    Last edited: Jan 16, 2017
  13. Henri17

    Henri17

    13
    0
    Jan 16, 2017
    Ok here is the question: while using ICSP. Did you use another complete system with PIC to program your own PIC? In other words in order to program an In-System chip we do so. Right? (with SMD not DIP chip)
     
  14. OBW0549

    OBW0549

    157
    117
    Jul 5, 2016
    NO!!

    I load the actual target code directly via ICSP, and no bootloader (or "bootstrap", if you will) is EVER involved.
     
  15. OBW0549

    OBW0549

    157
    117
    Jul 5, 2016
    NO!!

    No secondary system w/ PIC is involved. I do it EXACTLY as I described above in post #9.
     
  16. Henri17

    Henri17

    13
    0
    Jan 16, 2017
    OK, then just to verify and make sure that I understood well, you uploaded the application using the second PIC via ICSP pins and code itself via MPLABX Software?
     
  17. OBW0549

    OBW0549

    157
    117
    Jul 5, 2016
    There is no "second PIC". The PICKIT3 debug/programming pod is plugged into an ICSP connector on your target board; your PC or Mac is connected to the PICKIT3 via a USB cable; and the MPLAB development system operates the PICKIT to load your application into your target. It really is as simple as that.

    One more time: NO SECOND PIC, NOR ANY BOOTLOADER, IS INVOLVED.
     
    Arouse1973 likes this.
  18. Henri17

    Henri17

    13
    0
    Jan 16, 2017
    Umm.. sounds straight forward. But to me to understand it better I need to get my hands dirty! It would be more tangible if I do it myself!
     
  19. Henri17

    Henri17

    13
    0
    Jan 16, 2017
  20. OBW0549

    OBW0549

    157
    117
    Jul 5, 2016
    No, it's not JTAG. The PICKIT3 (or any other Microchip ICSP programming device) communicates using a simple proprietary protocol with a small dedicated hardware block inside the PIC which performs the actual programming.

    In any case, that's not a detail you need to be concerned with.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-