Well, I'm just flat tired of fighting with my DB-25M interface connectors, at first, I thought of LEDs with pull up resistors. After dinner, my mind wandered back to my cable tester, hey, an Arduino Mega, which I have a bunch of, has 52 digital pins. But wait I only need twenty-five. Sounds good to me. I have to start with a clean Mega as my donor, still has some wires which are a pain-in-the-you-know-what to unwrap without the right tool, and mine is currently MIA somewhere in the lab.
The Plan is stupidly simple.
First I will wire the connector to the Megas digital I/O pins 22 on the Mega to 1 on the DB25. Finishing with 46 on the Mega and 25 on the DB25. I already have a drilled ATRpolly for what I need.
Secondly, I can add an RS485 interface as well so I can check on that as well. Since my traffic has a byte for Source and Destination, I could, in fact, create a snoop tool just like we have for the ethernet.
Software
Pins.h
int pin[] = { 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46 };
Modes.h
for (int step = 22; step < 47; step++) {
pinMode(pin[ step ], INPUT_PULLUP); }
DB25Tester.c
#include <Pins.h>
#include <Modes.h>
void setup() {
Serial.begin(9600);}
void loop() {
begin(9600);}
int count;
do {
int temp[] = {0, 0, 0, 0, 0, 0, 0 ,0 ,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for ( int count = 0; count < 26; count++) {
temp[count] = digtalRead( pin[ count ]; }
Serial.write(pin, 25);
}while(true);
}
Top Comments