Programming ATmega328P With explained mini 328P

Thread Starter

LightningWalrus

Joined Mar 15, 2016
26
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.
 

Thread Starter

LightningWalrus

Joined Mar 15, 2016
26
As is almost always the case, the answer is in the datasheet. You should be able to do this for yourself.

http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf

Read §28.8 on p. 294 for the easy serial method. Read the previous sections for the more inclusive parallel methods.
As i understood i can program a stand alone chip by connecting ISP ports on Xplained mini to the respective pins of the microcontroller ?
 

Papabravo

Joined Feb 24, 2006
12,383
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.
 

Thread Starter

LightningWalrus

Joined Mar 15, 2016
26
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.
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

 

Papabravo

Joined Feb 24, 2006
12,383
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.
 

shteii01

Joined Feb 19, 2010
4,667
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.
 

dannyf

Joined Sep 13, 2015
2,196
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.
 

dannyf

Joined Sep 13, 2015
2,196
Having said that, it seems a lot of work to say a couple bucks. Not worth it in my view.
 

Papabravo

Joined Feb 24, 2006
12,383
Papa, I know this will seem rude, but: Are you being dense on purpose?
...
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.
 

Thread Starter

LightningWalrus

Joined Mar 15, 2016
26
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.
 

dannyf

Joined Sep 13, 2015
2,196
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 boar
You seem to be more interested in speculating what the board can do rather than knowing for sure what the board can do.
 

Thread Starter

LightningWalrus

Joined Mar 15, 2016
26
You seem to be more interested in speculating what the board can do rather than knowing for sure what the board can do.
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.
 

Papabravo

Joined Feb 24, 2006
12,383
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.
 

shteii01

Joined Feb 19, 2010
4,667
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.
 

Thread Starter

LightningWalrus

Joined Mar 15, 2016
26
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.
Xplained programs 328 chip which is soldered onto the board and it's in SMD format i guess.
 

shteii01

Joined Feb 19, 2010
4,667
Xplained programs 328 chip which is soldered onto the board and it's in SMD format i guess.
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:
Top