From: Simon H. <Sim...@co...> - 2003-03-27 22:12:04
|
Simon Hosie: > If there's a risk that RAM will map to multiple addresses by not > decoding enough address bits then it's tricky. You'd have to make = sure=20 > that a write to a particular location doesn't get mirrored in any = lower > location. I've also seen people say that they've managed to detect a > fully populated address space just by storing the test data in the > capacitance of the tracks and connectors. Use a complex, multibyte > pattern to avoid that. Olaniyi Bajomo: > Sorry I don't get what you mean by that last part can you please > explain further, Well, if you don't decode all of the address bits, then a RAM chip could = appear (for example) at 0x0000, 0x4000, 0x8000, and 0xC000 and behave = just the same no matter which base address you use. If you're scanning = up from zero writing data and then reading it back to see if it was = stored in something, you may cross from 0x3FFF to 0x4000 successfully, = and then when you test 0x4000 you'll get a valid result because it's = just the same as 0x0000 - but if you actually tried to use address you'd = be destroying other data. The other point, regarding capacitance, is where you write data out to = an address, and so all the tracks and connectors up to where RAM would = be plugged in go to the appropriate voltages to represent your test data = in the write cycle, and then when you read the data back they're still = in that state because there hasn't been any influence to change. So it = looks like your data was saved in RAM when really it's just the = capacitance of the circuitry. I think something like this might work, in an 8/16 bit system and the = mapping is contiguous and no device is going to be less than 256 bytes = and there is at least one device attached, but I haven't really thought = it through. char xdata *end_of_xdata(void) { unsigned char offset =3D 0xFF; do { *(unsigned char xdata *)((offset << 8) + 0xFF) =3D offset; offset--; } while (offset !=3D 0); return (char xdata *)(*(unsigned char xdata *)0xFFFF << 8) + 0xFF; } |