JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Best options to program JP1 remotes with USB in 2021!
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Hardware
View previous topic :: View next topic  
Author Message
Carwarr



Joined: 30 Dec 2003
Posts: 80
Location: Las Vegas, NV

                    
PostPosted: Fri Dec 10, 2021 2:47 am    Post subject: Reply with quote

mathdon wrote:
All that is required of hardware is a Nano clone with pins, a mini USB lead (NOT a micro USB one) to connect the Nano to the PC and five female-to-female Dupont patch cables. One of these is to connect pins 1 and 2 of the remote's 6-pin connector together, the other four connect the other connector pins to the Nano as follows: pin 3 to Nano GND, pin 4 to Nano A4, pin 5 to Nano GND (there are two Nano GND pins so this does not conflict with pin 3) and pin 6 to Nano A5.

Great news! I am glad that I started this whole thread! Smile
I had ordered a Arduino Mega 2560 and have been waiting for it to come from China before you started all your work with the Nano.
I will probably try to get it to work with the Mega, but if not, I will just buy a Nano Every.
Thanks for everything.
Mitch
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Fri Dec 10, 2021 8:01 am    Post subject: Reply with quote

Carwarr wrote:
Great news! I am glad that I started this whole thread!

So am I, as it has given me an incentive to find out why the Mega 2560 would not work through its USB port Smile .

Quote:
I had ordered a Arduino Mega 2560 and have been waiting for it to come from China before you started all your work with the Nano.
I will probably try to get it to work with the Mega, but if not, I will just buy a Nano Every.

I am glad about that, too, as I now have someone else who can test my fixes for the Mega 2560 so please try to get it working with it. You should certainly be able to do so and I am happy to help if needed.

To use the Mega 2560 through its USB port, without a JP1.2/3 cable, you will need RMIR v2.13.5 which I shall shortly post in the RMIR Development folder. In that version the Options > Advanced menu will have an option "Find all Arduino". You need to select that option. It is persistent, in that once set it will remain set in all instances of RMIR until you deselect it, so you only have to do this once. It also takes effect immediately, so you don't have to close and re-open RMIR before using it with a JP1 remote. The only other difference from the instructions I gave for the Nano is that pin 4 of the remote's 6-pin connector goes to SDA and pin 6 to SCL on the Mega 2560 rather than to A4 and A5, as A4 and A5 are dual function pins on the Nano but separate single-function pins on the Mega. If, like me, you use Dupont patch cables and have a Mega board with sockets rather than pins then you will need male-to-female ones for those connections.

I hope you will try it connected in this way, but if you also have a JP1.2/3 cable then you can use the Mega 2560 as a JP1 EEPROM adapter with the current RMIR version, or if using v2.13.5 then with or without the "Find all Arduino" option selected. The connections for the JP1.2/3 cable are its pin 3 to Arduino GND (the Mega has 3 GND pins and only 2 are used by the connections to the remote), its pin 4 to Arduino RX0 (which may just be labelled RX) and its pin 6 to TX0 (or just TX). Just those three connections, but you need to have both the Arduino USB cable and the JP1.2/3 cable plugged in to USB ports, the Arduino one to power the board and the JP1.2/3 one to send the signals. I suggest setting Remote > Interface of the RMIR menu to JP1.X Serial and selecting the port as that of the JP1.2/3 cable to avoid any confusion or spurious signals being sent to the Arduino.

Do please let me know when the Mega 2560 arrives and how you get on with it.
_________________
Graham
Back to top
View user's profile Send private message
Carwarr



Joined: 30 Dec 2003
Posts: 80
Location: Las Vegas, NV

                    
PostPosted: Fri Dec 10, 2021 1:18 pm    Post subject: Reply with quote

mathdon wrote:
Carwarr wrote:
Great news! I am glad that I started this whole thread!

So am I, as it has given me an incentive to find out why the Mega 2560 would not work through its USB port Smile .

I am glad about that, too, as I now have someone else who can test my fixes for the Mega 2560 so please try to get it working with it. You should certainly be able to do so and I am happy to help if needed.


I sure will give it a try and let you know. Thanks for the detailed instructions.
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Sat Dec 11, 2021 11:03 am    Post subject: Reply with quote

I reported earlier that the Chinese clone of the original Arduino Nano works with the current RMIR, v2.13.2. I have since found in repeat testing that this is erratic. It is sometimes recognised by that version of RMIR, but not always. This is due to some variability in its timings, a property that it shares with the Mega 2560. I will fix this in RMIR v2.13.5 but it will have two consequences. To be reliably recognised, the new option FindAllArduino will need to be selected, and when selected, it will impose a delay of around 3 seconds on the identification of all other remotes, too. So users with both JP1 EEPROM remotes and other remotes will probably want to deselect this option after use so that RMIR behaves as at present for non-EEPROM remotes. Of course, users who do not use an Arduino as an interface will never select this option and will be entirely unaffected by this change.
_________________
Graham
Back to top
View user's profile Send private message
Carwarr



