Programming ATmega328P With explained mini 328P

Discussion in 'Embedded Systems and Microcontrollers' started by LightningWalrus, Jul 5, 2016.

  1. LightningWalrus

    Thread Starter New Member

    Mar 15, 2016
    26
    0
    Hello !

    I've got a standalone chip ATmega328P and this thing evaluation board Xplained mini 328P. I couldn't not find any documentation how do i program a standalone ATmega328P with Xplained mini 328P. Is that even possible ? If anyone has experience with those things i would be glad if someone told me how to do that.

    Thanks.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    LightningWalrus likes this.
  3. LightningWalrus

    Thread Starter New Member

    Mar 15, 2016
    26
    0
    As i understood i can program a stand alone chip by connecting ISP ports on Xplained mini to the respective pins of the microcontroller ?
     
  4. thumb2

    Member

    Oct 4, 2015
    66
    4
  5. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    There is a 6-pin header labeled ISP in the lower center of the board. That is where you connect the programmer (STK-500, AVRdude or whatever) and use AVRStudio to do the programming.
     
  6. LightningWalrus

    Thread Starter New Member

    Mar 15, 2016
    26
    0
    I didn't make it clear i guess. I want to use Xplained mini as a programmer to program a bare ATmega328P on the breadboard.

    Here i drew how i think it would work
    Xplained mini to 328P.jpg

    Basically same as i would use arduino uno to flash a chip on the breadboard

    [​IMG]
     
  7. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    I don't know if you can use the Xplained mini the way you want to. There is no real reason I can think of for doing it that way. If you put the IC on a board, and the board has the 6-pin header, you can use any Atmel programmer board to program the chip on the board. I suppose you could make a board with a ZIF socket and a 6-pin header and program all the loose parts you want.
     
  8. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,383
    495
    Papa, I know this will seem rude, but: Are you being dense on purpose?

    Lightning. I don't know if there is code to turn your board into programmer. You might be one of the first to do that. Check the datasheet on how to setup 328 chip to receive programming. The setup that is used in Arduino example is probably the same as the one in datasheet. Just double check and if it is, use it. As far as setting up your board. Like I said, you might be pioneering new territory. You already know that Arduino board can be used to program 328 chip. So study the program that is used on the Arduino board. Learn the function of each section of the code. Once you understand what Arduino code is doing, rewrite the code in the language that your board understand.
     
    LightningWalrus likes this.
  9. dannyf

    Well-Known Member

    Sep 13, 2015
    1,771
    358
    It should work. Compile the arduino ISP sketch into binary for a 328bboard, and figure out a way to burn it onto your xplain board. Make sure that the rest of the board is the same as the arduino board, like oscillator, pin loading, etc. Wire your xplain board up to the target and your PC, as if it is an arduino.

    The xplain now should function as an arduino to your PC.
     
    LightningWalrus likes this.
  10. dannyf

    Well-Known Member

    Sep 13, 2015
    1,771
    358
    Having said that, it seems a lot of work to say a couple bucks. Not worth it in my view.
     
  11. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    My posts may seem dense to you, but I have already said that I am not familiar with this new board. I also don't have any motivation to dig into it. I am telling you what I know: that the ATMega328P supports stand alone programming from a properly configured Atmel board such as the STK-500, STK-600, AVRDude and so forth via the 6-pin ISP interface. AVR Studio communicates with the programmer board and the programmer board communicates with the ATMega328P via the 6-pin interface.
     
  12. LightningWalrus

    Thread Starter New Member

    Mar 15, 2016
    26
    0
    Guys, here as i see it.

    Xplained mini mEDBG.jpg

    That thing at the top (ATmega32U4 and some components around it) seems to be the thing to program ATmega328P which is on the bottom side of the board. I guess that is what's called mEDBG (embedded debugger). I don't quite catch up with how they are wired together but i guess if I were to wire that thing on the top(ATmega32U4) to an ATmega328P on the breadboard then i would be able to program it. By the way, I didn't have to do any extra stuff to program ATmega328P on the Xplained mini board. I just plugged it to PC and could already debug it in Atmel Studio 7.
     
  13. dannyf

    Well-Known Member

    Sep 13, 2015
    1,771
    358
    You seem to be more interested in speculating what the board can do rather than knowing for sure what the board can do.
     
  14. LightningWalrus

    Thread Starter New Member

    Mar 15, 2016
    26
    0
    Because I was originally planning to program a standalone ATmega328P. I bought Xplained mini ecause i thought i could use it that way. Apparently it can only program a microcontroller on the Xplained mini itself. Now i feel passionate about finding a way to program a standalone chip with xplained.
     
  15. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    I would start by asking Atmel if there is a schematic of the board. In the past they have included schematics of other similar boards, which I have already mentioned, that I know for a fact can do what you require. I think it is highly likely that it can do what you require, you just have to verify that. Identifying which pins on the 6-pin ICSP connector are inputs and outputs will no doubt supply an answer with about a 95% confidence level. That is where I would start.
     
    LightningWalrus likes this.
  16. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,383
    495
    The whole Xplained thing does not make sense to me.

    Everytime you load a program into Arduino board, you are programming 328 chip on arduino board, you actually load the program into the flash memory on the 328 chip that is soldered to the pcb that makes your arduino board. So you program 328 on arduino board to program 328 chip on bread board.
     
  17. LightningWalrus

    Thread Starter New Member

    Mar 15, 2016
    26
    0
    Xplained programs 328 chip which is soldered onto the board and it's in SMD format i guess.
     
  18. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,383
    495
    Right. Arduino uses the same setup. They have ATmel ATmega16 act as USB decoder chip, it sits between pc and ATmega328 translates USB signal from PC to TTL signal to ATmega328, then when ATmega328 sends stuff to PC, it translates TTL signal from ATmega328 to USB signal and sends it on to PC.

    In conclusion. Your board plays the same role that Arduino board plays. You know that Arduino board is used to program naked ATmega328 chips. Therefore, your board should be able to do this job too. Obviously your board does not have the community support that Arduino has, if you want to use your board to program naked ATmega328 chips, you will have to do some work. Go do the work or wait for someone else to do it. The rest of discussion is waste of time.
     
    Last edited: Jul 7, 2016
    LightningWalrus likes this.
  19. LightningWalrus

    Thread Starter New Member

    Mar 15, 2016
    26
    0
    Totally agree !
     
Loading...