Hamshield working on UNO but not MEGA

Hello forum,

I'm playing around with my Hamshield v.1.0, using the Talkie sketches to transmit speech over UHF. Everything works fine when the shield is sitting on an UNO but when I switch to a MEGA the sketch works 100% apart from the actual speech being heard. By this I mean that the radio goes into transmit mode when it is meant to, which I can confirm by the white noise on my receiver disappearing. On the UNO the speech is heard, on the MEGA its quiet.

The pinout for the Hamshield looks like this:

A1 nCS Radio chip select
A2 SPKR "Speaker" from radio, analog into Arduino
A3 RST Radio reset
A4 DAT Serial data transmit/receive
A5 CLK Serial clock
D2 Button Aux button on HamShield (can be used for any purpose)
D3 MIC PWM audio output from Arduino to Hamshield "microphone"
VIN DC Barrel DC barrel input, needs to be 6VDC+ (ideally 9VDC)
5V 5 Volt 5 Volt from Arduino
GND GND Grounds

So as far as I can tell it's not using any pins that are in different positions on an UNO and MEGA.

I've tried by powering both UNO and MEGA with USD only as well as 12V wall wart (on different voltages from 6V to 12V) with the same results.

Does anyone have an idea on what I may be missing?

I would like to use a MEGA so that I can use the large number of digital inputs for triggers to let the unit transmit different speech messages on my radio system on different scenarios.

Hein

And the sketch:

#include <HamShield.h>

#define PWM_PIN 3
#define RESET_PIN A3
#define SWITCH_PIN 2

HamShield radio;
#include "talkie.h"

Talkie voice;

 const uint8_t spALPHA[]         PROGMEM = {0xAD,0xED,0x6A,0xDC,0x4B,0x57,0xEF,0xF6,0xB4,0x53,0x6C,0x6A,0x4B,0x97,0x53,0x77,0x7E,0x19,0xC9,0x9B,0x57,0x99,0xCC,0x7B,0x9A,0x6E,0x9E,0x45,0x2B,0xA2,0xA9,0x0A,0x91,0xCC,0xB5,0x00,0x02,0x14,0x67,0xA1,0x80,0x16,0x2C,0x3C,0x60,0x80,0xE6,0x2C,0x4A,0x51,0x54,0x47,0x38,0x6F,0xDE,0xC3,0x5D,0xF6,0x36,0xF7,0x7A,0xE5,0xFB,0xFF,0x01};
 const uint8_t spBRAVO[]         PROGMEM = {0x61,0x5A,0xBA,0xC2,0xDD,0x62,0x85,0xD6,0xE8,0x15,0x59,0xB1,0x97,0x9A,0x30,0xD5,0xBC,0x85,0xDF,0xA8,0x63,0x0F,0xE9,0x50,0xE5,0xA7,0xCA,0x6E,0x22,0x5D,0x57,0xEF,0x72,0x97,0xB3,0x2A,0x6D,0x74,0x15,0xE9,0xBA,0x3A,0xF6,0x66,0xE8,0x3E,0xD4,0x5C,0x65,0xD7,0x31,0x2D,0x95,0x54,0xBB,0x8B,0xDF,0xD9,0xAE,0xB1,0xA1,0xAC,0x0E,0x51,0x3F,0xE7,0xB6,0x14,0xD2,0x35,0x4E,0xEE,0xFB,0x5E,0x77,0xB3,0x7B,0xDF,0x19,0x2C,0x7D,0xEC,0xE9,0x2F,0x73,0x05,0xDF,0x19,0x2C,0x7D,0xF8,0xF3,0xFF};
 const uint8_t spCHARLIE[]       PROGMEM = {0x06,0xD8,0x2D,0x2C,0x01,0x33,0xB7,0x67,0x60,0xC4,0x35,0x94,0xAA,0x5A,0xEA,0x93,0x15,0xD7,0xAA,0x23,0xEE,0x56,0x9E,0xD3,0xAA,0x2E,0xE5,0xDB,0xF9,0xC8,0x4B,0x6A,0x8E,0xE3,0x3E,0x33,0x2F,0x45,0x6E,0x62,0x39,0x9A,0x76,0x74,0x4D,0xA5,0xA5,0x73,0xD2,0x3B,0xAC,0xA9,0xD9,0x61,0x0D,0xDF,0x32,0xE6,0xEE,0x0A,0x39,0xE3,0xF3,0x58,0x97,0x2D,0xC2,0x8C,0x2D,0x7D,0x4D,0xE7,0xCC,0x09,0x18,0xB5,0x38,0x5E,0xFE,0xFE,0x7F};

 unsigned long lastTX;


void setup() {

  pinMode(PWM_PIN, OUTPUT);
  digitalWrite(PWM_PIN, HIGH);
  
  // prep the switch
  pinMode(SWITCH_PIN, INPUT_PULLUP);
  
  // set up the reset control pin
  pinMode(RESET_PIN, OUTPUT);
  digitalWrite(RESET_PIN, HIGH);
  delay(5); // wait for device to come up
  
  Serial.begin(9600);
  Serial.println("If the sketch freezes at radio status, there is something wrong with power or the shield");
  Serial.print("Radio status: ");
  int result = radio.testConnection();
  Serial.println(result,DEC);
  Serial.println("Setting radio to its defaults..");
  radio.initialize();
  radio.setRfPower(0);
  radio.frequency(446000);
}

void loop() 
{
  if (millis() - lastTX > 3000)
  {
    radio.setModeTransmit();
    delay(100);     //  GIVE RECEIVER TIME TO SNAP OUT OF SCAN MODE
    voice.say(spALPHA); 
    voice.say(spBRAVO);
    voice.say(spCHARLIE);
    radio.setModeOff();
    lastTX = millis();
  }  
}

heinburgh:
A4 DAT Serial data transmit/receive
A5 CLK Serial clock

So as far as I can tell it's not using any pins that are in different positions on an UNO and MEGA.

The I2C hardware pins are on A4 and A5 on a UNO, but not on a Mega.

Ah, right. Sorry I missed that.

I cut the pins off of the Hamshield that would go into A4 and A5 and soldered two leads that connect to SDA and SCL instead. (The clock pin on Hamshield to SCL and DAT pin to SDA.)

Now the radio does not even initialise, not transmitting at all.

Does it make a difference if I use the MEGA SDA and SCL pins up close by the USB jack as opposed to pins 20 and 21? My DMM shows they are one and the same.

Hein

... and the new wiring arrangement works fine when I put the shield back on the UNO.

heinburgh:
Does it make a difference if I use the MEGA SDA and SCL pins up close by the USB jack as opposed to pins 20 and 21? My DMM shows they are one and the same.

Should not do, if the board is actually using the I2C hardware.

Have you asked the people that make\sell it if its Mega compatible ?

On their website it clearly says compatible with UNO and MEGA. Dropped them an email but it may take days to hear back from them.