Page 1 of 1

test of data bus

Posted: Mon Jul 03, 2023 9:35 am
by Pavel
trying to test the status of the bus connected to the 80C196. I have this program:

typedef unsigned char datum;
/* Set the data bus width to 8 bits. */
/**********************************************************************
*
* Function: memTestDataBus()
*
* Description: Test the data bus wiring in a memory region by
* performing a walking 1's test at a fixed address
* within that region. The address (and hence the
* memory region) is selected by the caller.
*
* Notes:
*
* Returns: 0 if the test succeeds.
* A nonzero result is the first pattern that failed.
* **********************************************************************/
datum
memTestDataBus(volatile datum * address)
{ datum pattern;
/*
* Perform a walking 1's test at the given address.
*/
for (pattern = 1; pattern != 0; pattern <<= 1)
{
/*
* Write the test pattern.
*/
*address = pattern;

/*
* Read it back (immediately is okay for this test).
*/

if (*address != pattern)
{
return (pattern);
}
}
return (0);

} /* memTestDataBus() */


unfortunately, the pattern I send to the databus is not returned. :( There is a mistake somewhere.

Re: test of data bus

Posted: Mon Jul 03, 2023 7:22 pm
by Ondra
so what is coming back to you?

Re: test of data bus

Posted: Mon Jul 03, 2023 11:50 pm
by Jerry
what is in pattern ?

Re: test of data bus

Posted: Sun Jul 09, 2023 6:51 am
by Pavel
When I put only ones in the pattern, I get 1. When I put, for example, 00001111, I get 1, when I put 1111000, I get 0. I try different combinations. but I haven't found anything logical yet.

Re: test of data bus

Posted: Tue Jul 11, 2023 5:59 am
by Jerry
try sending 00000001 to the pattern and increase the binary value by 1 up to 11111111 and test the returned value. It may be necessary to include some wait states.