Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Arduino Debugging

Status
Not open for further replies.

PA3040

Advanced Member level 3
Joined
Aug 1, 2011
Messages
883
Helped
43
Reputation
88
Reaction score
43
Trophy points
1,308
Activity points
6,936
Hi Everyone , Have a nice day !

I participated the meeting that for make a new syllabus for school students in grade 9 and 10

Subject is Robotics technology
We decided to use Arduino Microcontroller board ( Arduino Uno) to make a robot
Final project of this syllabus is make a line follower robot

I pointed out that student must explain the operation of the robot by using debugging method( Ex How does sensor work , Sensor output in the bends and direct line).

But one of senior lecture did not agree with me and he said that debugging can't be used with Arduino and he told that he do not like used debugging word hear

please explain the reason in both agree or disagree in this regard about what senior lecture words

Thanks in advanced
 

First, one must understand the concept behind the Arduino, which is a programming platform that enclose on a single IDE the support for different micorcontroler's cores/archictetures, so that the price paid for such a 'standardization' is the loss of the hardware-specific resources of each microcontroller, including low-level Debug capabilities available at the baremetal development. In addition, by 'debugging' one could define from many perspectives, not only at the low level, but also within the programming itself, as for example, by adding a conditional log streamming on the program, one could enable/disable debug mode by software, throwing or not at the UART values of interest during development stage.
 

    PA3040

    Points: 2
    Helpful Answer Positive Rating
There is a new beta version of Arduino IDE that has better debug capability. Not sure
how buggy it is but here it is -


One can use Eclipse and set it up in a better dev environment, learning curve a little
steeper than standard Arduino IDE.


Regards, Dana.
 

First, one must understand the concept behind the Arduino, which is a programming platform that enclose on a single IDE the support for different micorcontroler's cores/archictetures, so that the price paid for such a 'standardization' is the loss of the hardware-specific resources of each microcontroller, including low-level Debug capabilities available at the baremetal development. In addition, by 'debugging' one could define from many perspectives, not only at the low level, but also within the programming itself, as for example, by adding a conditional log streamming on the program, one could enable/disable debug mode by software, throwing or not at the UART values of interest during development stage.
I believe that senior lecture pointed out about real time debugging that does nor support with Arduino IDE and also I think Arduino does not support debug protocol and debug tools and debug port with Arduino bootloader

But

I need teach to students that they must practice to read the values coming from the sensor and print the value using Serial.println(), that is what I pointed out debugging

Hoped you understand
any advice
 

Hoped you understand
Hope your "senior lecturer" understands this, too.

IMHO: Debugging is very important.
But before debugging I recommend to write little pieces of code and individually test them.
After each piece is tested you may combine all to the desired function.

I see many members here writing (or copy and paste) a huge amount of code ... try to use it in total ...
... and if it does not worke like expected they are lost, not able to debug it piece by piece.
Like:
* feed functions with known values...to expect known output
* feed them with extreme values (most big positive, most big negative, zero....) to see if still everything works like expected
* set/ clear pins for debugging funtion but also debugging timing
* print values to serial port ... (while taking care of transmit time )
* stop operation by implementing a "while(1)"
* slow down operation by implementing "delay_ms(xx)"

I'm not the most experienced programmer, but I think I'm a good "debugger". (Indeed it doesn't matter whether it is programming language, analog circuit, power circuit, physical processes, algorithms, chemical processes...).
Generally it's always the same: divide the problem into pieces, decide wheter you want to debug them "from input to output" or back "from output to input" ... and stay focussed and test each piece step by step.
Often there is no need for dedicated debug tools: a bit of debugging code and a serial monitor is sufficient, maybe the use of a scope...

In my eyes debugging is very important.

The best programmer will make mistakes ... and he/she needs to be able to find them..

Klaus
 

    PA3040

    Points: 2
    Helpful Answer Positive Rating
...and remember that ALL devices have an output, there wouldn't be much point in them if they didn't!
Use the output to help you debug. Even if it's just a spare pin on the device, drive it high or low to signal something is happening internally in the code.
Hint: add the line "#define debugging" at the top of your program, then use "ifdef debugging .... endif" around any code you add to help with debuggging. When you are happy everything is working, simply add a '//' comment before the #define and recompile. All your debugging code will magically be left out of the executable.

Brian.
 

Hope your "senior lecturer" understands this, too.

IMHO: Debugging is very important.
But before debugging I recommend to write little pieces of code and individually test them.
After each piece is tested you may combine all to the desired function.

I see many members here writing (or copy and paste) a huge amount of code ... try to use it in total ...
... and if it does not worke like expected they are lost, not able to debug it piece by piece.
Like:
* feed functions with known values...to expect known output
* feed them with extreme values (most big positive, most big negative, zero....) to see if still everything works like expected
* set/ clear pins for debugging funtion but also debugging timing
* print values to serial port ... (while taking care of transmit time )
* stop operation by implementing a "while(1)"
* slow down operation by implementing "delay_ms(xx)"

I'm not the most experienced programmer, but I think I'm a good "debugger". (Indeed it doesn't matter whether it is programming language, analog circuit, power circuit, physical processes, algorithms, chemical processes...).
Generally it's always the same: divide the problem into pieces, decide wheter you want to debug them "from input to output" or back "from output to input" ... and stay focussed and test each piece step by step.
Often there is no need for dedicated debug tools: a bit of debugging code and a serial monitor is sufficient, maybe the use of a scope...

In my eyes debugging is very important.

The best programmer will make mistakes ... and he/she needs to be able to find them..

Klaus
I agree with you debugging is a just English word , It does not have specific technology added meaning
--- Updated ---

...and remember that ALL devices have an output, there wouldn't be much point in them if they didn't!
Use the output to help you debug. Even if it's just a spare pin on the device, drive it high or low to signal something is happening internally in the code.
Hint: add the line "#define debugging" at the top of your program, then use "ifdef debugging .... endif" around any code you add to help with debuggging. When you are happy everything is working, simply add a '//' comment before the #define and recompile. All your debugging code will magically be left out of the executable.

Brian.
Yes what I understood is debug we can use any where just a pies of code
--- Updated ---

In a simple way testing operation of the code in the various point and check the output is called debugging
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top