0

Microcomputers are dynamic devices that are synchronized by a clock oscillator. So the signals (E, R/W, CS, A15-A0, D7-D0...) appear on their buses only for parts of a microsecond and, as the buses are common for all the microcomputer system, they are constantly changing...

The question is, "What should we do to stop all these signals so that to observe them by ordinary means?"

I must admit that this is more a tricky puzzle than an ordinary question because I and my students already have found an answer in the laboratory of microcomputer devices:)

enter image description here

Circuit fantasist
  • 16,664
  • 1
  • 19
  • 61
  • 5
    You use a logic analyzer. – Majenko Dec 19 '14 at 13:34
  • 1
    Reduce the clock or directly the frequency of the signals and use LEDs or Voltmeters to read each bit; use a parallel to serial converter and an oscilloscope; or if you're rich use a logic analyzer. – Mister Mystère Dec 19 '14 at 13:42
  • 2
    Oscilloscope yes (but it can be tedious), the others usually no. With a scope, get into the habit of writing short infinite loops that exercise the signals you're interested in. –  Dec 19 '14 at 13:42
  • @Majenko, I mean something quite simpler:) – Circuit fantasist Dec 19 '14 at 13:42
  • 2
    Reduce the clock speed to 1Hz. – Majenko Dec 19 '14 at 13:44
  • 1
    You can use a scope too if you don't have an LA, but obviously you'll only be able to see a few signals at a time. A scope will show you wave forms and look for signal quality issues while the LA's primary function is looking at timing and data flowing across the bus. Also a scopes memory depth is limited compared to the depth of a LA so the LA will show you much more bus traffic. – Some Hardware Guy Dec 19 '14 at 13:46
  • @Mister Mystère, a clever advice... but I cannot slow the frequency (we use EVBplus2 board in the laboratory which does not allow it)... – Circuit fantasist Dec 19 '14 at 13:46
  • @Brian Drummond, but the signals are not periodic, because the bus is common... and all sorts of signals are presented there... – Circuit fantasist Dec 19 '14 at 13:50
  • @Some Hardware Guy, but still we have solved the problem by means of an ordinary osciloscope:) – Circuit fantasist Dec 19 '14 at 13:52
  • 1
    That's the point of the infinite loop. Make them periodic and expose patterns you can trigger on. You're doing this to debug hardware : there are better tools for debugging software ... debuggers. (And yes of course you CAN slow the clock down ... find a soldering iron and learn what the crystal oscillator looks like! ) –  Dec 19 '14 at 13:53
  • 1
    What Brian said re loops, plus give a bit of thought to triggering - eg by pulsing the reset pin on the CPU and using this pulse to trigger the scope, you can get a stable picture of the first few instructions – peterG Dec 19 '14 at 14:16
  • 4
    I think "by ordinary means" lacks definition here. For a lot of developers a logic analyzer is "ordinary" development equipment and would probably be the first choice. Instead of asking this as a "riddle" about how YOU solved it, I think it would've been better to present your way and ask about pros/cons/improvements. – Rev Dec 19 '14 at 14:50
  • 6
    Proposing to close this posting because it turns out to be more of a game than a serious question. We try not to play stupid games here. – Michael Karas Dec 19 '14 at 15:13
  • 2
    Your solution sounds like you've re-invented the logic probe. – Jerry Coffin Dec 19 '14 at 15:22
  • 1
    @Michael Karas, please, no offense. The issue is very serious and I use it to stir the interest of my students to crafty circuit tricks. – Circuit fantasist Dec 19 '14 at 15:45
  • @ Jerry Coffin, + something else:) – Circuit fantasist Dec 19 '14 at 15:45
  • 1
    This question appears to be off-topic because it did not follow a Q&A scheme that is comprehensible for anyone reading the question now, mainly because of the edits and the extended discussions. – Rev Dec 19 '14 at 16:30
  • 1
    @Rev1.0: Agreed, this question makes little sense and the OP disagreeing with everyone is does not help in any way. – whatsisname Dec 19 '14 at 17:24
  • I have finished my story about how to replace an osciloscope... and even logic analyzer... by a humble LED... and now "get off the stage"... – Circuit fantasist Dec 19 '14 at 19:55

2 Answers2

3
  1. Build an "embedded debugger": wire a pushbutton, and write a piece of code that steps through your code every push of the button. The level of instructions per step should be settable, maybe via a potentiometer+thresholds. Or keep the uC connected to a computer and use an incircuit debugger supplied with your uC.
  2. Reduce the clock and use LEDs (up to ~10Hz)/voltmeters (~1Hz). Cameras can film everything and the footage can be slowed down. Or use a parallel to serial converter and an oscilloscope (triggered on Chip Select, as Circuit fantasist said - or any single pulse that occurs in a read cycle) to see them all at once even at sort-of-high frequencies
  3. Use a logic analyzer (Majenko was first to say it) - the advantage being that the data will be presented to you after decryption of the protocol and/or conversion of base (Serial, I2C, SPI, or in this case binary to decimal/hexadecimal).
Passerby
  • 73,027
  • 7
  • 93
  • 209
