Win10 PC: How to toggle an accessable hardware logic pin?

Discussion in 'Computers, Hardware, and Operating Systems' started by WA7ARK, Feb 25, 2020.

ad: L-HROutlet
ad: l-rl
ad: Subscribe
ad: Left-3
ad: abrind-2
ad: L-MFJ
ad: Left-2
  1. WA7ARK

    WA7ARK Ham Member QRZ Page

    I have an requirement for a software/hardware solution for what I knew how to do years ago, using Basic and a parallel port...

    From a Windows10 computer, I would like some code that runs concurrently with other applications to generate a logic signal, synchronized with the computer's real time clock, that toggles a bit in some accessible hardware connector (real serial port, USB serial port, Arduino plugged into a USB?).

    For example, I might want a logic bit to go high within a few ms of when the computer's RTC reaches an even minute, and to go back low when the RTC rolls to an odd minute. A timing resolution of even a few 10s of ms is good enough.

    Under DOS, I knew how to do this using basic and a parallel port. Under windowsXP, I knew how to do this using VisualBasic, but how do I do something like this today?

    Any body help me?
     
  2. W9WQA

    W9WQA Ham Member QRZ Page

    wish we could, i had great fun doing assm in ;debug"
    ms gives free ? basic but its not ez like gw was. dont know if it does ports.
    its like ?small basic, cant remember...
    try ms basic
     
  3. KA9JLM

    KA9JLM Ham Member QRZ Page

    K0UO likes this.
  4. W7UUU

    W7UUU Super Moderator Lifetime Member 133 Administrator Volunteer Moderator Platinum Subscriber Life Member QRZ Page

  5. WA7ARK

    WA7ARK Ham Member QRZ Page

    I read through the documentation, but do not see how to get it to control a hardware port pin. It makes no mention of hardware serial COM ports.

    Three physical actions that I might be able to detect that autoit can initiate are:
    Open/Close a CD tray (quite primitive)
    Play a sound file. ( guess I could send tones out the audio jack and decode them).
    Beep (easier)
     
    Last edited: Feb 26, 2020
  6. KA9JLM

    KA9JLM Ham Member QRZ Page

    You normally use the system .DLL files to call the I/O functions that you want.

    Here is a website that explains the functions in the Windows 10 DLL system files.

    http://windows10dll.nirsoft.net/

    It is a Can Do, With a little homework. :)
     
  7. W5UAA

    W5UAA Ham Member QRZ Page

    Looks to me like the best way to accomplish this is through the Win32 API.

    https://docs.microsoft.com/en-us/windows/win32/sysinfo/time-functions

    https://www.xanthium.in/Controlling-DTR-and-RTS-pins-of-SerialPort-using-Win32-API

    But it'll take some effort. You may have to do some date/time conversion. And there might be some permission issues you have to work your way through to get directly to one of the RS-232 pins. Microsoft doesn't like it when people try to access the hardware directly anymore.
     
    KA9JLM likes this.
  8. N3DT

    N3DT Ham Member QRZ Page

    I use a 2N2222, 10K resistor and a couple 1N914's to key the DTR for FT8 from a usb to DB9 com port adapter with WSJT-X so it is doable. But don't ask me how in the software.
     
  9. KA9JLM

    KA9JLM Ham Member QRZ Page

    Exactly.

    That is what AutoIt lets you do using DLL calls, To directly control system I/O.

    And the code that you make is blessed by the Windows OS.
     
  10. K7MEM

    K7MEM Ham Member QRZ Page

    Another possible option would be to access external ports from Cygwin. Then you can write C or C++ or something else. I use Cygwin regularly to run a antenna simulator written in C and run the Veriwell Verilog Simuator. And it all runs within a Windows 10 machine.
     

Share This Page