test of data bus

codding in C and C++
Post Reply
User avatar
Pavel
Posts: 3
Joined: Mon Jul 03, 2023 9:04 am

test of data bus

Post 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.
User avatar
Ondra
Posts: 9
Joined: Mon Jul 03, 2023 3:08 pm

Re: test of data bus

Post by Ondra »

so what is coming back to you?
User avatar
Jerry
Posts: 4
Joined: Mon Jul 03, 2023 11:35 pm

Re: test of data bus

Post by Jerry »

what is in pattern ?
User avatar
Pavel
Posts: 3
Joined: Mon Jul 03, 2023 9:04 am

Re: test of data bus

Post 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.
User avatar
Jerry
Posts: 4
Joined: Mon Jul 03, 2023 11:35 pm

Re: test of data bus

Post 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.
Post Reply