Memory tests. - Does anyone bother?
Memory tests. - Does anyone bother?
Hi folks,
I have just taken my 65c02 project off the top shelf again and I'd like to hear peoples opinion of testing onboard memory.
I've just tried a routine that tests zero page using the 55 & AA bit patterns and I put that as the first step of my board initialisation. Straight away I come across a couple of issues.
1. Nothing has been initialised yet, so how do you report the result of the test.
2. If I leave it later then by that time I'm using zero page & the stack. It probably isn't a good idea to stamp all over the stack with a memory test after initialisation.
I have free space in the memory map. I always know there should be 32K, but I could add another 16K if I needed, so I can see a use for the memory test to identify the top of memory as well - assuming contigious RAM.
Any thoughts?
I have just taken my 65c02 project off the top shelf again and I'd like to hear peoples opinion of testing onboard memory.
I've just tried a routine that tests zero page using the 55 & AA bit patterns and I put that as the first step of my board initialisation. Straight away I come across a couple of issues.
1. Nothing has been initialised yet, so how do you report the result of the test.
2. If I leave it later then by that time I'm using zero page & the stack. It probably isn't a good idea to stamp all over the stack with a memory test after initialisation.
I have free space in the memory map. I always know there should be 32K, but I could add another 16K if I needed, so I can see a use for the memory test to identify the top of memory as well - assuming contigious RAM.
Any thoughts?
Re: Memory tests. - Does anyone bother?
My 6809 board tests it's memory immediately at reset. No stack is used. Error reporting is via an onboard sounder which requires a single byte on a port to generate a tone of given frequency. I think this works quite well on my fafairly simple SBC.
In terms of signalling error you could signal the other way, on success, of course.
I believe memory tests are very useful...
In terms of signalling error you could signal the other way, on success, of course.
I believe memory tests are very useful...
8 bit fun and games: https://www.aslak.net/
Re: Memory tests. - Does anyone bother?
A non-destructive test will save the value in each byte before writing and testing the two patterns - should be feasible, using X or Y to keep the value.
(Edit: but http://www.ganssle.com/testingram.htm doesn't think much of that idea. Worth a read. See also http://stackoverflow.com/a/20679170)
Outputting the result for a failure is more of a challenge, without making some minimal assumption, but going into a tight loop with no exit is one possibility. Better a machine which doesn't boot, than one which is unreliable.
Cheers
Ed
(Edit: but http://www.ganssle.com/testingram.htm doesn't think much of that idea. Worth a read. See also http://stackoverflow.com/a/20679170)
Outputting the result for a failure is more of a challenge, without making some minimal assumption, but going into a tight loop with no exit is one possibility. Better a machine which doesn't boot, than one which is unreliable.
Cheers
Ed
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Re: Memory tests. - Does anyone bother?
I don't usually bother. The only time I had a problem with RAM it was due to someone putting a chip in the wrong way round.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Memory tests. - Does anyone bother?
APL wrote:
I have just taken my 65c02 project off the top shelf again and I'd like to hear peoples opinion of testing onboard memory.
Incidentally, I use the alternating bit patterns %01011010 and %10100101 for checkerboard testing. A really detailed test would also do a single bit "walking" check on each location as well, but one might not have the patience to wait for such a test to complete.
x86? We ain't got no x86. We don't NEED no stinking x86!
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Memory tests. - Does anyone bother?
BigEd wrote:
(Edit: but http://www.ganssle.com/testingram.htm doesn't think much of that idea.
The traditional test using $55 and $AA seems to have been around since the dawn of the microprocessor and use of TTL memory. I use $5A and $A5 just to be perverse.
Last edited by BigDumbDinosaur on Fri Jun 06, 2014 9:13 pm, edited 1 time in total.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Memory tests. - Does anyone bother?
It seems worthwhile to me to have a test which would detect addressing problems, though.
Cheers
Ed
Cheers
Ed
Re: Memory tests. - Does anyone bother?
My bench computer includes a memory test - it runs after the LCD has been initialised so it can display the address of a memory failure. The LCD can be initalised without needing to use RAM at all.
The memory test itself generates a random sequence of bytes using a LFSR generator to fill the memory. It then resets the LFSR seed and confirms the values in memory match those generated by a re-run of the random sequence. Thiis will fail if the address lines are shorted or open and so tests more than just the RAM device itself. Indead, given the reliability of RAM chips, it was my wiring I was more interested in testing!
The test uses the first 4 bytes of zero page as temporary storage. Of course, this means these bytes can't be tested but if these are faulty, the test will fail at byte 0004 or 0005, indicating a problem with the RAM device.
So far, the only time the test has failed was when I replaced the 32K RAM with an 8K device as a test of the RAM test!
The memory test itself generates a random sequence of bytes using a LFSR generator to fill the memory. It then resets the LFSR seed and confirms the values in memory match those generated by a re-run of the random sequence. Thiis will fail if the address lines are shorted or open and so tests more than just the RAM device itself. Indead, given the reliability of RAM chips, it was my wiring I was more interested in testing!
The test uses the first 4 bytes of zero page as temporary storage. Of course, this means these bytes can't be tested but if these are faulty, the test will fail at byte 0004 or 0005, indicating a problem with the RAM device.
So far, the only time the test has failed was when I replaced the 32K RAM with an 8K device as a test of the RAM test!
Shift to the left,
Shift to the right,
Mask in, Mask Out,
BYTE! BYTE! BYTE!
Shift to the right,
Mask in, Mask Out,
BYTE! BYTE! BYTE!
Re: Memory tests. - Does anyone bother?
Interesting replies, thanks.
So. I guess I am being a bit paranoid. I could initialise the VIA port and then I have four LEDs and the LCD avaliable.
Then what would the best means of differentating between a memory error and the end of memory, it seems either condition would throw an error. Is it just a matter of testing against expected bounds?
BigEd wrote:
is more of a challenge, without making some minimal assumption,
PaulF wrote:
So far, the only time the test has failed was when I replaced the 32K RAM with an 8K device as a test of the RAM test!
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Memory tests. - Does anyone bother?
In my first big project (1987 or so), I had it test every RAM location and also get a checksum on the ROM. The test was never failed. I can see testing for RAM quantity, but ICs have to be put in by hand, so jumpers could be too; and the wrong type of IC, or one put in backwards, will make things fail immediately, so you'll definitely catch it. I have never, ever, seen RAM fail once in service, so I don't test anymore.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Memory tests. - Does anyone bother?
BigEd wrote:
It seems worthwhile to me to have a test which would detect addressing problems, though.
Cheers
Ed
Cheers
Ed
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Memory tests. - Does anyone bother?
The idea in the stackoverflow answer I linked was pretty direct and efficient, and apparently helped with a production problem. So it needn't been terribly expensive.
I would think a hobby machine might well fail a test after a long time idle, depending on construction, treatment and environment.
Cheers
Ed
I would think a hobby machine might well fail a test after a long time idle, depending on construction, treatment and environment.
Cheers
Ed
Re: Memory tests. - Does anyone bother?
Just came across yet another thread on Stardot forums about memory trouble - clearly it does happen, so here's a pointer to some code from Mike Willegal:
http://www.willegal.net/appleii/6502mem.htm
Cheers
Ed
http://www.willegal.net/appleii/6502mem.htm
Cheers
Ed
Re: Memory tests. - Does anyone bother?
APL wrote:
PaulF wrote:
So far, the only time the test has failed was when I replaced the 32K RAM with an 8K device as a test of the RAM test!
Shift to the left,
Shift to the right,
Mask in, Mask Out,
BYTE! BYTE! BYTE!
Shift to the right,
Mask in, Mask Out,
BYTE! BYTE! BYTE!
OT: bad spots in drum memory
PaulF wrote:
Of course, once you have a failure, you know how much memory is available to use - just don't use the address the test fails at or anything above it!
Quote:
There were 32 bit locations per drum word, but only 31 were used, permitting a "restoration of magnetic flux in the head" at the 32nd bit time. (I never understood why the 32nd bit was not used for parity checking - there was no drum validity checking.) A utility could be run to map defective locations on the drum, and advise users and loaders of the defective tracks, but marginal and failing drums caused interesting problems.
and see also my post over at http://anycpu.org/forum/viewtopic.php?f=22&t=136
(Bear in mind that the drum was the RAM of this machine, and also stored the register data.)