Keyspan USB to serial adapter issues

Nineteen years ago using Realbasic 4.5 I wrote a software program to communicate with a RMV Electronics ITC232-A control chip (still sold to this day: https://www.rmv.com/NEWSITE/download.htm#3 ) which is hardware independent and will work with any terminal or computer with an RS-232 serial port. The home automation system this chip controls has been pumping for 19 year 24-7. The issue now is the Wallstreet Laptop with a serial port built has becoming obsolete. I recently purchased a KeySpan USA-19HS USB to serial adapter in hopes that could rewrite with software using a current Mac OS. I am now trying to use Xojo 2019 3.1 but have had no success sending and receiving serial data using the Keyspan adapter with current drivers. Previous communications with RB 4.5 where: baud = 9600k or 57000k, bits = 3, stop = 0, parity = 0. The ITC232-A has a reset pin that when activated will cause the chip to reset and send out “Welcome to RVC” which can be picked up by the serial control in Xojo. The data I do receive looks like diamonds with “?” marks in the middle. I receive a long list of these when the DataAvailable event fires (OutputArea.Text = OutputArea.Text + Me.Readall). I’m trying to keep it simple at this point to see if I can receive data through the Keyspan adapter. Any knowledge you can share with me on this would be appreciated. I am just restarting with Xojo so I am behind about 19 years in programing skills.

Thank,
Cliff

the keyspan with recent macos is a pain in … to make it work.
I’ve better success with totally cheap $1 usb to serial converter modules you can find on ebay
based on chg340 or ft232 or also cp2102. the drivers for these are available for macos, and the recent one too.
good luck.

edit: if you want something more “boxed” even these are ok and far cheaper than a keyspan.
https://www.ebay.com/itm/353032417657?ViewItem=&item=353032417657

Howdy Cliff,
I was using a Keyspan 19-HS yesterday with a RB2018 app … and it worked OK. Its driver was delivered by the Keyspan 4.04b installer (which still lives in my Downloads).
If you are getting a port to connect to, and actual data is getting through then it’s probably working OK.

However you may have an issue with 7 or 8 bit data. If you can ascB() each incoming byte that might be of help.
You also might confirm-double-triple check your baud rate is not being messed around by some handshaking code you may have, which ups the baud rate that Keyspan expects from 9600 to 57k.

Regards, Tony Barry
Sydney

Can you give me an example of how to use asc() on incoming data byte?

If I am following you Jean, I would remove the MAX232 RS-232 Interface IC from my project and replace it with the Arduino FT232RL FTDI USB 3.3V 5.5V to TTL Serial Adapter Module. I’m not familiar with how these interface with Xojo. More please.

yes you could replace the max232 with the ft232rl module, and so have a simple usb plug out of your project to go to the computer.
no more keyspan (they look today like really oldy things … I’ve not sold one in 10 years…)
the tx of your project goes to the rx of the ft232rl module, the rx to the tx. eventually +5v of the usb cable to your device ?
that’s quite simple. then you get a com port (on windows) or a serial input on the mac directly into xojo.

These are Xojo’s representation of non-printable characters. In the debugger, you can view the raw binary behind the strings; that might give you a clue as to what’s going on.

Jean I think your idea makes a lot of sense. I’m thinking for simplicity that a cable like this:

would be a solution although I’m believe the TTL voltages need to be 5 and not 3.3V. I’m not sure about that part since the RMV Electronics ITC232-A control chip uses 5V. Were do you find the correct drivers for Mac for FT232rl or FT232BL. What might be the diference between a FT232rl and FT232bl or does it mater?

https://www.ftdichip.com/Support/Documents/InstallGuides/Mac_OS_X_Installation_Guide.pdf

in a usb normalisation point of view, you should not use a cable “A type” like this one to output from a usb peripheral.
instead you should use a “B type” plug on the peripheral

it seems that the RL model is a ssop package, and the BL model a LQFP package.
I did not care about it as I buy complete modules (so with a RL model on it as it seems)
like this one :
https://www.ebay.com/itm/FTDI-USB-to-TTL-Serial-Adapter-Module-for-Arduino-Mini-Port-FT232RL-3-3V-5-5V/283610311245
this one you can also soldier directly on your ptoject, and leave the mini-usb plug exposed to connect a cable to the computer.

Beware - MacOS has its own FTDI drivers. If both the Apple drivers and FTDI drivers are installed, you will probably have problems, manifesting as a port that works once and then fails to be recognized after unplugging and re-plugging the cable, until the computer is restarted. You can see the device in USB prober, but it will not show up in a scan of virtual serial ports. Best is not to install the FTDI drivers at all, as the Apple drivers work fine, unless you’re using flow control, in which case the roles of CTS and RTS are swapped.

You’re right Julia, I don’t remember installing any driver at all for these modules.
I installed drivers for the chg340 or the cp2102 only.

I have ordered a couple of the FT232RL modules that Jean suggested since they have the option for 3.3 and 5V output.

Julia I took a look at the data in the debugger to see if I can figure anything out about the data being returned though the Keyspan adapter. I still only also see what looks like garbage. I tried a few different serial setting but still received the same junk. Discouraging. Good info on the drivers. You two are very kind to give me help on this project, so thanks. If you come up with any other thoughts please do share them with me.

Any FTDI chip based product is supported out of the box with recent OSX versions. You don’t even have to install the drivers. There are ttl level versions as well. I have a 3.3v and a 5v version of the “FTDI-Friend” style adafruit cable plugged into my laptop right now and no fewer than 11 various other FTDI based serial port devices connected to my home automation controller mac mini :wink: In addition to the standard plug in FTDI/RS232 devices the ttl level ones I use are something like this:
https://shop.evilmadscientist.com/productsmenu/accessories/210
I link to the EMSL page because it’s awesome and I was at college with the Evil Mad Scientist where I was lucky enough to be the stand partner with the laser holography professor in the local community orchestra and so he wasn’t mad if he found me in his lab even though it had nothing to do with my major and I wasn’t one of his students :wink:

I’ve never had trouble with the built in drivers on my house server and the FTDI based chips, but I do occasionally have difficulty with them on my laptop at my workdesk as I tend to put it to sleep and disconnect and reconnect it as I carry it around. Sometimes when reconnecting it won’t find the adaptors again and you have to unplug them and actually plug them into a different port on the USB hub in order to make them be found again. No idea why that is, but just be ready for the possibility. If the built in ones turn out to not work well for you that way you can still install the official FTDI drivers which are still available.

Years and years and years ago we used to recommend the Keyspan adaptors. They were pretty much the only thing available back then and in the early days of OSX their drivers were pretty rock solid. Unfortunately that is not the case anymore. I have 5 or 6 of them in the cabinet here but cannot use them and many of our users who upgrade their machines finally and need a serial adaptor get them just because it’s all we knew about for so long and they just don’t work reliably anymore at all. Go with an inexpensive FTDI based solution, either the RS232 and then not have to alter your other board, or the ttl one and remove some complexity. (though if it’s working just get the 232 one and don’t fix it!)

If you want to write a plugin for that chip for the home automation software that we write in Xojo let me know and I’ll comp you a copy to work with :slight_smile: I’m at https://MacHomeAutomation.com/ (capitalization not needed for DNS resolution but other wise it’s macho me automation which is just silly :wink: We’ve been doing this since Classic MacOS so for a long time too. I did the port to OSX in XoJo and have been having a ball with such things ever since.

This is what happens when both FTDI and Apple drivers are installed. If you google something like “MacOS won’t release serial ports” you will find it’s a common issue. Since removing all trace of the FTDI drivers on my MacBook, the issue hasn’t reappeared.

I’m currently working on a serial FTDI program. I access a Xilinx board by a JTAG (over USB). Initially I also got those diamonds with “?”. This was caused by wrong settings (Baud, StopBits, etc.) But as long as you got those weird chars it’s the sign you receive data! Just make sure you have all the settings (Flow Control, Baud, etc.) set the serial modem supports.

On one side I’m using Xojo’s SerialConnection and it’s working fine. On the other side I’m using FTDI drivers that I also could implement (DECLARE) and access the device as well. Maybe you have better luck with provided software of the USB hardware provider(?)

I’m also working on Mac (Catalina), latest Xojo version and had no driver problems so far (nor to install anything). I’m aware that existing OSs USB drivers can cause problems and needs to be unloaded/de-installed.

AH Interesting! I did not think I had both installed as I dont recall installing the FTDI drivers ever but I must have because they are both there! We’ll see what happens now that I’ve removed it! Thanks for the tip!

To answer you Farai, the WIZ232-A controller is very simple. It interfaces with TX and RX lines and nothing else other then GND. The controller takes data in as simple commands such as

ort onfiger erial rite alue and returns “OK” if received. Very straight forward to use. would reset the controller, aud <9600> would set the baud and return “OK”. All combinations of baud, etc are proving to be useless using the Keyspan adapter. I am waiting for the FTDI/RS232 thinking the Keyspan adapter is just not gong to work. I used the uninstall program in the Keyspan Serial Assistant app to remove the drivers but they do not seem to remove. I find no indication in the OS Library of the driver but the Keyspan Serial Assistant app still finds the port until I unplug it. Go figure.

James, I love what you are doing and encourage you to take it to the limits. At one time I had twenty five Apple 512 and SE computers in my attic waiting to be used to fulfill a dream of sharing what I felt was important for home automation, that being home energy conservation. The home I built over a 9 year period starting in 1983 (Commodore 64 days) was designed hand in hand with the automation system that still runs it 24/7 to this day. The energy usage for this 2700 sq ft home was less then $39 a month in Washington State for the first 15 years in operation. That included all the hot water I needed. Lots of trick things this system does to manage passive gain and the hydronic floor heating system and much more. Anyway I love the process of incorporating home automation into energy conservation and it pays in dividends if done correctly. Many sleepless night though developing the design.

James, my question to you since you work with these products and seem very knowledgeable: I have not yet got my head wrapped around the 3.3v or 5v that these FTDI chips output. From what I gather there is a strap or jumper that can be moved or bridged on the FTDI/RS232 devices to change the output side voltage on TX, RX, DTR, etc lines and in this case to my WIZ232-A control chip which is TTL 5v. I am assuming damage my occur if 3.3v is use to connect to the 5v TTL, but I’m not sure. Is the FTDI-Friend any different from the many other FTDI/RS232 devices available since I ordered one off Ebay that I hope has the 5V jumper that it claims it has. It appears you have a 5v FTDI-Friendly cable which also works with 5V TTL. This would streamline my hardware setup. I would just jumper out my MAX232 serial chip and go straight to the WIZ ITC232 chip. Sound about right?

James, I notice the FTDI-Friendly cable is out of stock. Do you think this cable is the same or do you have another source for the 5v TTL cables?