Hi everybody. This is my first post here, so I think a few words about what brought me here would be adequate, but you can also skip this and go right to the actual problem description.
Years ago I made a driver PCB for a 3D router that connects to the old 25 pin printer port. It offered 8 GPIO pins, nine if you used the status bit. I controlled 3 4-phase stepper motors: the lower 4 bits opened one of the 4 phase-outputs of all motors (in parallel), the next 3 bits were used to open the connection to ground of one of the motors. So I could sequentially / selectively control 3 motors by 7 GPIOs. It worked perfectly. Just as info: the data pins went through a diode, then through a 3K resistor, it was designed not to draw more than 2.5mA per pin.
But as you know, parallel ports became rare. and I wanted to use my driver board with a current windows laptop. So I bought an arduino with the intention to use it as a flexible port substitute. All I needed was to forward 7 bits to 7 pins, with say at least about 1kHz speed.
I then noticed that there aren't so many simple solutions out there, to communicate over the serial port with the arduino BY CODE. I mean, I write an app and my app should be able to directly communicate with the arduino. I tried a lot of stuff, spent many days, read many articles,including from here, installed a lot of things. (That I evaded CPP all my life didn't help either)
Finally I found a CPP code snippet for COM port comm, but as I'm a bloody CPP beginner (for life), I thought those randomly sprinkled characters were part of the code, while they were what appears to be a forum-script bug that adds some random chars to a posted code (imagine that). However, I manage to get it compiled with MinGW and working (one shot send receive test), and then even mastered to turn it into a dll that I can use with my beloved Blitz3D compiler (Which I use since decades, explaining why I never went full CPP)
Anyway, long story short, the actual problem is:
To test my dll, I use a loop that sends packets that cause the arduino to do a motor job, then receives a status packet by the arduino. I was debugging this already for days when I realized my code was working, but it is the Arduino that is going into setup() again. I nailed it down to the moment windows is starting to receive the answer. I noticed many articles about undesired autoreboot and read them.
I tried to connect with DTR off, but the Arduino then ignores the call. I can also rule out all other reasons, like power drop etc.
I've seen this:
that basically says this is not a bug, but a feature, so I was beginning to think my efforts were all in vain.
Sure the arduino will remain a cool thing on my bench, I successfully made other things, like driving LED displays etc. But as a substitute for a parallel port I may have to look for other ways.
Still, I'd be really happy if I could make this work. Somebody said something about suppressing the autoboot in DTR context. but that trace ended in some 404s. So if anybody has a suggestion about how to solve this particular problem, I'd be very glad. Again: all I want is to forward 7 bits from windows to my PCB. (Without to use my monitor for optical coupling at 60Hz lol). And yes, it needs to be bidirectional, so I can make a checksum based data integrity protocol that re-orders corrupted packets.
Arduino Uno R3 compatible Velleman, Win10 home. As stated, a max of 2.5mA draw per GPIO (pin 2 to 8). But a power issue was ruled out definitely.
Thank you!