H/W bus monitor - input protection - Page 1
Forum section: electronics / projects

author: banedon
author_rank: Regular Contributor
timestamp: August 30, 2015, 07:59:09 am
content: Hi guysI've been working on a hardware bus monitor for building 5v based 8 bit microprocessor systems (such as 65C02). The board uses an 324P AVR which has one 8 bit port connected to 4 buffers - two buffers for the LSB & MSB of the attached address bus, one for the data bus and one for the signals. The AVR switches the input to itself by rapidly turning each buffer on, measuring the input, then turning it back off - all in sequence. It then displays the result.I've ironed out all the bugs, but the one thing which is causing a bit of an issue is that when the bus monitor is turned on, it sometimes has an issue if the connected host computer isn't on or if there is an issue with connected buses then the AVR seems crash.I *think* this is caused by unfettered current draw via the attached buses. Would adding current limiting series resistor networks on the inputs between the buffers and the attached buses resolve this?I'd normally go ahead and try it anyway, but as I've run out of room I'll need to rebuild it and would like to know if I'm possibly right before doing that.Any help/advice would be much appreciated.BTW here's the circuit diagram: updated the circuit digram as I've recently made some changes (added more signal lines)

author: matseng
author_rank: Frequent Contributor
timestamp: August 30, 2015, 08:17:35 am
content: How do you know that the AVR actually crashed during startup? If you are just looking at the LCD to determine if running or crashed it might just as well be a bad LCD initialization sequence that acts up sometimes. Adding a LED that flashes in the main loop would be an easy way to see if this is indeed the cause.

author: banedon
author_rank: Regular Contributor
timestamp: August 30, 2015, 08:24:50 am
content: I'll admit that I am using the LCD to indicate what is happening. However, I've used the exact same AVR code t initialise the LCD in several other projects and it obeys all the rules for timing and the needed start sequence. I've only ever seen this effect with this project.Here's what I've got in mind:

author: matseng
author_rank: Frequent Contributor
timestamp: August 30, 2015, 08:38:55 am
content: That actually makes no sense at all double up.... :-) You're limiting the current *into* the buffer in order to make the *output* of the buffer not crash the AVR?I'd more guess a software problem because if an AVR would crash during startup due to signals on the ports then that would be a major issue for many design, and that wouldn't be fixed by limiting the current, unless we're speaking of parasitic SCR latchups...But, do you have any interrupts enabled that might cause any non-deterministic interactions during startup?

author: matseng
author_rank: Frequent Contributor
timestamp: August 30, 2015, 08:44:31 am
content: [Sorry for this more of less hijack of this thread but...] this project reminds me of a design I did a couple of years back. An Arduino shield (no noes!) that shows the state (hi/lo/input) of all pins. But I used analog muxes so I could detect the floating inputs as well.

author: banedon
author_rank: Regular Contributor
timestamp: August 30, 2015, 08:52:21 am
content: The AVR code doesn't use any interrupts - simply runs through a loop doing a sample of each external bus.I've been having a play around with the monitor this morning and I'm now having a hard time reproducing the issue, where-as last night it was all over the place.My concern was really to isolate the two PCBs with regard to possible bad effects caused by one and effecting the other. My reasoning was that putting in those series resistors would prevent things like SCR latchup in the buffers. Also, the test 65C02 computer that I'm using has no protection on the address and data lines at the moment so is possibly vulnerable...BTW here's my AVR code if you're interested plus the LCD library I wrote:

author: matseng
author_rank: Frequent Contributor
timestamp: August 30, 2015, 08:59:28 am
content: Quote from: banedon on August 30, 2015, 08:52:21 amI'm not following the reasoning here. Even if the buffers would latchup then they would simply output a steady 0 or 5 volts at their outputs to the AVR - the AVR would for sure not crash for that. Then *every* would *always* crash at startup :-)But if it works now I'd just be happy and put the blame at something else, like a wonky connection to power or so.....

author: banedon
author_rank: Regular Contributor
timestamp: August 30, 2015, 09:05:27 am
content: Quote from: matseng on August 30, 2015, 08:44:31 amThat's cool - I like the idea of detecting floating inputs. I hadn't thought of that. As I'm using a 324P I could use portA. Do you mind if I pinch your idea? It should be interesting as I've never done any real analogue stuff with AVRs (or anything else, for that matter)

author: banedon
author_rank: Regular Contributor
timestamp: August 30, 2015, 09:42:58 am
content: Ok managed to reproduce it.I think the 44780 LCD module is trying to draw power when the bus monitor supply is off, but the attached 65C02 is on. The LCD backlight is half lit and I can see a greater draw on the 65C02 PSU for it. yeah if I attach my 'scope ground to the ground of the 65C02 the LCD backlight either flickers or strengthens very slightly. I think it's drawing power through the bus lines via the buffers... ? I'm seeing 2.8v on the +5v rail on the monitor... also, seeing the same on both the internal and external sides of all of the buffers.Does this look like the buffers are latching up? I have no experience with SCR latchup, although I have watched Dave's video on it.