Mister Mystère
  • 9,846
  • 6
  • 55
  • 83
  • I still have difficulties to orientate how to write - as a comment or as an answer. So, now I want to say that we (my students and I) have solved the problem even without an oscilloscope but only by a LED(s). Where to place this text? – Circuit fantasist Dec 19 '14 at 13:57
  • 4
    You can certainly answer your own question. –  Dec 19 '14 at 13:58
  • 1
    Comments are made to ask for more information, or to try an answer we're not sure about. Answers are made when we know (or think we know...) it works. As the original poster, you don't post an answer unless it's an actual solution to your question. – Mister Mystère Dec 19 '14 at 13:59
  • But given that you have a solution, you should post it as an answer when you want (I can see you like to play the game). It's the first time I see someone post a puzzle though, I don't know how members welcome the idea. – Mister Mystère Dec 19 '14 at 14:00
  • Yes, this is just a small riddle (I hope that it will not be offensive to you:) Maybe I should expect a red flag:)? – Circuit fantasist Dec 19 '14 at 14:02
  • 1
    I wouldn't but who knows. I suspect members may lose interest in the question though since it's already solved. I would personally post what I know soon, and wait for the very common "you could also have done this and that". Maybe make it more explicit that I'd like alternatives. Some people here are extremely knowledgeable and will surprise you. – Mister Mystère Dec 19 '14 at 14:09
  • 2
    Answering your own question is common and encouraged by the stack exchange network. – Passerby Dec 19 '14 at 16:03
0

Here is a snapshot of the clock and data signals of HC11 obtained in this way on the scope screen:

enter image description here

As you (Brian Drummond) supposed, a small program (simply reading/writing from/to a memory cell) is looped. The first probe should be connected to CS, the second - to (some wire of) the buses... and the oscilloscope should be synchronised with CS (the "trick":) But I could not find this picture and showed a snapshot where the first shape represents the clock (2 MHz), the second - a signal of the data bus... and the oscilloscope is externally synchronised with CS. Then, by moving the second probe, we can investigate all the interesting signals on the buses...

Now let's see how we can realize this idea only with a LED... Actually, it has long been used in dynamic 7-segment LED indicators. We can control a LED from the side of the anode keeping its cathode at the steady ground; conversely, we can control it from the side of the cathode keeping its anode at the steady Vcc; finally, we can control it simultaneously from both the sides (of the anode and cathode) simply realizing an AND function without any additional circuits. Thus the signal applied from the side of the cathode can serve as SELECT (CS of the observed device) in respect to the INPUT bus signal of interest (e.g., A15) applied from the side of the anode. So, every time when CS is active (low), and the observed bus signal (A15) is high, the LED will flash... and if we repeat it quickly enough, we will have the illusion the LED lights up continuously (the Edison's cinematograph idea or the stroboscopic idea).

enter image description here

So, the 'trick' is extremely simple - just connect a LED (of course, via a resistor) between these two points (the cathode to CS and the anode to the bus line)...

enter image description here

... and loop a simple program (e.g., a single LDA or STA instruction followed by BRA).

It is interesting that this humble stroboscopic logic probe is better (for this purpose) than the oscilloscope. There we have to take into account the value of the observed signal only within the time interval where CS is active while here the LED indicates the signal only in this interval.

Furthermore, we can connect multiple diodes to observe simultaneously all bus lines (hoping that CS can endure the sum of the LED currents).

It seems incredibly but we can observe this HF pulse signals even with an ordinary DC voltmeter connected through a diode between CS and the point of interest. While, in the case of the LED, our inert vision integrates the pulses, here the inert voltmeter integrates them. In contrast to the LED probe, this indicator has the advantage that it does not consume any current from the buses.

Circuit fantasist
  • 16,664
  • 1
  • 19
  • 61
  • Isn't that dependent on how many clock cycles the register takes to detect a read request once CS'd and make the data available on the bus, to know where the LSb is? Also, you still have to cycle through the wires of the bus to view the entire data, and I wouldn't do that from 16bits up... But that's one cheap way, indeed. – Mister Mystère Dec 19 '14 at 17:05
  • P.S: related to your edit request on my post: we don't have to compile all answers in one post, each answer brings something to the set of possible solutions. If you consider the problem solved, you should accept an answer (the tick mark). You can accept your own answer but you'll have to wait 2 days for that. – Mister Mystère Dec 19 '14 at 17:12
  • Frankly, I can't comprehend what is the problem you are talking about in the first part of your comment... but it works fine. About the "cycling through the wires" - yes, it's true. But at this stage (basic microcomputer techniques) it's useful for beginners. Thanks for the edit elucidation. – Circuit fantasist Dec 19 '14 at 17:20
  • 1
    Scrap that, that's only relevant to serial busses. If you're interested though, I meant: when the chip select is inactive, the chip does not process; so as soon as the chip select pulses, the chip will start reading the address, look up the requested cell in memory, and make it available on the bus. If all these operations take more than one clock cycle (flash for example), we need to know that duration in order to know where the least (or most) significant bit is to read the data correctly. But with parallel busses it's all about "is there a 1 showing up not long after CS is pulled". – Mister Mystère Dec 19 '14 at 17:37
  • 5
    So, the answer is to use a reasonable trigger signal and use the oscilloscope exactly the way it's always used for every digital circuit its ever been applied to? – Scott Seidman Dec 19 '14 at 18:45
  • @Mister Mystère - OK, I see... Don't you think you should correct your insertion above "Or use a parallel to serial converter and an oscilloscope (triggered on Chip Select, as Circuit fantasist said...) according to this explanation? – Circuit fantasist Dec 19 '14 at 18:51
  • @ Scott Seidman, it turns out this is the case... and I did not do anything special... So, I will continue further my story... – Circuit fantasist Dec 19 '14 at 18:55
  • 3
    @Circuitfantasist -- you'll find this isn't a great forum for dragging out the answer to a question. Say what needs to be said, and then get off the stage. People come here for answers, not puzzles. – Scott Seidman Dec 19 '14 at 18:58
  • 1
    Your addition isn't very useful for any serial bus. – Scott Seidman Dec 19 '14 at 19:46