Using an xplained M328pb with Arduino IDE

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey guys, just started to play around with my M328pb xplained mini board, and thought I would try using it with the Arduino IDE.

I found board support using the boards manager, and see it in the ports menu, but when I try to upload "blinky" to it, it times out.

I'm guessing that I need to load an Arduino bootloader to it first, but wanted to confirm if anyone has tried this already.

If I do, I have an UNO I can use as an ISP, and again assume I can just do a burn bootloader from the IDE.

Any advise?

 

Jim

 

This topic has a solution.

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Fri. Oct 25, 2019 - 07:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should be able to do a “burn bootloader” using the mEDBG that us on the board, assuming you are using mincore, which contains 328pb bootloaders.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:
assuming you are using mincore,

Thanks for the hint, I'll check it out!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 thought I would try using it with the Arduino IDE.

Do you like it better than studio 7 ?   Haven't seen the other in 5 years or so, maybe it is better these days. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Arduino is much nicer for building a program, adding libraries, updating libraries,  changing Core, ...

 

Of course the "editor" is painful.   But you can use an external editor if you want.

 

The "advantage" of AS7.0 is that you can use debugWIRE.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tried to burn bootloader but get an immediate error:

Arduino: 1.8.10 (Windows 10), Board: "ATmega328, Yes (UART0), 328PB, BOD 2.7V, LTO disabled, 16 MHz external"

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\jim.c\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.3/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : stk500v2
Error while burning bootloader.
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)

avrdude done.  Thank you.

I installed minicore, selected minicore M328, 16MHz external, variant 328pb, port com8 xplained mini, and programmer: atmel mEDGB

Any ideas?

 

TIA

Jim

 

avrcandies wrote:
Do you like it better than studio 7 ?

It's not that one is better then another, just trying to get this to work.

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
Any ideas?
Is there any evidence of mEDBG in the USB drivers section of Windows device manager? IOW can Windows "see" the debugger at the time it attempts this?

 

Another approach is usbdeview.exe - can it "see" the device?

 

BTW I checked  http://www.linux-usb.org/usb.ids and found:

03eb  Atmel Corp.
	2104  AVR ISP mkII

so your avrdude output says it is looking for 03eb:2104 or, in other words, an avrispmkII - doe an mEDBG really masquerade (in terms of VID:PID) as such a thing? I can't help thinking it might be more likely to be:

	2141  ICE debugger

in which case the avrdude command issued to "burn bootloader" may be attempting to connect to the wrong kind of USB device.

Last Edited: Wed. Oct 23, 2019 - 04:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was hoping westfw would drop in again to tell me what I did wrong.

Anyway, I’ll try again this weekend.

jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Meh.  The "Atmel University France" page has documentation for setting up your Xplained board to use with Arduino here: https://github.com/AtmelUniversityFrance/atmel-avr-xmini-boardmanagermodule/wiki/01.-Preparing-atmega*-Xplained-mini-for-Arduino-IDE-use-(MS-Windows)

Basically: "use Atmel Studio to program the bootloader and fuses first."
For a semi-official "Arduino board", it looks pretty abandoned - links still point at Atmel.com :-(  We'll see if anyone responds to the "issue" I submitted for this.

 

Minicore doesn't seem to support the xplainedmini programmer, doesn't seem to have an option to limit the upload speed to 57600 (max practical "standard" bitrate for mEDBG), and doesn't have a 57600bps version of the bootloader...  :-(

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

Ok, use the attached optiboot_xplained328pb.txt file with a command (in a cmd.exe window) like:

 

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega328pb -cxplainedmini -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0xFC:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xE0:m -Uflash:w:optiboot_xplained328pb.txt:i

 

And then you should be able to use the "Atmel ATmega328pb Xplained mini" board type (from "Atmel University France") in recent Arduinos.

Your paths may vary.

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

smiley

Thanks!

Jim

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...