Joined: 30 Dec 2003
Posts: 80
Location: Las Vegas, NV

                    
PostPosted: Sat Dec 11, 2021 4:08 pm    Post subject: Reply with quote

mathdon wrote:
I reported earlier that the Chinese clone of the original Arduino Nano works with the current RMIR, v2.13.2. I have since found in repeat testing that this is erratic. It is sometimes recognised by that version of RMIR, but not always. This is due to some variability in its timings, a property that it shares with the Mega 2560. I will fix this in RMIR v2.13.5 but it will have two consequences. To be reliably recognised, the new option FindAllArduino will need to be selected, and when selected, it will impose a delay of around 3 seconds on the identification of all other remotes, too. So users with both JP1 EEPROM remotes and other remotes will probably want to deselect this option after use so that RMIR behaves as at present for non-EEPROM remotes. Of course, users who do not use an Arduino as an interface will never select this option and will be entirely unaffected by this change.

Sounds like some great options. Glad you found that out. I will do my best to test out what I find when I get my clones. Still sounds like the Nano Every will probably be the best for most people, but I really appreciate your efforts to make it work with even the clones. I know that is not an easy task but sure seems like you are up to it!
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Sun Dec 12, 2021 2:25 pm    Post subject: Reply with quote

Just an update on my previous post. I have found a fix for RMIR v2.13.5 that handles both the behaviour of the Mega 2560 (which resets the processor) and of the Nano (clone) and Nano Every (which both require a delay but not because of a processor reset). With FindAllArduino selected, there is a delay of 2 seconds in the identification of all remotes, in addition to the processing delay already present in the current version. With this option deselected, timing is as in the present version but of course the Arduino Nano and Nano Every then may not be identified and the Mega 2560 certainly will not. The 20 second delay that mentioned in earlier posts has now totally disappeared. I mentioned 3 seconds in my previous post but have managed to cut that to 2 seconds, as repeated experiments with accurate timing have never found that more than 1.5 seconds is required, so I have used 2 seconds just to be safe.

I have now repeatedly tested all of the Mega 2560, Nano clone and Nano Every on both Windows 10 and Windows XP. I will test on Linux 64-bit Ubuntu before posting anything, but as it is clear that the need for the delay is due to Arduino behaviour and nothing to do with the PC, I am confident that nothing further will need to be changed.

Carwarr, I agree with you that the Nano Every is the best for someone buying an Arduino specially for this purpose, but others may prefer the Nano clone as it is cheaper, though they may need to buy a mini USB cable too if they do not have one. I think everyone has a micro USB cable that is what the Nano Every uses.
_________________
Graham
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Tue Dec 14, 2021 2:01 pm    Post subject: Reply with quote

I have now tested all of the Mega 2560, Nano clone and Nano Every on 64-bit Ubuntu 20.4 and they behave just as they do on Windows, so will shortly be posting RMIR v2.13.5 in the RMIR Development folder for testing.

The rest of this post is for total nerds like me who have a curiosity about things that no-one will actually want to use. My tests mentioned above are using the Arduino as a complete JP1 EEPROM interface through its USB port. For my nerdy personal satisfaction, I have also tested all three boards as a JP1 EEPROM Adapter connected to the PC with a JP1.2/3 cable. There is no reason that anyone would want to do this, as all the boards work perfectly as a complete interface, but I am reporting it as I came across a difference between the original Arduino Nano and the newer Nano Every that I have not found documented anywhere. When used as an adapter, the connections to the JP1.2/3 cable are its pin 3 (GND) to Arduino GND, its pin 4 (TXD) to Arduino RX and its pin 6 (RXD) to Arduino TX. The Nano and Nano Every seem to be described everywhere as pin-compatible, and indeed the pins are in the same positions and have the same labels on both boards. But what I found was that the RX and TX pins have different functionality on the two boards. The original Arduino program by Tim6502 works unchanged on the Nano when used as an adapter, just as it does when used as a complete interface, as the TX and RX pins of the Arduino board are connected to the corresponding pins of the FTDI (or in the case of a clone, the CH340) chip used by its USB port. But on the Nano Every, the serial lines from the USB port are RX0 and TX0, corresponding to the Serial function of Arduino software but the RX and TX pins of the board are actually RX1 and TX1, corresponding to the Serial1 function. So all references to Serial in the software of Tim6502 need to be changed to Serial1 to work with the Nano Every as an adapter. Even the latest Arduino documentation about its Serial function says that the only board which supports Serial1 is the Mega. It looks as if no documentation has yet been updated to take account of the Nano Every, so I thought this worth recording here.
_________________
Graham
Back to top
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 1402
Location: Munich, Germany

                    
PostPosted: Tue Dec 14, 2021 2:48 pm    Post subject: Reply with quote

