@@ -46,8 +46,8 @@ static const uint8_t MOSI = PIN_SPI_MOSI;
46
46
static const uint8_t MISO = PIN_SPI_MISO ;
47
47
static const uint8_t SCK = PIN_SPI_SCK ;
48
48
49
- #define PIN_WIRE_SDA (20 )
50
- #define PIN_WIRE_SCL (21 )
49
+ #define PIN_WIRE_SDA (18 )
50
+ #define PIN_WIRE_SCL (19 )
51
51
52
52
static const uint8_t SDA = PIN_WIRE_SDA ;
53
53
static const uint8_t SCL = PIN_WIRE_SCL ;
@@ -56,20 +56,23 @@ static const uint8_t SCL = PIN_WIRE_SCL;
56
56
// USART1 on mega4809 (alternative pins)
57
57
// Mapped to HWSERIAL0 in Serial library
58
58
#define HWSERIAL0 (&USART1)
59
+ //!!BUG in device header file. The RXC and DRE vectors are swapped!!
59
60
#define HWSERIAL0_DRE_VECTOR (USART1_DRE_vect)
60
- #define HWSERIAL0_DRE_VECTOR_NUM (USART1_DRE_vect_num)
61
61
#define HWSERIAL0_RXC_VECTOR (USART1_RXC_vect)
62
- // #define PIN_WIRE_HWSERIAL0_RX (0)
63
- // #define PIN_WIRE_HWSERIAL0_TX (1)
62
+ #ifdef REV_A_ENGINEERING_SAMPLE
64
63
#define PIN_WIRE_HWSERIAL0_RX (12)
65
64
#define PIN_WIRE_HWSERIAL0_TX (11)
65
+ #else
66
+ #define PIN_WIRE_HWSERIAL0_RX (0)
67
+ #define PIN_WIRE_HWSERIAL0_TX (1)
68
+ #endif
66
69
67
70
// Uno2 Debug USART (not available on headers, only via the EDGB virtual COM port)
68
71
// USART3 on mega4809 (alternative pins)
69
72
// Mapped to HWSERIAL1 in Serial library
70
73
#define HWSERIAL1 (&USART3)
74
+ //!!BUG in device header file. The RXC and DRE vectors are swapped!!
71
75
#define HWSERIAL1_DRE_VECTOR (USART3_DRE_vect)
72
- #define HWSERIAL1_DRE_VECTOR_NUM (USART3_DRE_vect_num)
73
76
#define HWSERIAL1_RXC_VECTOR (USART3_RXC_vect)
74
77
#define PIN_WIRE_HWSERIAL1_RX (26)
75
78
#define PIN_WIRE_HWSERIAL1_TX (27)
@@ -78,8 +81,8 @@ static const uint8_t SCL = PIN_WIRE_SCL;
78
81
// USART0 on mega4809 (alternative pins)
79
82
// Mapped to HWSERIAL2 in Serial library
80
83
#define HWSERIAL2 (&USART0)
84
+ //!!BUG in device header file. The RXC and DRE vectors are swapped!!
81
85
#define HWSERIAL2_DRE_VECTOR (USART0_DRE_vect)
82
- #define HWSERIAL2_DRE_VECTOR_NUM (USART0_DRE_vect_num)
83
86
#define HWSERIAL2_RXC_VECTOR (USART0_RXC_vect)
84
87
#define PIN_WIRE_HWSERIAL2_RX (23)
85
88
#define PIN_WIRE_HWSERIAL2_TX (24)
0 commit comments