Skip to content

Commit

Permalink
ARRGGHH!! pin 9 is also used by the USB host shield.
Browse files Browse the repository at this point in the history
This collides with the right mouse button pin.
The later one had to be moved to pin A0. D'oh!
  • Loading branch information
Sven Oliver Moll committed Aug 6, 2020
1 parent ff575eb commit 669a60b
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 41 deletions.
6 changes: 3 additions & 3 deletions A500/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
* 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 */
#define PIN_DB9_X1 (5) /* Pin 2 on DB9 */
#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*/

Expand Down
25 changes: 7 additions & 18 deletions CDTV/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions DB9/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*/

Expand Down
4 changes: 2 additions & 2 deletions Modules/amiga_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 );
Expand Down
9 changes: 5 additions & 4 deletions Modules/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
8 changes: 4 additions & 4 deletions Pins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -86,8 +86,8 @@ Building
--------

- [Commodore CDTV](Build_CDTV.md)
- Amiga 500 (tbd)
- "Big Box" Amigas (tbd)
- Amiga 500 (tbd)
- CD32 (tdb)


Expand Down
8 changes: 4 additions & 4 deletions hex/USB2Amiga.A500.hex
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
:1001A00011248F9381E080930001E9988F910F9043
:1001B0000FBE0F901F90189582E00E949B0083E075
:1001C0000E949B00E9E6F0E080818C608083E998E2
:1001D000E19A08958FE00E94A50068E572E080E052
:1001E00090E00E94E6108FE00C949B00CF93C82F04
:1001D000E19A089580E10E94A50068E572E080E060
:1001E00090E00E94E61080E10C949B00CF93C82F12
:1001F00083E00E949B00C6FB882780F90E94C10013
:10020000C5FB882780F90E94C100C4FB882780F9BC
:100210000E94C100C3FB882780F90E94C100C2FB75
Expand Down Expand Up @@ -63,7 +63,7 @@
:1003E0000BC086E00E94B30103C086E00E94A90111
:1003F00084E00E94A90103C084E00E94B30188EC5C
:1004000090E00C940C110E94BD010E94E00188E074
:100410000E94B30189E00C94B301FF920F931F93E4
:100410000E94B3018EE00C94B301FF920F931F93DF
:10042000CF93DF931F92CDB7DEB7182FF42E062F90
:10043000101664F490915B029150937090935B025C
:1004400069830E94BD0101506981F2CF862F67FD4B
Expand All @@ -73,7 +73,7 @@
:100480000E94E0010150F4CF8F2DF7FC80E00F2D8A
:10049000081B002351F090915A0291509370909351
:1004A0005A020E94E0010F5FF4CF88E010FF03C002
:1004B0000E94A90102C00E94B30189E011FF08C097
:1004B0000E94A90102C00E94B3018EE011FF08C092
:1004C0000F90DF91CF911F910F91FF900C94A90194
:1004D0000F90DF91CF911F910F91FF900C94B3017A
:1004E00085ED90E0089589EC90E008958DEB90E023
Expand Down
4 changes: 2 additions & 2 deletions hex/USB2Amiga.DB9.hex
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
:1003E0000BC086E00E94B30103C086E00E94A90111
:1003F00084E00E94A90103C084E00E94B30188EC5C
:1004000090E00C940C110E94BD010E94E00188E074
:100410000E94B30189E00C94B301FF920F931F93E4
:100410000E94B3018EE00C94B301FF920F931F93DF
:10042000CF93DF931F92CDB7DEB7182FF42E062F90
:10043000101664F490915B029150937090935B025C
:1004400069830E94BD0101506981F2CF862F67FD4B
Expand All @@ -73,7 +73,7 @@
:100480000E94E0010150F4CF8F2DF7FC80E00F2D8A
:10049000081B002351F090915A0291509370909351
:1004A0005A020E94E0010F5FF4CF88E010FF03C002
:1004B0000E94A90102C00E94B30189E011FF08C097
:1004B0000E94A90102C00E94B3018EE011FF08C092
:1004C0000F90DF91CF911F910F91FF900C94A90194
:1004D0000F90DF91CF911F910F91FF900C94B3017A
:1004E00085ED90E0089589EC90E008958DEB90E023
Expand Down

0 comments on commit 669a60b

Please sign in to comment.