Author Topic: How to debug microcontrollers in the "real world"?  (Read 3325 times)

0 Members and 1 Guest are viewing this topic.

Offline 0db

  • Frequent Contributor
  • **
  • Posts: 336
  • Country: zm
Re: How to debug microcontrollers in the "real world"?
« Reply #75 on: July 30, 2020, 06:28:13 am »
Quote
I believe some CPUs have had a "trap after instruction" bit in their status flags, in which case you can just set that in wherever interrupts save the status register and then do a return from interrupt to execute one instruction. Sadly, neither the Z80 nor the 6502 have that.

That rings a bell, but I never (knowingly)  came across it.

That's the typical Motorola 68k approach.
 

Offline 0db

  • Frequent Contributor
  • **
  • Posts: 336
  • Country: zm
Re: How to debug microcontrollers in the "real world"?
« Reply #76 on: July 30, 2020, 06:39:10 am »
If I needed to output lots of debug data in (semi) realtime, I wouldn't bother with a serial UART. I'd use something like Segger's RTT.

https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/

Like when you develop a sensors-fusion algorithm (IMU, for example) and you have fours sensors streaming data and you need to catch what's going wrong realtime.

Sometimes you are just lucky and there is some trick.

Like when I had to develop a seismic sensor, and since it was not practically possible, neither it made sense, to be install sensor on a rock face just to collect data streams, I chose to produce a kind of "synthetic" stream by sampling data on breaking some blocks of cement mortar.

Then I used the "synthetic" stream to test my algorithm. And it also opened doors to the so called "equivalent time" testing.

I was a student, no money for a DSO, LA ... and printfs and puts were just too slow. But not so slow in the "equivalent time" environment.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 12619
  • Country: gb
    • Having fun doing more, with less
Re: How to debug microcontrollers in the "real world"?
« Reply #77 on: July 30, 2020, 07:05:15 am »
...
Sometimes you are just lucky and there is some trick.

Like when I had to develop a seismic sensor, and since it was not practically possible, neither it made sense, to be install sensor on a rock face just to collect data streams, I chose to produce a kind of "synthetic" stream by sampling data on breaking some blocks of cement mortar.

Then I used the "synthetic" stream to test my algorithm. And it also opened doors to the so called "equivalent time" testing.

I was a student, no money for a DSO, LA ... and printfs and puts were just too slow. But not so slow in the "equivalent time" environment.

Sounds like a good example of the aphorism in my .sig :)

In a pure electronics environment, that attitude is essential when, for example, developing the world's fastest scope or highest precision DMM.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 1744
  • Country: nz
  • Formerly SiFive, Samsung R&D
Re: How to debug microcontrollers in the "real world"?
« Reply #78 on: July 30, 2020, 07:24:58 am »
...
Sometimes you are just lucky and there is some trick.

Like when I had to develop a seismic sensor, and since it was not practically possible, neither it made sense, to be install sensor on a rock face just to collect data streams, I chose to produce a kind of "synthetic" stream by sampling data on breaking some blocks of cement mortar.

Then I used the "synthetic" stream to test my algorithm. And it also opened doors to the so called "equivalent time" testing.

I was a student, no money for a DSO, LA ... and printfs and puts were just too slow. But not so slow in the "equivalent time" environment.

Sounds like a good example of the aphorism in my .sig :)

In a pure electronics environment, that attitude is essential when, for example, developing the world's fastest scope or highest precision DMM.

For those unfamiliar, here is what is meant by "span"



See also



Look ma! No engine!
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 12619
  • Country: gb
    • Having fun doing more, with less
Re: How to debug microcontrollers in the "real world"?
« Reply #79 on: July 30, 2020, 08:16:13 am »
You don't need to understand what "span" is in order to get the gist of the aphorism; "span" could have been replaced with "wirlbleator" :)

I've been in an ASH25 twice. The first winch launch flight lasted 5 mins; the sky was less than cooperative. The second, 15 mins later, lasted a couple of hours and could have been longer.

My favourite and short video showing span is of an ETA. Watch the wing bend!


Or, more simply,


But this is too far off topic for me to want to continue.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf