Moderators: adafruit_support_bill, adafruit
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
// Mega Arduino
// Two Wire (aka I2C) ports
#define SDA_PIN 20
#define SCL_PIN 21
// SPI port
#define SS_PIN 53
#define MOSI_PIN 51
#define MISO_PIN 50
#define SCK_PIN 52
//------------------------------------------------------------------------------
// DAC pin definitions
// LDAC may be connected to ground to save a pin
/** Set USE_MCP_DAC_LDAC to 0 if LDAC is grounded. */
#define USE_MCP_DAC_LDAC 1
// use arduino pins A3(D17), D4, D7, D8 for DAC
// pin A3/D17 is DAC chip select
/** Data direction register for DAC chip select. */
#define MCP_DAC_CS_DDR PIN17_DDRREG
/** Port register for DAC chip select. */
#define MCP_DAC_CS_PORT PIN17_PORTREG
/** Port bit number for DAC chip select. */
#define MCP_DAC_CS_BIT PIN17_BITNUM
// pin D4 is DAC serial clock
/** Data direction register for DAC clock. */
#define MCP_DAC_SCK_DDR PIN4_DDRREG
/** Port register for DAC clock. */
#define MCP_DAC_SCK_PORT PIN4_PORTREG
/** Port bit number for DAC clock. */
#define MCP_DAC_SCK_BIT PIN4_BITNUM
// pin D7 is DAC serial data in
/** Data direction register for DAC serial in. */
#define MCP_DAC_SDI_DDR PIN7_DDRREG
/** Port register for DAC clock. */
#define MCP_DAC_SDI_PORT PIN7_PORTREG
/** Port bit number for DAC clock. */
#define MCP_DAC_SDI_BIT PIN7_BITNUM
// pin D8 is LDAC if used
#if USE_MCP_DAC_LDAC
/** Data direction register for Latch DAC Input. */
#define MCP_DAC_LDAC_DDR PIN8_DDRREG
/** Port register for Latch DAC Input. */
#define MCP_DAC_LDAC_PORT PIN8_PORTREG
/** Port bit number for Latch DAC Input. */
#define MCP_DAC_LDAC_BIT PIN8_BITNUM
#endif // USE_MCP_DAC_LDAC
Return to Arduino Shields from Adafruit
Users browsing this forum: mibignistinly and 5 guests