Arduino experts
Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team
Arduino experts
Hi,
I briefly dabbled with an arduino about 5 years ago and I am trying to build the project below but now having much luck.
https://github.com/ChrisDeadman/Usb2Ps2 ... c/main.cpp
I moved most of the libs to the folder /home/peters/snap/arduino/current/Arduino/libraries and squashed their folder structure but the PS2 lib doesn't build
Usb2Ps2Mouse:6:1: error: 'PS2PortSAMD21' does not name a type; did you mean 'PS2Port'?
PS2PortSAMD21 ps2Port;
^~~~~~~~~~~~~
PS2Port
I also moved it's files to the same as the project but that didn't work either.
I briefly dabbled with an arduino about 5 years ago and I am trying to build the project below but now having much luck.
https://github.com/ChrisDeadman/Usb2Ps2 ... c/main.cpp
I moved most of the libs to the folder /home/peters/snap/arduino/current/Arduino/libraries and squashed their folder structure but the PS2 lib doesn't build
Usb2Ps2Mouse:6:1: error: 'PS2PortSAMD21' does not name a type; did you mean 'PS2Port'?
PS2PortSAMD21 ps2Port;
^~~~~~~~~~~~~
PS2Port
I also moved it's files to the same as the project but that didn't work either.
Re: Arduino experts
This project is configured/structured to be compiled in PlatformIO IDE, not in Arduino IDE.
If you really want to compile it in Arduino IDE, you have to rename the main.cpp to Usb2Ps2.ino and place it inside Usb2Ps2 folder. Then you have to extract lib folder content to you Arduino library folder. You should keep the main folders (HIDMouseController, PS2Device, Utils), but move each src and include folders content to the main folder of the respective library. Finally, you have to install support (toolchain) for the SAMD (Cortex M0+) boards.
If you really want to compile it in Arduino IDE, you have to rename the main.cpp to Usb2Ps2.ino and place it inside Usb2Ps2 folder. Then you have to extract lib folder content to you Arduino library folder. You should keep the main folders (HIDMouseController, PS2Device, Utils), but move each src and include folders content to the main folder of the respective library. Finally, you have to install support (toolchain) for the SAMD (Cortex M0+) boards.
You do not have the required permissions to view the files attached to this post.
Re: Arduino experts
Thanks, I wasn't going to spot that.
I have all ready done most of what you describe but I am not clear which samd21 lib to install.
It looks like Platformio needs another ide (VSCode).
I have all ready done most of what you describe but I am not clear which samd21 lib to install.
It looks like Platformio needs another ide (VSCode).
Re: Arduino experts
Yes, PlatformIO is a VSCode plugin. Yet compiling anything bigger in Arduino IDE is a nightmare. It is good for single file 8-bit AVR projects.
You should choose the board you have, the project wiki mentions ATSAMD21G18 (SparkFun SAMD21 Mini Breakout). I have chosen a built-in Arduino SAMD board (Arduino M0 Pro), and it compiled fine.
You should choose the board you have, the project wiki mentions ATSAMD21G18 (SparkFun SAMD21 Mini Breakout). I have chosen a built-in Arduino SAMD board (Arduino M0 Pro), and it compiled fine.
Re: Arduino experts
The Arduino ide is a nightmare.
Re: Arduino experts
I am using Lubuntu 18.04 so I installed VS Code but the Platformio plug complained about python3-distutils being missing.
I tried to install it but keep getting a 404 error.
So I tried to upgrade Lubuntu but it looks like it cannot be upgraded past 18.04 since they changed the desktop !!
Not exactly convenient. I am really glad the Atari world doesn't do stuff like this.
I tried to install it but keep getting a 404 error.
So I tried to upgrade Lubuntu but it looks like it cannot be upgraded past 18.04 since they changed the desktop !!
Not exactly convenient. I am really glad the Atari world doesn't do stuff like this.
Re: Arduino experts
I found the missing Deb packages for Python 3.7 and installed them and VS Code was able to install the PlatformIO plugin.
Hopefully I can get this Arduino app built now but it might need a better Arduino, I think this is a nano clone.
If I can get the Mouse usb to ps/2 adapter to work then I might see what is needed for a keyboard version.
Thanks for the help.
Hopefully I can get this Arduino app built now but it might need a better Arduino, I think this is a nano clone.
If I can get the Mouse usb to ps/2 adapter to work then I might see what is needed for a keyboard version.
Thanks for the help.
Re: Arduino experts
No, this is not a Nano clone. Nano is a 8-bit AVR. Project requires a SparkFun SAMD21, which is a 32-bit ARM Cortex M0. It should be possible to make such adapter using Arduino Micro (ATmega32u4), but for sure it would require a lot of changes in the code. The entry level boards based on ATMega328P (Mini, Nano, UNO) are no-go, as they don't have a native USB support.
Re: Arduino experts
That's what I thought.
Started looking for a suitable board but got distracted by forcing lubuntu to update to version 20.
Started looking for a suitable board but got distracted by forcing lubuntu to update to version 20.
Re: Arduino experts
Would something like this be enough ?
https://www.seeedstudio.com/Seeeduino-X ... -4426.html
I think the original used was:
https://www.robotshop.com/uk/samd21-mic ... board.html
https://www.seeedstudio.com/Seeeduino-X ... -4426.html
I think the original used was:
https://www.robotshop.com/uk/samd21-mic ... board.html
Re: Arduino experts
I guess it should be enough, but may require a change in pin mapping. It doesn't support 5 V logic, so it would require a level-converting circuit.
I was wrong about Arduino Micro (ATmega32u4) - it doesn't support USB Host mode, it could work only the other way around, and emulate the USB mouse, but you can't attach USB to it.
I was wrong about Arduino Micro (ATmega32u4) - it doesn't support USB Host mode, it could work only the other way around, and emulate the USB mouse, but you can't attach USB to it.
Re: Arduino experts
I've ordered one of these:
https://www.ebay.co.uk/itm/USB-SAMD21-M ... 2749.l2649
I've all ready ordered a level converter for between the ps/2 connections and the arduino.
https://www.ebay.co.uk/itm/USB-SAMD21-M ... 2749.l2649
I've all ready ordered a level converter for between the ps/2 connections and the arduino.
Re: Arduino experts
There is a USB Host Shield for the 328/168 Arduinos that can be used for this. I have tested this myself (I actually make a USB keyboard/mouse/joystick -> IKBD adapter) but unfortunately the libraries has some issues with hubs.
Jo Even
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
Re: Arduino experts
I didn't think of that. I know very little about the arduino so I am trying to stay close to the original so I have a chance to get it working.
My ps/2 wireless mouse failed so I wanted to get it going as soon as possible. However it started working again after 3 hours of fiddling about. No idea why but it did this several years ago.
My plan is still to get a usb wireless mouse to work with the Milan
If that works then I might make a second one to try a wired usb keyboard but I have no idea how this stuff works at the moment.
It would be nice to get a wireless usb k&m combo to work but that would use one wireless usb dongle so I don't know if it would be possible.
My ps/2 wireless mouse failed so I wanted to get it going as soon as possible. However it started working again after 3 hours of fiddling about. No idea why but it did this several years ago.
My plan is still to get a usb wireless mouse to work with the Milan
If that works then I might make a second one to try a wired usb keyboard but I have no idea how this stuff works at the moment.
It would be nice to get a wireless usb k&m combo to work but that would use one wireless usb dongle so I don't know if it would be possible.
Re: Arduino experts
There is a shield, with own MCU, and embedded firmware. Not only it makes the device bigger, project more complicated, but the cost of a USB shield and Arduino Uno is much higher than the cost of Arduino SAMD and a level converter.joska wrote: ↑Mon Jan 11, 2021 9:25 amThere is a USB Host Shield for the 328/168 Arduinos that can be used for this.
Re: Arduino experts
I did not say that it was the best solution, just wanted to show that this can be done with the classic 168/328 Arduinos too. And there is a "mini"-version of this shield, you can get all the parts you need for this project for €7 including shipping.
But a SAMD21 clone is almost as cheap and a more tidy solution.
But a SAMD21 clone is almost as cheap and a more tidy solution.
Jo Even
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
Re: Arduino experts
My old Arduino+USB host shield solution works perfectly fine with a wireless keyboard+mouse combo. That's a USB->IKBD converter so it will not work on the Milan though. And the IKBD implementation is minimal, the project halted when I ran into problems with hubs and was never finished.
Jo Even
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
Re: Arduino experts
Some of the parts arrived so time to start soldering.
I realised that an old wireless k&m combo I had in a box has the necessary ps2 plugs and small plastic box that I am hoping I can fit the adapter into.
The level converter I got looks like it is bidirectional, it has 5V and 3.3V pins, I am not sure it is strictly needed. The photo on github shows just a 5V I think.
I realised that an old wireless k&m combo I had in a box has the necessary ps2 plugs and small plastic box that I am hoping I can fit the adapter into.
The level converter I got looks like it is bidirectional, it has 5V and 3.3V pins, I am not sure it is strictly needed. The photo on github shows just a 5V I think.