While still working on updating the PCBs and fixing some bugs for the build, I started wondering how to massively test the modules (breadboard or pcb) and of course the Arduino came handy.
The General Purpose Address Register (GPAR) is described in this blog post. It provides a 16-bit wide address register, reset, increment and decrement functions and can publish its values to both the Adress Bus and the Data Bus.
To test the features we will need to check each functions:
- Capability to move a 16 bit value to the register using the Data Bus (The Data Bus is only 8-bit wide, therefore we need two steps, moving the MSB-Most Significant Byte and then the LSB-Less Significant Byte)
- Capability to retrieve a 16 bit value from the register using the Data Bus (same)
- Capability to increment the value stored in the register
- Capability to decrement the value stored in the register
- Reset
The program must also make sur that the cabling is ok (either within the prototype or between the arduino and the prototype). For this we will light up all the LEDs slowly one by one in a specific order for a visual check.
The program does the following:
- Check each action signal by lighting the appropriate LED, this will enable checking the wiring between the arduino and the prototype and the LED capability (8 signals total)
- Check each register bit by uploading the appropriate value (0, 1, 2, 4, 8, etc) to the register. Each time, the given led should light up. This will again ensure the cabling between the arduino and the prototype is correct and that the inner workings of the register are ok
- Generate random number between 0 and 65535 and perform the following (many times)
- Move the value to the register (2 steps)
- Retrieve the value from the register and compare it (2 steps, retrieved value should be identical)
- perform an increment (1 step)
- Retrieve the value from the register and compare it with the locally incremented value(2 steps, retrieved value should be identical)
- Perform a decrement (1 step)
- Retrieve the value from the register and compare it (2 steps, retrieved value should be identical to original value)
- Perform a Reset (1 step)
- Retrieve the value from the register and compare it to 0 (2 steps)
The artduino will stop if an inconsistency between what is retrieved and what is expected is found.
This photo shows:
- The GPAR prototype on two breadboards using mainly 74xx193 and 74xx245
- the arduino mega used to perform the tests
- A logic analyser to measure the frequencies
The outcome is very positive from the features perspective : everything performs as expected.
However, it must be said that the arduino is quite slow and that the maximum test frequency is 9Khz, very far from the target in the Mhz area.
Here is a full cycle of tests:
- Line 1 is the clock
- Line 2 and 3 are the MSB_IN and LSB_IN signals enabling the move of 2 bytes as 1 16-bit value into the register
- Line 3 and 4 are MSB_OUT and LSB_OUT (active low) enabling the retrieval of the 16-bit value stored in the register as 2 bytes
- Line 5 is the increment signal
- Line 6 is the decrement signal
- The reset signal is not displayed
Unexpected issue
The address register is supposed to strictly work between the address x0000 and xFFFF, therefore the is no overflow detection. Therefore when the arduino program generated a value such as xFFFF, it was then incremented to become x0000 (no overflow), and then decremented and it stayed at x0000. Of course, the arduino flagged this as an error. The program was fixed to ignore this issue and consider the value ok.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.