Using Arduino as a JP1 EEPROM adapter
Posted: Thu Aug 19, 2021 8:07 am
The JP1 EEPROM adapter needed to use RMIR with legacy JP1 remotes seems currently to be unavailable. Its only known supplier is DIYGadget, which has resisted all my recent attempts to contact it. TXSat advertises a JP1 cable that incorporates an FTDI chip along with such an adapter but that too has not replied to attempts to contact it. See the Market Place forum for links to these companies. Although I do have an adapter, for the benefit of other users I therefore decided to try the JP1 EEPROM Adapter using an Arduino dating from 2012 that is discussed in this thread and to report my results.
Two weeks ago I hardly knew what an Arduino was, so I bought an Arduino starter kit both to gain some general experience with it and in particular to try this adapter program. The board in the kit is an Arduino Mega 2560 clone, which is different from the Arduino Duemillanove clone on which the program was developed, so I expected a few problems.
It turned out that there really was only one problem. The program gave errors when I attempted to load it into my Arduino. The documentation with the program says that "the Arduino can easily be enlisted to cover the combo of USB serial driver and JP1 EEPROM programmer". These Arduino boards have several serial ports (four, in my case), one of which is connected to a built-in USB-to-Serial converter that is used to upload programs to the board. The program as written uses this one for data input, so that RMIR connects to the USB port on the board without the need for a separate USB-to-Serial converter. The loading errors indicated to me that this was not possible with my board. So I edited the program to use a different one of the board's serial ports, by simply changing "Serial" to "Serial1" in the few places it occurs, and then connecting a USB-to-Serial cable (in my case a Chip Partner one) to the Serial1 port of the board.
That was all that was needed. I did add a 10k pull up resistor to the SCL line, as Jeffs555 suggested, though haven't tried without it to see if it was necessary. Jeffs555 also says "the current [jp12serial] code sends out a 4 byte command that is not handled in the Arduino code" and he needed to patch the Arduino code to ignore this. As of v0.28 of jp12serial included in RMIR v2.13.0, a JP1 EEPROM Adapter is recognised before that command is issued, so it is never sent when an adapter is connected and that patching is not needed.
I did not experience the timing problems that Jeffs555 found. I have downloaded my URC8550, which has a 2k EEPROM, modified the setup, uploaded the change and downloaded again to check that the change took place, all without any problem. However, I see no harm in changing the timeout multipliers from 10ms to 20ms. As these are simply timeout settings, they should not affect the speed of operation of RMIR so I will make this change for the next release of RMIR, which I expect to make shortly. He also remarks that the Arduino code does not support EEPROM sizes larger than 2kbytes. I see no reason why that should be so, as the code certainly includes a setting for 4kbytes, but I have no way of testing whether that works.
Two weeks ago I hardly knew what an Arduino was, so I bought an Arduino starter kit both to gain some general experience with it and in particular to try this adapter program. The board in the kit is an Arduino Mega 2560 clone, which is different from the Arduino Duemillanove clone on which the program was developed, so I expected a few problems.
It turned out that there really was only one problem. The program gave errors when I attempted to load it into my Arduino. The documentation with the program says that "the Arduino can easily be enlisted to cover the combo of USB serial driver and JP1 EEPROM programmer". These Arduino boards have several serial ports (four, in my case), one of which is connected to a built-in USB-to-Serial converter that is used to upload programs to the board. The program as written uses this one for data input, so that RMIR connects to the USB port on the board without the need for a separate USB-to-Serial converter. The loading errors indicated to me that this was not possible with my board. So I edited the program to use a different one of the board's serial ports, by simply changing "Serial" to "Serial1" in the few places it occurs, and then connecting a USB-to-Serial cable (in my case a Chip Partner one) to the Serial1 port of the board.
That was all that was needed. I did add a 10k pull up resistor to the SCL line, as Jeffs555 suggested, though haven't tried without it to see if it was necessary. Jeffs555 also says "the current [jp12serial] code sends out a 4 byte command that is not handled in the Arduino code" and he needed to patch the Arduino code to ignore this. As of v0.28 of jp12serial included in RMIR v2.13.0, a JP1 EEPROM Adapter is recognised before that command is issued, so it is never sent when an adapter is connected and that patching is not needed.
I did not experience the timing problems that Jeffs555 found. I have downloaded my URC8550, which has a 2k EEPROM, modified the setup, uploaded the change and downloaded again to check that the change took place, all without any problem. However, I see no harm in changing the timeout multipliers from 10ms to 20ms. As these are simply timeout settings, they should not affect the speed of operation of RMIR so I will make this change for the next release of RMIR, which I expect to make shortly. He also remarks that the Arduino code does not support EEPROM sizes larger than 2kbytes. I see no reason why that should be so, as the code certainly includes a setting for 4kbytes, but I have no way of testing whether that works.