I have checked in Tim6502/Kevin Timmerman's Arduino sketch as https://sourceforge.net/p/controlremote/code/HEAD/tree/trunk/eeprom/ (alternatively svn://svn.code.sf.net/p/controlremote/code/trunk/eeprom) in SVN. I also fixed two compiler warnings in the Arduino code.

As I understand it, this issue has very few stake holders. I do not own an EEPROM remote myself, so I am hardly going to contribute anything. But still I would like to make some comments:

The Arduino sketch (as Arduino "programs" are commonly called) is a very simple one, and can be executed on basically anything. Only the I2C bus (signals/pins SCA and SCL) is used. There is no real advantage of a "modern" one (like Nano Every), unless you want to use it for anything else. Personally, I buy Nano "clones" in batches of 5 or 10 in particular for this project. (This already uses the SCA and SCL pins (A4, A5)), but I think it should not interfere with the usage as EEPROM programmer, since the LED between those pins is of fairly high impedance.)

Also note that the most modern boards (not the Nano Every though) uses 3.3 Volt logic; connecting to a 5V logic remote may smell trouble...

I think the timing problem is due to a reset when DTR (of the USB chip) goes active, see https://store.arduino.cc/products/arduino-nano section "Automatic (Software) Reset". Comparing with the same section for the UNO board shows that it is designed to be able to circumvent with a hardware hack (although reversible only for us with soldering iron...) Removing the boot loader may be another possibility.

If I have misunderstood something, please correct me.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Wed Dec 15, 2021 7:26 am    Post subject: Reply with quote

Barf wrote:
I have checked in Tim6502/Kevin Timmerman's Arduino sketch as https://sourceforge.net/p/controlremote/code/HEAD/tree/trunk/eeprom/ (alternatively svn://svn.code.sf.net/p/controlremote/code/trunk/eeprom) in SVN. I also fixed two compiler warnings in the Arduino code.

Many thanks for doing this. Prompted by this, I will include the .ino file and instructions for using the Arduino as a JP1 EEPROM interface in v2.13.5 of RMIR, to avoid the need to refer to forum posts that may become buried as time goes on.

Quote:
As I understand it, this issue has very few stake holders.

Absolutely Smile .

Quote:
There is no real advantage of a "modern" one (like Nano Every), unless you want to use it for anything else.

Agreed. The main advantage, as I see it, is the use of a USB micro port which is a very common connector rather than the USB mini port of the Nano and its clones which nowadays is a pretty rare connector. As a genuine Nano Every, which provides a complete JP1 EEPROM interface, is cheaper than the last price ($17.99) from DIYGadget for a now-unobtainable JP1.2/3 to JP1 Adapter which needs a JP1.2/3 cable as well, it seems not unreasonable to recommend it. But a Nano clone does the job equally well, as I believe my posts make clear.

Quote:
I think the timing problem is due to a reset when DTR (of the USB chip) goes active, see https://store.arduino.cc/products/arduino-nano section "Automatic (Software) Reset".

Many thanks for pointing this out, which had escaped my notice. I am glad that I now understand what is happening, and I see that the recommendation of waiting a second before sending data agrees with what I am now doing, except that I have found that a little more than one second is needed, so I use 2 seconds for safety.

Quote:
If I have misunderstood something, please correct me.

No, you have not misunderstood anything. I see no conflict between what you and I have written.
_________________
Graham
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Wed Dec 15, 2021 1:39 pm    Post subject: Reply with quote

I have now uploaded development build RMIR v2.13.5 to the RMIR Development folder on SourceForge. This build adds support for Arduino boards used as complete interfaces to JP1 EEPROM remotes through their USB port (no JP1.2/3 cable required). It includes an upgrade of the JP12serial library from v0.30 to v0.31 which is needed to provide the additional functionality needed to support such interfaces.

The Options > Advanced menu has a new persistent option, Find all Arduino, that should be selected when using an Arduino in this way. Remotes other than JP1 EEPROM ones will still be identified as usual when this option is selected, but it delays their identification by 2 seconds so the option should be deselected when RMIR is used with such a remote if this delay is unacceptable.

