background image

4.

If the source contains fuse settings, go to 

Production file

 and upload the .elf file and program the

fuses.

Note: 

 If ISP programming fails it could be because the debugWIRE is enabled. See 

debugging section

on how to disable debugWIRE mode.

1.6.2. 

Debugging the ATmega328PB Xplained Mini by using mEDBG

1.

Start 

Atmel Studio

.

2.

Connect the mEDBG USB to the PC.

3.

Open your project.

4.

In the 

Project

 menu select the project properties page. Select the 

Tools

 tab and select mEDBG as

debugger and debugWIRE as interface.

5.

In the 

Debug

 menu click 

Start Debugging and Break

.

6.

Atmel Studio will display an error message if the DWEN fuse in the ATmega328PB is not enabled,
click YES to make Studio set the fuse using the ISP interface.

7.

A debug session is started with a break in main. Debugging can start.

8.

When exiting debug mode select 

Disable debugWIRE and Close

 in the 

Debug

 menu, this will

disable the DWEN fuse.

Note: 

 If the debug mode is not exited by selecting 

Disable debugWIRE and Close

 in the 

Debug 

menu,

the DWEN fuse will be enabled and the target will still be in debug mode, i.e. it will not be possible to
program the target by using the SPI (ISP) interface.

Atmel AT08401: Getting Started with Atmel ATmega328PB [APPLICATION NOTE]

Atmel-42482A-Getting-Started-with-ATmega328PB_AT08401_Application Note-08/2015

10

Содержание ATmega328PB Xplained Mini

Страница 1: ...d microcontroller Features Getting started with the ATmega328PB microcontroller and tools Getting started with Atmel ATmega328PB Xplained Mini Kit and Atmel Studio 6 2 This application note contains a...

Страница 2: ...ard Identification of Xplained Mini Kit 8 1 5 2 Connect the ATmega328PB Xplained Mini UART to the mEDBG COM Port 9 1 6 Programming and Debugging 9 1 6 1 Programming the ATmega328PB Xplained Mini by us...

Страница 3: ...C oscillator Security with fuses and lock bits Atmel QTouch Library support Compatibility between devices portability Peripheral touch controller Clock Failure Detection CFD Note For detailed informat...

Страница 4: ...ize number of peripheral channels number of I O pins etc for this device can be found http www atmel com devices ATMEGA328PB aspx tab parameters Atmel AT08401 Getting Started with Atmel ATmega328PB AP...

Страница 5: ...tions tab the recommended application areas not limited to for this device can be found http www atmel com devices ATMEGA328PB aspx tab applications In the Tools tab all the related tools like IDE pro...

Страница 6: ...In the Documents tab all the kit related documents like schematics and user guide can be found Atmel AT08401 Getting Started with Atmel ATmega328PB APPLICATION NOTE Atmel 42482A Getting Started with A...

Страница 7: ...mel Studio Webpage The Atmel Studio installer free IDE is available at http www atmel com tools ATMELSTUDIO aspx 1 4 2 Atmel Studio Microsite To learn more about Atmel Studio refer to the following mi...

Страница 8: ...udio 6 2 SP2 Note There is no need to install part pack for Atmel Studio future versions 3 Launch the Atmel Studio 4 Connect the ATmega328PB Xplained Mini to the USB port and it will be visible in the...

Страница 9: ...tings are 9600 baud N 8 1 The COM port settings can be changed by using the Device Manager 1 6 Programming and Debugging This section helps to program and debug the ATmega328PBXplained Mini kit by usi...

Страница 10: ...nd Break 6 Atmel Studio will display an error message if the DWEN fuse in the ATmega328PB is not enabled click YES to make Studio set the fuse using the ISP interface 7 A debug session is started with...

Страница 11: ...C executable Project template name the project and click OK to get the device selection wizard Figure 2 2 New Project Wizard 3 The Device Selection wizard will display as shown in Figure 2 3 Device Se...

Страница 12: ...e pin will be driven low The PINx register is used to return the logic level available on the port pin In this example code the PB7 Button is used as input and the PB5 LED0 as output Here the LED0 is...

Страница 13: ...d on ATmega328PB Xplained Mini as shown in Figure 2 6 Start without Debugging on page 13 and Figure 2 7 Start Debugging and Break on page 13 Figure 2 6 Start without Debugging Figure 2 7 Start Debuggi...

Страница 14: ...mentation for various products http www atmel com webdoc Atmel Gallery https gallery atmel com Production Selection Guide Atmel MCU Selector on http www atmel com Ordering Samples and Buying evaluatio...

Страница 15: ...ry Doc Rev Date Comments 42482A 08 2015 Initial document release Atmel AT08401 Getting Started with Atmel ATmega328PB APPLICATION NOTE Atmel 42482A Getting Started with ATmega328PB_AT08401_Application...

Страница 16: ...ITS BUSINESS INTERRUPTION OR LOSS OF INFORMATION ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Atmel makes no representatio...

Отзывы: