Sample EXTFSK.DLL JE3HHT Makoto Mori Translated into English by JA7UDE Oba ===== Introduction ===== EXTFSK.DLL is an MMTTY extension that interfaces MMTTY to a user-made hardware device. With EXTFSK.DLL included in this sample package, you can do the FSK keying and PTT control by using: (1) The legacy parallel port (USB-Parallel converter is not supported). (2) The legacy serial port and (3) USB serial adapter. This package includes EXTFSK.DLL and its source code files, so that you could make your own EXTFSK.DLL by referring to the source codes. For FSK keying, MMTTY has been using the UART (baud rate generator in the serial port hardware). This sample DLL, on the other hand, uses the multimedia timer of Windows, and the FSK keying is fully controlled by software. The FSK signal can be output not only from TXD but also from RTS or DTR of the serial port, and data or strobe of the parallel port. The signal polarity can even be reversed. The timing accuracy depends on the multimedia timer and the CPU performance, but I think the recent high-performance CPU would offer feasible results. According to my experiences, the jitter was about 1 msec for 165 msec code duration using Celeron 1.06GHz on Windows XP. Several JA HAMs on the Japanese MMHAMSOFT reflector reported that they successfully made the USB-serial adaptor and the legacy parallel port work for the FSK keying and PTT control. ===== Installation ===== If you use the parallel port for FSK keying and/or PTT on Windows NT, 2000, or XP operating system, you have to install DLPORTIO. See the next section for more information. The installation procedure is: 1) Place EXTFSK.DLL in the same directory where MMTTY.EXE is installed. 2) Open the TX page of MMTTY Setup window. Select EXTFSK from the drop-down list of PTT port. 3) Open the Misc page and select Sound+Com TxD (FSK) or Com Txd (FSK) at the TX port pane. 4) Push USB button and select A: Normal. You will have a small EXTFSK window popped up. 5) Select a COM or LPT port from the Port drop-down list. EXTFSK shows the status of the port that you have selected. If the status is NG, you should select another port. 6) Select the signals for FSK and PTT outputs. 7) To reverse the signal polarity, check Inv. FSK or Inv. PTT check boxes. 8) After setting the signal and polarity, you can push [...] button at the top right corner of the window to make it minimized. ===== FSK and PTT through parallel port ===== The sample EXTFSK uses DLPORTIO to access the I/O registers of the parallel port. You can download the freeware DLPORTIO package at http://pages.cthome.net/n1mm/html/English/Installation.htm Unzip the downloaded file. Copy three files, Dlportio\dll\TDLPortIO.dll, Dlportio\DriverLINX\drivers\DLPORTIO.dll, and Dlportio\DriverLINX\drivers\DLPORTIO.sys to the directory in which MMTTY is installed. ===== Usage notes ===== 1) This program uses a function call (EscapeCommFunction from TimeProc), which is not guaranteed in Windows API. This sample is working good on my PCs with Windows 2000 and Windows XP, but I am not sure if it works on every PC. 2) The timing of the generated FSK keying is dependent on the accuracy of the multimedia timer call-back function and the CPU performance. 3) This program generates only 45.45 Baud and 1.5 Stop bit protocol. 4) The source code is written by using C++Builder Version 3.0. You can modify or redistribute it without notifying me. ===== Interface to MMTTY ===== EXTFSK.DLL must export the following five functions: extern "C" LONG __declspec(dllexport) __stdcall extfskOpen(LONG para) extern "C" void __declspec(dllexport) __stdcall extfskClose(void) extern "C" LONG __declspec(dllexport) __stdcall extfskIsTxBusy(void) extern "C" void __declspec(dllexport) __stdcall extfskPutChar(BYTE c) extern "C" void __declspec(dllexport) __stdcall extfskSetPTT(LONG tx) Each function must comply with __stdcall call function (stack is adjusted on the called function side). The function name could be preceded by one underscore (_). For example, if MMTTY fails to find extfskOpen(), it then looks for _extfskOpen(). ----------------------------- LONG extfskOpen( LONG para ) ----------------------------- Parameters Upper 16 bits of para: Speed (45 for example) Lower 16 bits of para: b1-b0 Stop (0-1, 1-1.5, 2-2) b5-b2 Length (5, 6, 7 or 8) Returned value TRUE = succeeded FALSE = failed Note This function opens the port. Even if Stop 2 is specified, open with Stop 1.5. The sample code ignores the parameters and always opens with Baud = 45.45 and Stop = 1.5. ------------------------- void extfskClose( void ) ------------------------- Note This function closes the port. ---------------------------- LONG extfskIsTxBusy( void ) ---------------------------- Returned value TRUE = Buffer is full FALSE = Buffer is not full Note This function returns the buffer status, that is, full or not full. For clean diddling, keep the buffer length as small as possible. For making continuous transmission, however, the buffer should have at least one slot capacity. The sample code has one slot for the buffer. ------------------------------ void extfskPutChar( BYTE c ) ------------------------------ Parameter c: TX data Note This function writes a byte data to the buffer. Before writing the data, MMTTY always calls extfskIsTxBusy() to see if the buffer can accept the new data. ----------------------------- void extfskSetPTT( LONG tx ) ----------------------------- Parameter tx b0: 0 ? Switch to RX, 1 ? Switch to TX tx b1: 0 ? Not scanning RX image, 1 ? Scanning RX image (MMSSTV only) Note This function makes and breaks PTT. MMTTY uses bit 0 only. MMSSTV set bit 1 while it is scanning a RX image if RTS while scan option is enabled. 73, Mako