diff --git a/PCB/Gerber_USBvalve-1.2_A-PCB.zip b/PCB/Gerber_USBvalve-1.2_A-PCB.zip
new file mode 100644
index 0000000..6284c85
Binary files /dev/null and b/PCB/Gerber_USBvalve-1.2_A-PCB.zip differ
diff --git a/PCB/Gerber_USBvalve-1.2_B-PCB.zip b/PCB/Gerber_USBvalve-1.2_B-PCB.zip
new file mode 100644
index 0000000..1828211
Binary files /dev/null and b/PCB/Gerber_USBvalve-1.2_B-PCB.zip differ
diff --git a/README.md b/README.md
index 01e92fb..3f471d8 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,12 @@ With **USBvalve** you can have an immediate feedback about what happen to the dr
+and from version `0.8.0` you can also use it as USB Host to detect *BADUSB* devices:
+
+
+
+
+
## Repository Structure
@@ -41,24 +47,31 @@ If you want to build your own, you need:
### Building instructions
-Almost all the job is done directly on the board by the software, so you just need to arrange the connection with the OLED for output
+Almost all the job is done directly on the board by the software, so you just need to arrange the connection with the OLED for output.
+
+Starting from version 0.8.0 of the firmware, **USBvalve** can detect HID devices (used to detect *BADUSB*). This require an additional USB port behaving as Host. If you are not interested in this, you can use the old instructions [in docs folder](https://github.com/cecio/USBvalve/blob/main/docs/BUILDING-1.1.md) and use PCB version `1.1`. Otherwise go ahead with PCB version `1.2` (we have version for USB-A or USB-B, see folder).
#### With USBvalve PCB
-
-
+
+
+
- place the Raspberry Pi Pico on the silk screen on the front
- you don't need to solder all the PINs. Just the following:
- D4 and D5 (left side)
- - GND (right side)
+ - D14 and D15 (left side)
+ - GND (right side, third pin from the top)
+ - GND (right side, third pin from the bottom)
- 3v3_OUT (right side)
+ - VBUS (right side)
- the 3 DEBUG pin on the bottom: SWCLK, GND and SWDIO
- place the 3D printer spacer or a piece of tape on the parts of the OLED that my touch the Raspberry
- solder the OLED (with a header) on the 4 PIN space
+- solder a USB female port in `USBH` area. This is for version `A`, but there is a version for USB `Micro-B` as well if you prefer
Some of the OLEDs have the GND and VCC PINs swapped, so I built the PCB to be compatible with both versions:
@@ -78,14 +91,18 @@ Otherwise you should the opposite and place the solder on the other PADs:
-If you are using a breadboard or just wiring, all you have to do is to ensure to connect the proper PINs at the OLED screen.
+If you are using a breadboard or just wiring, all you have to do is to ensure to connect the proper PINs at the OLED screen and to the Host USB port.
The mapping is the following:
- PIN6 of Pi --> OLED SDA
- PIN7 of Pi --> OLED SCL
+- PIN19 of Pi --> D+ of USB Host
+- PIN20 of Pi --> D- of USB Host
+- PIN23 (GND) of Pi --> GND of USB Host
- PIN38 (GND) of Pi --> OLED GND
- PIN36 (3V3OUT) of Pi --> OLED VCC
+- PIN40 (VBUS) of Pi --> VCC of USB Host
If you want to use the DEBUG functions, you can also place a header on the 3 SWD PINs at the bottom of the board.
@@ -105,10 +122,10 @@ It's done!
Obviously you can also build your own firmware. To build the *standard* one I used:
-- Arduino IDE 2.0.4
+- Arduino IDE 2.1.0
- ~~as board I used `Raspberry Pi Pico - Arduino MBED OS RP2040` version `4.0.2`~~
- ~~`Adafruit TinyUSB Library` version `1.14.4`. Newer versions are not working because the RPI SDK of the board is stick to an older version. May be migrate the entire project directly on Raspberry Pi Pico SDK is the solution here.~~
-- from version `0.7.0` I used `Adafruit TinyUSB Library` version `2.0.1` and Board `Raspberry Pi RP2040 (2.7.0)`
+- from version `0.7.0` I used `Adafruit TinyUSB Library` version `2.1.0` and Board `Raspberry Pi RP2040 (2.7.0)`
- `ssd1306` OLED library version `1.8.3`
If you want to re-create a new fake filesystem, you may want to have a look to the `utils` folder, where I placed some utilities to build a new one.
diff --git a/USBvalve/USBvalve.ino b/USBvalve/USBvalve.ino
index 7bb18c8..fc238ff 100644
--- a/USBvalve/USBvalve.ino
+++ b/USBvalve/USBvalve.ino
@@ -74,7 +74,7 @@ bool activeState = false;
//
// USBvalve globals
//
-#define VERSION "USBvalve - 0.8.0"
+#define VERSION "USBvalve - 0.8.1"
boolean readme = false;
boolean autorun = false;
boolean written = false;
diff --git a/docs/BUILDING-1.1.md b/docs/BUILDING-1.1.md
new file mode 100644
index 0000000..3b69c62
--- /dev/null
+++ b/docs/BUILDING-1.1.md
@@ -0,0 +1,58 @@
+#### With USBvalve PCB
+
+
+
+
+
+
+
+- place the Raspberry Pi Pico on the silk screen on the front
+- you don't need to solder all the PINs. Just the following:
+ - D4 and D5 (left side)
+ - GND (right side)
+ - 3v3_OUT (right side)
+ - the 3 DEBUG pin on the bottom: SWCLK, GND and SWDIO
+- place the 3D printer spacer or a piece of tape on the parts of the OLED that my touch the Raspberry
+- solder the OLED (with a header) on the 4 PIN space
+
+Some of the OLEDs have the GND and VCC PINs swapped, so I built the PCB to be compatible with both versions:
+
+For example if your OLED has GND on PIN1 and VCC on PIN2 like this:
+
+
+
+You have to place a blob of solder on these two pads on the back of the PCB:
+
+
+
+Otherwise you should the opposite and place the solder on the other PADs:
+
+
+
+#### Without USBvalve PCB
+
+
+
+If you are using a breadboard or just wiring, all you have to do is to ensure to connect the proper PINs at the OLED screen.
+
+The mapping is the following:
+
+- PIN6 of Pi --> OLED SDA
+- PIN7 of Pi --> OLED SCL
+- PIN38 (GND) of Pi --> OLED GND
+- PIN36 (3V3OUT) of Pi --> OLED VCC
+
+If you want to use the DEBUG functions, you can also place a header on the 3 SWD PINs at the bottom of the board.
+
+### Flash Firmware
+
+To flash the firmware, follow these steps:
+
+- Connect the Raspberry Pi Pico with the USB cable, by keeping the *BOOTSEL* button pressed (the big white button on the board)
+- release the button
+- you will see a new drive on the system, named `RPI-RP2` (in Linux envs you may have to manually mount it)
+- copy the proper firmware file (with extension `uf2`) in the folder, depending on the OLED you used
+- wait few seconds until the mounted folder disappear
+
+It's done!
+
diff --git a/firmware/USBvalve-0.7.0-32.uf2 b/firmware/USBvalve-0.8.1-32.uf2
similarity index 70%
rename from firmware/USBvalve-0.7.0-32.uf2
rename to firmware/USBvalve-0.8.1-32.uf2
index 1df346f..1201f60 100644
Binary files a/firmware/USBvalve-0.7.0-32.uf2 and b/firmware/USBvalve-0.8.1-32.uf2 differ
diff --git a/firmware/USBvalve-0.7.0-64.uf2 b/firmware/USBvalve-0.8.1-64.uf2
similarity index 70%
rename from firmware/USBvalve-0.7.0-64.uf2
rename to firmware/USBvalve-0.8.1-64.uf2
index a494a3a..4a5e6ef 100644
Binary files a/firmware/USBvalve-0.7.0-64.uf2 and b/firmware/USBvalve-0.8.1-64.uf2 differ
diff --git a/pictures/USB_valve_1-2_back.png b/pictures/USB_valve_1-2_back.png
new file mode 100644
index 0000000..6d15351
Binary files /dev/null and b/pictures/USB_valve_1-2_back.png differ
diff --git a/pictures/USB_valve_1-2_front.png b/pictures/USB_valve_1-2_front.png
new file mode 100644
index 0000000..5ba1800
Binary files /dev/null and b/pictures/USB_valve_1-2_front.png differ
diff --git a/pictures/hid.png b/pictures/hid.png
new file mode 100644
index 0000000..edca592
Binary files /dev/null and b/pictures/hid.png differ