Тёмный

Debug Arduino Uno using Microchip Studio 

EmbSys
Подписаться 1,3 тыс.
Просмотров 17 тыс.
50% 1

The Arduino Uno is easy to debug:
During developement we use an Xplained Mini Board, which provides real hardware debugging and is available at low cost.
From now on we use this IDE: Microchip Studio.
Alert: With version 7.0.2542 the name "Atmel Studio 7" has been replaced by "Microchip Studio" - the functionality didn't change.

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 70   
@agnichatian
@agnichatian 2 года назад
Not sure why I'm only now seeing this. Thanks for making this video. This will help me debug time-critical interrupts, unlike COM port solutions.
@EmbSys
@EmbSys 2 года назад
It is exactly the correct solution when it comes to debugging time critical stuff. Glad the algorithm finally gave in for you.
@franhdez4711
@franhdez4711 6 месяцев назад
Great instruction, really stepping up from Arduino IDE. Thanks from Spain.
@daCount0
@daCount0 9 месяцев назад
Danke wieder mal ... ihre Sachen sind meist Gold wert.
@EmbSys
@EmbSys 9 месяцев назад
Danke, freut mich! Solche Kommentare bekommen von mir eindeutig Platinstatus! 😀
@MakerFabio
@MakerFabio 3 года назад
many thanks. don't know why this video is not viral . did you try also the Arduino Zero? what do you recommand as starting point for HW debugging with arduino today? thanks
@EmbSys
@EmbSys 3 года назад
So far I didn't have the opportunity to test the Zero. My Xplained Mini boards feature the mini (mEDBG) interface, while the Zero comes with the full EDBG, so I expect debug to work even smoother. Microchip Studio does of course support the EDBG interface as well.
@MakerFabio
@MakerFabio 3 года назад
@@EmbSys many thanks
@MakerFabio
@MakerFabio 3 года назад
By the way, i don t know how long it takes to setup the atmel ide for debugging, importing projects and so on, but why do you think there is sp logtle literature and video available on the web about hw debugging with arduino?
@EmbSys
@EmbSys 3 года назад
@@MakerFabio After the initial installation of the IDE, which admittedly takes some time, importing or creating projects is quite easy. There are some pitfalls for beginners, such as choosing the right interface and mode, selecting the processor, disabling optimization and so on. After this initialization, the operation is simple and absolutely worth the effort. Why do you find so little information? Maybe because Atmel was acquired by Microchip, maybe the Arduino IDE was made for hobbyists and artists, not for real engineers? Who knows, I wonder the same thing. BTW thanks for your sub and I will definitely take a deeper look at your channel in the coming days!
@MakerFabio
@MakerFabio 3 года назад
@@EmbSys i see , it makes sense what you say. thanks to you for sharing and replying. Go on like this , to help engineers working more advanced with arduino
@cyperron3497
@cyperron3497 2 года назад
Question - LOL, totally off topic but what is that background music? I love that jazzy sound!! I caught myself bebopping to it while watching your video. Thanks for the video's and all your work, great stuff, I subscribed to your channel, Saying hi from Canada 😀
@EmbSys
@EmbSys 2 года назад
The music is called Bumper Tag, by John Deley. Found it in the YT off license section, and instantly knew it had to be that sound. Link: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-lnGhMo5ZQvA.html. Nice to meet you, Cy Perron from Canada! And tx for the sub.
@randallyoung6715
@randallyoung6715 Год назад
Thank you, great vid and very useful.
@danwissler
@danwissler 3 года назад
Thank you! That's exactly what I'm looking for...
@EmbSys
@EmbSys 3 года назад
You're welcome! That's exactly why I made this video for you...
@agnichatian
@agnichatian 2 года назад
Did anyone else have trouble getting the DebugWire to work on this ? I created a simple nativ ATMega328 blinking program, and tested it using ISP. Then I tried to debug using DebugWire. Atmel Studio (Microchip Studio 7.0) asked permission to enable the DebugWire fuse. Then it failed saying that DebugWire doesn't support chip erase. But now it's stuck with the DWEN fuse enabled. Only ISP shows up as the interface, but it won't let me do anything like get info or program or see the target voltage (all of that worked before). It can not read even the device signature, and only ISP interface mode shows up in the tools/programming window. I tried power cycling the whole thing. I don't get why Atmel Studio won't show the DebugWire choice.
@EmbSys
@EmbSys 2 года назад
I will try to help. Do you use the Xplained mini board?
@agnichatian
@agnichatian 2 года назад
@@EmbSys AFAIK I have same pcb as your video. I read docs. I suspect that either the 32u4 chip has no debugwire code, or it is off, or the reset line impedance is too low. When I get to work [I'm in car atm] ill check the reset with ohms and with scope. Other ideas welcome, ty for reply.
@agnichatian
@agnichatian 2 года назад
@@EmbSys ps all this new a few weeks ago
@EmbSys
@EmbSys 2 года назад
I just checked my documents. Maybe this helps: Debug --> Attach to target, then Debug --> Disable debugWire and close. At least it's worth a try.
@agnichatian
@agnichatian 2 года назад
@@EmbSys will try
@thorstenfricke3257
@thorstenfricke3257 Год назад
Hi, kann ich das xplained mini auch mit Visual studio debuggen?
@EmbSys
@EmbSys Год назад
Ich denke, das geht nicht. Lasse mich aber gerne vom Gegenteil überzeugen, falls jemand weiß, dass/wie es doch geht.
@thorstenfricke3257
@thorstenfricke3257 Год назад
@@EmbSys ok danke
@V_baddict
@V_baddict 3 года назад
Does this work only for Uno? How about Arduino Mega 2560? Thank you!
@EmbSys
@EmbSys 3 года назад
The Atmega2560 has a JTAG Interface, so hardware debugging should work even better. Unfortuately I never had the chance to test it myself, so take it with a grain of salt.
@TheLightningStalker
@TheLightningStalker 2 года назад
@@EmbSys What about the Digispark? Simulaton?
@EmbSys
@EmbSys 2 года назад
@@TheLightningStalker I read about Digispark and it seems there is no HW debug option. You can have serial monitoring, which is far less than "hardware debugging".
@TheLightningStalker
@TheLightningStalker 2 года назад
@@EmbSys I tried using MPLAB sim. Sometimes it works, sometimes not.
@EmbSys
@EmbSys 2 года назад
@@TheLightningStalker Simulation should always work fine. What exactly did you try to simulate?
@henkoegema6390
@henkoegema6390 Год назад
Kann ich Atmega328P Xplained Mini in Deutschland irgendwo kaufen? In Holland kann ich es nicht finden?
@EmbSys
@EmbSys Год назад
Ich habe sie bei Microchipdirekt bekommen, aber auch bei den üblichen Verdächtigen wie Farnell, RS Components oder Digikey. Sollte auch in Holland möglich sein.
@henkoegema6390
@henkoegema6390 Год назад
@@EmbSys Vielen dank. 😀 Hab's gefunden! (Digikey)
@thorstenfricke3257
@thorstenfricke3257 Год назад
Amazon :-) heute angekommen. nur leider teurer
@agnichatian
@agnichatian 2 года назад
So I tried to run a simple Arduino program that plots a sine wave to the serial port; it just sends integer strings to the port, viewable in Arduino IDE's serial plotter tool. But all I get is garbage instead of numbers, at any baud rate. That also is the case in Atmel Studio's data visualizer terminal. But when I program a real Arauino Uno with the same source code, it works fine. The xplained board is giving a 16.0 MHz clock to the mega328 as expected. Has anyone else gotten the Arduino serial code to work on these Mega328 Xplained boards ?
@EmbSys
@EmbSys 2 года назад
I'd like to take a look at your source code. Thank you for sharing!
@agnichatian
@agnichatian 2 года назад
@@EmbSys ok I put in zip with atmel project (tried from scratch again today, still corrupted serial) and original ino file in main folder of zip also. Leonardo serial prints fine and graph of number stream works fine there. Was using Uno with same results but I bricked it in DWEN yesterday and can't get it out.
@EmbSys
@EmbSys 2 года назад
@@agnichatian Received you code, and already checked it. It runs both now, on an Arduino UNO and on my ATmega328P Xplained. The secret was to reduce the baud rate, I set mine to 19,200 which still seems fluently enough. Do you have resolved your DWEN problem by now?
@EmbSys
@EmbSys 2 года назад
@@agnichatian BTW, I forgot to mention that I used the Arduino serial plotter when running the code on Xplained and MCStudio, as the plotter in Microchip Studio is somehow special and only accepts bare hex values, no or allowed.
@agnichatian
@agnichatian 2 года назад
@@EmbSys hmm so if I send hex could I make it plot those ? Not sure if I send like 08 09 0A etc or 08090A... then what about 16/32 bits or floats - I'll read the manual for it hopefully soon, it's not intuitive as I'd hoped.
@mcsroberto1
@mcsroberto1 2 месяца назад
Is there an option like this, but for the Arduino Mega?
@EmbSys
@EmbSys 2 месяца назад
@@mcsroberto1 As far as I know, the Aruino Mega already supports hardware debugging by itself. But I have never used a Mega, so I can't say it for sure.
@mcsroberto1
@mcsroberto1 2 месяца назад
@@EmbSys I bought the ATmega328P Xplained Mini board, but although my device administrator recognizes it as mEDBG Virtual COM Port, the Microchip Studio IDE does not recognize it, following your tutorial in the Tool part only Simulator and Custom Programming Tool appear as options, and following the User Guide i ´got stuck in the 2.3.1.2 Part
@zhuk462
@zhuk462 3 года назад
looks like you simply moved from Arduino IDE to Atmel Studio 7, didn't you?? What exactly Xplained board adds to the debugging process??
@EmbSys
@EmbSys 3 года назад
Thank you, good question. You are right for some Arduino Boards. But on the Arduino Uno you have neither the opportunity to set breakpoints nor to watch variables - even when using Atmel Studio. The Xplained Mini Board has the same form factor as the Uno, so you can use the same expansion shields and debug just like you had an Arduino Uno.
@zhuk462
@zhuk462 3 года назад
@@EmbSys You're wrong. I can set breakpoints and watch variables on the arduino UNO/Nano using VS2017/2019+vMicro and VSCode. There are a few libraries which use GDB. So, I really don't understand what is the use of Xplained board...
@EmbSys
@EmbSys 3 года назад
That's interesting. Of course I checked Visual Micro a few years ago when I was looking for real hardware debugging. And it didn't satisfy my needs. As far as I remember I had to bloat my code with additional, processor time consuming, software routines. And there was no way to directly modify hardware registers like timers and port IO. But perhaps this changed by now and I should give it another try?
@zhuk462
@zhuk462 3 года назад
@@EmbSys That's correct. To use real hardware debugging you need jlink debugger or so...
@EmbSys
@EmbSys 3 года назад
@@zhuk462 Correct, that's the point. The Xplained Mini board does not only replace the Arduino Uno - it provides debug hardware as well. As far as I know the only real and full hardware debugging option for the Arduino Uno. At low cost.
@thefront5871
@thefront5871 Год назад
SOLD!! LMFAO!!
@EmbSys
@EmbSys Год назад
Microchipdirect: 1200 in stock.
@thefront5871
@thefront5871 Год назад
@@EmbSys Already bought yesterday! $25.54 with shipping and handling to be delivered on Jan. 6th! I'm also looking at a ESP-PROG board and maybe even ARM chips in a month or two.
@SP6QKX
@SP6QKX 2 года назад
Далее
My trick for reading hex code!
13:17
Просмотров 5 тыс.
Debugging an Arduino Sketch Running on an Uno
21:45
Просмотров 7 тыс.
МАЛОЙ ГАИШНИК
00:35
Просмотров 508 тыс.
Bootloader and upload to Atmega328P-AU
7:28
Просмотров 73 тыс.
AVR-Arduino Hardware Debugger on the Cheap
18:17
Просмотров 15 тыс.
#56 Programming the Arduino Uno Using Atmel Studio 7
18:46
Build Your Own Drone Tracking Radar:  Part 1
20:08
Просмотров 543 тыс.
Getting Started with Meshtastic - Devices
15:01
Просмотров 212 тыс.
МАЛОЙ ГАИШНИК
00:35
Просмотров 508 тыс.