Wave Shield with ATMega1284P or ATMega644P
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- bratan
- Posts: 49
- Joined: Sun Mar 25, 2012 2:08 pm
Wave Shield with ATMega1284P or ATMega644P
Is it possible to get Wave Shield working on custom Arduino based on ATMega1284p or 644P processors? What would be Pin mappings? Any changes to library needed?
- xl97
- Posts: 201
- Joined: Mon Jul 27, 2009 12:51 pm
Re: Wave Shield with ATMega1284P or ATMega644P
I am not sure about the 1284/644.. bu maybe looking at the MEGA tutorials will yield some help/direction?
Also the only changes you need to make to the library would be the WavePinDefs file.. in the WaveHC library..
this would be for setting your DAC pins..etc...
good luck.
Also the only changes you need to make to the library would be the WavePinDefs file.. in the WaveHC library..
this would be for setting your DAC pins..etc...
good luck.
- bratan
- Posts: 49
- Joined: Sun Mar 25, 2012 2:08 pm
Re: Wave Shield with ATMega1284P or ATMega644P
Hmm, WavePinDefs.h doesn't look it has specific pin numbers. But I just found them in ArduinoPins.h
I wonder if it would be sufficient to change SPI port pins or do I need to make more changes in the file?
I wonder if it would be sufficient to change SPI port pins or do I need to make more changes in the file?
Code: Select all
#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
- xl97
- Posts: 201
- Joined: Mon Jul 27, 2009 12:51 pm
Re: Wave Shield with ATMega1284P or ATMega644P
Im not sure.. I have never used it with a Mega or anything..
but I have used it with a 'custom' board with the WaveShield components 'built-in'..
and by default I used different pins for my DAC to free up some PWM pins and other pins..etc..
in the: WavePinDefs.h
you define the PINS you want to use (I have posted about it here s well when I had to change it other pins not on same port)
For you.. couldnt hurt to look in the Arduino pins defs though too...
(since my custom board was still more or less an Uno)
but I have used it with a 'custom' board with the WaveShield components 'built-in'..
and by default I used different pins for my DAC to free up some PWM pins and other pins..etc..
in the: WavePinDefs.h
Code: Select all
//------------------------------------------------------------------------------
// 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
you define the PINS you want to use (I have posted about it here s well when I had to change it other pins not on same port)
For you.. couldnt hurt to look in the Arduino pins defs though too...
(since my custom board was still more or less an Uno)
- bratan
- Posts: 49
- Joined: Sun Mar 25, 2012 2:08 pm
Re: Wave Shield with ATMega1284P or ATMega644P
Got it working!!! I found another post describing the process, works like a charm on ATMega644P
http://www.forums.adafruit.com/viewtopi ... 31&t=15421
Just had to replace ArduinoPins.h and WavePinDefs.h
Adafruit, please include it in the official library! It's just one extra definition...
http://www.forums.adafruit.com/viewtopi ... 31&t=15421
Just had to replace ArduinoPins.h and WavePinDefs.h
Adafruit, please include it in the official library! It's just one extra definition...
- tonyfixit
- Posts: 2
- Joined: Tue Nov 04, 2014 5:41 pm
Re: Wave Shield with ATMega1284P or ATMega644P
BratanBratan wrote:Got it working!!! I found another post describing the process, works like a charm on ATMega644P
http://www.forums.adafruit.com/viewtopi ... 31&t=15421
Just had to replace ArduinoPins.h and WavePinDefs.h
Adafruit, please include it in the official library! :) It's just one extra definition...
I tried the link, but my server failed to find it. Would you be willing to email me the two files? I want (need) to use the 1284 as I have run out of room with the 328, and I have serious difficulties translating the "pins" files.
Many thanks in advance
Tony
- bratan
- Posts: 49
- Joined: Sun Mar 25, 2012 2:08 pm
Re: Wave Shield with ATMega1284P or ATMega644P
Original post here:
viewtopic.php?f=31&t=15421
But it's missing definitions for 1284p
You can download modified library here. Look for Libraries and Utilities tab and you'll see modified WAVeShield library. Either use whole library or just extract ArduinoPins.h and WavePinDefs.h
I can't remember now if I used standard pins or different once, take a look at my Xronos Clock schematics (V2) on the same page.
viewtopic.php?f=31&t=15421
But it's missing definitions for 1284p
You can download modified library here. Look for Libraries and Utilities tab and you'll see modified WAVeShield library. Either use whole library or just extract ArduinoPins.h and WavePinDefs.h
I can't remember now if I used standard pins or different once, take a look at my Xronos Clock schematics (V2) on the same page.
- tonyfixit
- Posts: 2
- Joined: Tue Nov 04, 2014 5:41 pm
Re: Wave Shield with ATMega1284P or ATMega644P
Bratan
many thanks. for that, working now.
For previous projects, when using the 1284 with a library, I found the 1284 is a 644 with more memory and an extra timer. So the 644 stuff works, I just add " || defined (__AVR_ATmega1284P__)" to the "#if defined (__AVRATmega644P__) statements.
Thanks again
Tony
many thanks. for that, working now.
For previous projects, when using the 1284 with a library, I found the 1284 is a 644 with more memory and an extra timer. So the 644 stuff works, I just add " || defined (__AVR_ATmega1284P__)" to the "#if defined (__AVRATmega644P__) statements.
Thanks again
Tony
Please be positive and constructive with your questions and comments.