diff --git a/A500/config.h b/A500/config.h index 59cf216..a77aa32 100644 --- a/A500/config.h +++ b/A500/config.h @@ -16,7 +16,7 @@ * except for the A500 where it has to be a dedicated pin */ #define PIN_KB_DATA (3) #define PIN_KB_CLK (2) -#define PIN_KB_RESET A1 +#define PIN_KB_RESET A2 /* pin configuration Amiga mouse */ #define PIN_DB9_Y2 (4) /* Pin 1 on DB9 */ @@ -24,8 +24,8 @@ #define PIN_DB9_Y1 (6) /* Pin 3 on DB9 */ #define PIN_DB9_X2 (7) /* Pin 4 on DB9 */ #define PIN_DB9_LB (8) /* Pin 6 on DB9 */ -#define PIN_DB9_RB (9) /* Pin 9 on DB9 */ -#define PIN_DB9_MB A0 /* Pin 5 on DB9, optional */ +#define PIN_DB9_RB A0 /* Pin 9 on DB9 */ +#define PIN_DB9_MB A1 /* Pin 5 on DB9, optional */ /* Pin 8 on DB9 is GND */ /* Pin 7 on DB9 is +5V, which is typically not needed*/ diff --git a/CDTV/config.h b/CDTV/config.h index 6a2765a..db9dd04 100644 --- a/CDTV/config.h +++ b/CDTV/config.h @@ -19,23 +19,12 @@ #define PIN_KB_RESET PIN_KB_CLK /* pin configuration CDTV data and joy input */ -#define PIN_CDTV_PRDT (6) -#define PIN_CDTV_JOY_UP (A0) -#define PIN_CDTV_JOY_DOWN (A1) -#define PIN_CDTV_JOY_LEFT (A2) -#define PIN_CDTV_JOY_RIGHT (A3) -#define PIN_CDTV_JOY_A (A4) -#define PIN_CDTV_JOY_B (A5) - -#if 0 -/* pin configuration Amiga mouse */ -#define PIN_DB9_X1 (4) -#define PIN_DB9_X2 (5) -#define PIN_DB9_Y1 (6) -#define PIN_DB9_Y2 (7) -#define PIN_DB9_LB (8) -#define PIN_DB9_RB (9) -#define PIN_DB9_MB (1) -#endif +#define PIN_CDTV_PRDT (6) +#define PIN_CDTV_JOY_UP A0 /* DB9 pin 1 */ +#define PIN_CDTV_JOY_DOWN A1 /* DB9 pin 2 */ +#define PIN_CDTV_JOY_LEFT A2 /* DB9 pin 3 */ +#define PIN_CDTV_JOY_RIGHT A3 /* DB9 pin 4 */ +#define PIN_CDTV_JOY_A A4 /* DB9 pin 6 */ +#define PIN_CDTV_JOY_B A5 /* DB9 pin 9 */ #endif diff --git a/DB9/config.h b/DB9/config.h index 48af01d..c8c4868 100644 --- a/DB9/config.h +++ b/DB9/config.h @@ -24,8 +24,8 @@ #define PIN_DB9_Y1 (6) /* Pin 3 on DB9 */ #define PIN_DB9_X2 (7) /* Pin 4 on DB9 */ #define PIN_DB9_LB (8) /* Pin 6 on DB9 */ -#define PIN_DB9_RB (9) /* Pin 9 on DB9 */ -#define PIN_DB9_MB A0 /* Pin 5 on DB9, optional */ +#define PIN_DB9_RB A0 /* Pin 9 on DB9 */ +#define PIN_DB9_MB A1 /* Pin 5 on DB9, optional */ /* Pin 8 on DB9 is GND */ /* Pin 7 on DB9 is +5V, which is typically not needed*/ diff --git a/Modules/amiga_mouse.c b/Modules/amiga_mouse.c index 5cb4392..dd15417 100644 --- a/Modules/amiga_mouse.c +++ b/Modules/amiga_mouse.c @@ -83,7 +83,7 @@ void db9_mouse_init() outputY(); weak_pullup( PIN_DB9_LB ); weak_pullup( PIN_DB9_RB ); -#if USE_AMIGA_MOUSE_MB +#if PIN_DB9_MB weak_pullup( PIN_DB9_MB ); #endif } @@ -134,7 +134,7 @@ void amiga_mouse_update( uint8_t buttons, int8_t x, int8_t y ) weak_pullup( PIN_DB9_RB ); } -#if USE_AMIGA_MOUSE_MB +#if PIN_DB9_MB if( buttons & 4 ) { pull_down( PIN_DB9_MB ); diff --git a/Modules/gpio.h b/Modules/gpio.h index cb55e30..0607117 100644 --- a/Modules/gpio.h +++ b/Modules/gpio.h @@ -23,10 +23,11 @@ static inline void pull_down( uint8_t pin ) /* pin configuration usb host shield * (for documentation purposes only) */ -#define PIN_USB_SS (10) -#define PIN_USB_CLK (11) -#define PIN_USB_MISO (12) -#define PIN_USB_MOSI (13) +#define PIN_USB_INTR (9) +#define PIN_USB_SS (10) +#define PIN_USB_CLK (11) +#define PIN_USB_MISO (12) +#define PIN_USB_MOSI (13) #include "config.h" diff --git a/Pins.md b/Pins.md index f3fc3f4..9643b2b 100644 --- a/Pins.md +++ b/Pins.md @@ -17,14 +17,14 @@ Pin | Function | Amiga 6 | PD6 | mouse DB9 pin 3: Y1 * / CDTV-PRDT * 7 | PD7 | mouse DB9 pin 4: X2 * 8 | PB0 | mouse DB9 pin 6: LB * - 9 | PB1 | mouse DB9 pin 9: RB * + 9 | PB1/INTR | USB host shield * 10 | PB2/SS | USB host shield * 11 | PB3/MOSI | USB host shield * 12 | PB4/MISO | USB host shield * 13 | PB5/SCK | USB host shield * / LED - 14 | PC0/A0 | input joystick DB9 + / mouse DB9 pin 5: RB + - 15 | PC1/A1 | input joystick DB9 + / A500 reset + - 16 | PC2/A2 | input joystick DB9 + + 14 | PC0/A0 | input joystick DB9 + / mouse DB9 pin 9: RB + + 15 | PC1/A1 | input joystick DB9 + / mouse DB9 pin 5: MB + + 16 | PC2/A2 | input joystick DB9 + / A500 reset + 17 | PC3/A3 | input joystick DB9 + 18 | PC4/A4 | input joystick DB9 + 19 | PC5/A5 | input joystick DB9 + diff --git a/README.md b/README.md index cd2d2fc..4c1143b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ USB2Amiga This project is about connecting USB HID devices like keyboard, mouse and the combination of those (sometimes called "desktops") to almost any Amiga. The project originally started out to get a working keyboard for a Commodore CDTV -without spending big bugs. Also if it should work with a kvm switch that would +without spending big bucks. Also if it should work with a kvm switch that would be nice. ![CDTV](images/cdtv.jpg) @@ -86,8 +86,8 @@ Building -------- - [Commodore CDTV](Build_CDTV.md) -- Amiga 500 (tbd) - "Big Box" Amigas (tbd) +- Amiga 500 (tbd) - CD32 (tdb) diff --git a/hex/USB2Amiga.A500.hex b/hex/USB2Amiga.A500.hex index b8737e6..7aca180 100644 --- a/hex/USB2Amiga.A500.hex +++ b/hex/USB2Amiga.A500.hex @@ -27,8 +27,8 @@ :1001A00011248F9381E080930001E9988F910F9043 :1001B0000FBE0F901F90189582E00E949B0083E075 :1001C0000E949B00E9E6F0E080818C608083E998E2 -:1001D000E19A08958FE00E94A50068E572E080E052 -:1001E00090E00E94E6108FE00C949B00CF93C82F04 +:1001D000E19A089580E10E94A50068E572E080E060 +:1001E00090E00E94E61080E10C949B00CF93C82F12 :1001F00083E00E949B00C6FB882780F90E94C10013 :10020000C5FB882780F90E94C100C4FB882780F9BC :100210000E94C100C3FB882780F90E94C100C2FB75 @@ -63,7 +63,7 @@ :1003E0000BC086E00E94B30103C086E00E94A90111 :1003F00084E00E94A90103C084E00E94B30188EC5C :1004000090E00C940C110E94BD010E94E00188E074 -:100410000E94B30189E00C94B301FF920F931F93E4 +:100410000E94B3018EE00C94B301FF920F931F93DF :10042000CF93DF931F92CDB7DEB7182FF42E062F90 :10043000101664F490915B029150937090935B025C :1004400069830E94BD0101506981F2CF862F67FD4B @@ -73,7 +73,7 @@ :100480000E94E0010150F4CF8F2DF7FC80E00F2D8A :10049000081B002351F090915A0291509370909351 :1004A0005A020E94E0010F5FF4CF88E010FF03C002 -:1004B0000E94A90102C00E94B30189E011FF08C097 +:1004B0000E94A90102C00E94B3018EE011FF08C092 :1004C0000F90DF91CF911F910F91FF900C94A90194 :1004D0000F90DF91CF911F910F91FF900C94B3017A :1004E00085ED90E0089589EC90E008958DEB90E023 diff --git a/hex/USB2Amiga.DB9.hex b/hex/USB2Amiga.DB9.hex index 64bc645..925b4ea 100644 --- a/hex/USB2Amiga.DB9.hex +++ b/hex/USB2Amiga.DB9.hex @@ -63,7 +63,7 @@ :1003E0000BC086E00E94B30103C086E00E94A90111 :1003F00084E00E94A90103C084E00E94B30188EC5C :1004000090E00C940C110E94BD010E94E00188E074 -:100410000E94B30189E00C94B301FF920F931F93E4 +:100410000E94B3018EE00C94B301FF920F931F93DF :10042000CF93DF931F92CDB7DEB7182FF42E062F90 :10043000101664F490915B029150937090935B025C :1004400069830E94BD0101506981F2CF862F67FD4B @@ -73,7 +73,7 @@ :100480000E94E0010150F4CF8F2DF7FC80E00F2D8A :10049000081B002351F090915A0291509370909351 :1004A0005A020E94E0010F5FF4CF88E010FF03C002 -:1004B0000E94A90102C00E94B30189E011FF08C097 +:1004B0000E94A90102C00E94B3018EE011FF08C092 :1004C0000F90DF91CF911F910F91FF900C94A90194 :1004D0000F90DF91CF911F910F91FF900C94B3017A :1004E00085ED90E0089589EC90E008958DEB90E023