Build 5 also includes a new folder, JP1EEPROMSupport, in its installation folder that contains detailed instructions for building such a JP1 EEPROM interface with an Arduino Nano, Nano Every or a clone, together with the Arduino sketch (Arduino's name for a program) that needs to be uploaded to the Arduino board for it to act as such an interface. No soldering is required and no hardware other than the Arduino board and connecting leads that are described in the instructions.
_________________
Graham
Back to top
View user's profile Send private message
StephenR0



Joined: 12 Feb 2007
Posts: 109
Location: Iowa, US

                    
PostPosted: Thu Dec 16, 2021 7:46 pm    Post subject: Reply with quote

This worked perfectly. Thank you so much for all your hard work. I used headers on my nano clone. I think I might solder the cable directly to make it a little more robust. But it certainly works.
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Fri Dec 17, 2021 6:29 am    Post subject: Reply with quote

StephenR0 wrote:
This worked perfectly. Thank you so much for all your hard work.

Many thanks for the feedback, it makes all the effort worthwhile when I get comments like this.
_________________
Graham
Back to top
View user's profile Send private message
Carwarr



Joined: 30 Dec 2003
Posts: 80
Location: Las Vegas, NV

                    
PostPosted: Sun Dec 19, 2021 2:58 am    Post subject: Reply with quote

mathdon wrote:
To use the Mega 2560 through its USB port, without a JP1.2/3 cable, you will need RMIR v2.13.5 which I shall shortly post in the RMIR Development folder. In that version the Options > Advanced menu will have an option "Find all Arduino". You need to select that option. It is persistent, in that once set it will remain set in all instances of RMIR until you deselect it, so you only have to do this once. It also takes effect immediately, so you don't have to close and re-open RMIR before using it with a JP1 remote. The only other difference from the instructions I gave for the Nano is that pin 4 of the remote's 6-pin connector goes to SDA and pin 6 to SCL on the Mega 2560 rather than to A4 and A5, as A4 and A5 are dual function pins on the Nano but separate single-function pins on the Mega. If, like me, you use Dupont patch cables and have a Mega board with sockets rather than pins then you will need male-to-female ones for those connections.

So I got my clone Mega 2560 from China today.
After finding the USB drivers online for the CH340 that is the Mega, I loaded the software into it.
Since I did not have any dupont type jumpers/connectors, I dug around in my junk boxes to find an old IDE connector I could use to plug into the remote and wire to the Mega.
Found a 10 pin IDE and after chopping it half apart and finding the right wires, I wired it up as you stated.
Installed the new RMIR v2.13.5 and selected "Find all Arduino".
Clicked download arrow, figuring something I soldered together would be wrong or plugged into the wrong socket on the MEGA even though I triple checked and IT WORKED PERFECTLY!
Made changes, uploaded and verified and all is working as if it was NOT something I slapped together with bubblegum and spit!
Thanks for all the work you did.
If you want to see how hacky it looks right now, you can check it out here:
https://i.imgur.com/Gw3ndC4.jpg

Anything else you want me to test with this config, just let me know.
Mitch


Last edited by Carwarr on Mon Dec 20, 2021 4:00 am; edited 2 times in total
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4515
Location: Cambridge, UK

                    
PostPosted: Sun Dec 19, 2021 7:54 am    Post subject: Reply with quote

Carwarr wrote:
Clicked download arrow, figuring something I soldered together would be wrong or plugged into the wrong socket on the MEGA even though I triple checked and IT WORKED PERFECTLY!

Many thanks for the feedback, I am delighted to know that it all works with your Mega.

When I wrote those instructions for you, I had forgotten that the CH340 driver does not load automatically with plug-and-play. By the time I posted RMIR v2.13.5, though, I had remembered and so the Instructions.txt file in the JP1EEPROMSupport folder gives a link to the required driver.

I would like to see the pic you posted, but I get "access denied" when I click that link. See this post for the recommended way to post images. Note, however, that when the image is not crucial to the post, as here, then it is better to post a link to the image on imgur.com rather than include the image in the post.

Quote:
Anything else you want me to test with this config, just let me know.

Thanks for the offer of further testing, but I am happy now that everything works as I had intended, so no further testing needed.
_________________
Graham
Back to top
View user's profile Send private message
Carwarr



Joined: 30 Dec 2003
Posts: 80
Location: Las Vegas, NV

                    
PostPosted: Mon Dec 20, 2021 4:04 am    Post subject: Reply with quote

mathdon wrote:

I would like to see the pic you posted, but I get "access denied" when I click that link. See this post for the recommended way to post images. Note, however, that when the image is not crucial to the post, as here, then it is better to post a link to the image on imgur.com rather than include the image in the post.

OK, I updated the post above with the imgur link. I knew that google drive link would be problems. Thanks for the info on adding an image in a message as I knew there had to be a way, just didn't think to look at the sticky in the beginners forum. I did as you suggested and just added the link instead of the image itself.
Mitch
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Hardware All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control