'2560 help

Guys,
I have this '2560 board built up, doing some testing to make sure it works. Bootloaded up 1st try with MKii and Mega 2560 bootloader from the IDE, figured that was a good start.
Next wrote up the basics of a sketch, toggling all the output pins that come out to connectors, making sure the serial lines all work.
The output pins I’ve tried so far seem to work (LED resistor to gnd).
Only Serial3 TX seems to work. Serial, Serial1, Serial2 just sit at 5V, confirmed with 'scope at the driver inputs, a MAX208 quad RS232 driver chip.
(no way I’m going to try probing the 2560!)
http://datasheets.maxim-ic.com/en/ds/MAX200-MAX213.pdf page 17 with five 0.1uF caps per the datasheet.

Code below was loaded in using File:Upload Using Programmer. Any reason the '2560 wouldn’t send out data on all 4 ports?

// #include <EEPROM.h> // or just roll own?
#include <Wire.h>
#include <SPI.h>

/*
add notes here
 */
// declare pins used

byte USB_ID = 62; // input
// byte FRAM_SS = tbd; // output
byte ENC_UD2 = 54; // output
byte ENC_CLK2 = 55; // output
byte ENC_UD1 = 56; // output
byte ENC_CLK1 = 57; // output
byte ENC_UD0 = 58; // output
byte ENC_CLK0 = 59; // output
// byte CAN_INT = tbd; // input
byte CAN_CS = 38; // output
byte WIRELESS_SS = 53; //  output
byte UART_INT = 13; // input
byte USB_HOST_INT = 22; // input
byte USB_HOST_SS = 23; // output
byte GPX = 24; // input
byte AUX = 25; // output
byte AUX_OPT = 26; //  output
byte FRAM_HOLD = 27; // output
byte FRAM_WP = 28; // output

// Serial (0) = D0, D1
// Serial1 = D18, D19
// Serial2 = D16, D17
// Serial3 = D14, D15
// I2C = D10, D21
// SPI = D50, D51, D52, SS on D53

// declare variables

void setup(){

  pinMode( USB_ID,INPUT); // input
  digitalWrite (USB_ID, HIGH);
  // pinMode( FRAM_SS, OUTPUT);  // output
  pinMode( ENC_UD2, OUTPUT);  // output
  pinMode( ENC_CLK2, OUTPUT); // output
  pinMode( ENC_UD1, OUTPUT);  // output
  pinMode( ENC_CLK1, OUTPUT); // output
  pinMode( ENC_UD0, OUTPUT);  // output
  pinMode( ENC_CLK0, OUTPUT);  // output
  // pinMode( CAN_INT,INPUT); // input
  pinMode( CAN_CS, OUTPUT); // output
  pinMode( WIRELESS_SS, OUTPUT); //  output
  pinMode( UART_INT,INPUT); // input
  digitalWrite (UART_INT, HIGH);
  pinMode( USB_HOST_INT,INPUT); // input
  digitalWrite (USB_HOST_INT, HIGH);
  pinMode( USB_HOST_SS, OUTPUT); // output
  pinMode( GPX, INPUT); // input
  digitalWrite (GPX, HIGH);
  pinMode( AUX, OUTPUT);  // output
  pinMode( AUX_OPT, OUTPUT); //  output
  pinMode( FRAM_HOLD, OUTPUT); // output
  pinMode( FRAM_WP, OUTPUT);  // output

  Serial.begin(9600);
  Serial1.begin(9600);
  Serial2.begin(9600);
  Serial3.begin(9600);

  // digitalWrite (FRAM_SS, HIGH);
  digitalWrite (FRAM_WP, HIGH);
  digitalWrite (FRAM_HOLD, HIGH);
  digitalWrite (CAN_CS, HIGH);
  digitalWrite (WIRELESS_SS, HIGH);
  digitalWrite (USB_HOST_SS, HIGH);

  SPI.begin();

  // Wire.begin(address for SC161S752);

}

void loop(){
  for (int x = 0; x<16; x=x+1){
    Serial.print (x, HEX);
    Serial1.print (x, HEX);
    Serial2.print (x, HEX);
    Serial3.print (x, HEX);
  }
  digitalWrite (ENC_CLK0, HIGH);
  digitalWrite (ENC_CLK1, HIGH);
  digitalWrite (ENC_CLK2, HIGH);
  digitalWrite (ENC_UD0, HIGH); 
  digitalWrite (ENC_UD1, HIGH); 
  digitalWrite (ENC_UD2, HIGH);

  digitalWrite (AUX, HIGH);
  digitalWrite (AUX_OPT, HIGH);

  digitalWrite (ENC_CLK0, LOW);
  digitalWrite (ENC_CLK1, LOW);
  digitalWrite (ENC_CLK2, LOW);
  digitalWrite (ENC_UD0, LOW); 
  digitalWrite (ENC_UD1, LOW); 
  digitalWrite (ENC_UD2, LOW);

  digitalWrite (AUX, LOW);
  digitalWrite (AUX_OPT, LOW);

  delay(2);
}

IDE 1.0.1 by the way.

I reloaded the program. At the very end, after this

 avrdude: 6282 bytes of flash written
avrdude: verifying flash memory against C:\Users\Owner\AppData\Local\Temp\build6183648410028762648.tmp\RX_seriai_io_test.cpp.hex:
avrdude: load data flash data from input file C:\Users\Owner\AppData\Local\Temp\build6183648410028762648.tmp\RX_seriai_io_test.cpp.hex:
avrdude: input file C:\Users\Owner\AppData\Local\Temp\build6183648410028762648.tmp\RX_seriai_io_test.cpp.hex contains 6282 bytes
avrdude: reading on-chip flash data:

Reading | avrdude: Sent: . [06] . [80] . [00] . [00] . [00] 
avrdude: Recv: . [06] . [00] 
avrdude: Sent: . [14] . [01] . [00]   [20] 
avrdude: Recv: . [14] . [00] . [03] . [c1] . [00] . [00] " [22] . [81] . [00] . [00] , [2c] . [c0] . [00] . [00] . [00] . [c1] . [00] . [00] ( [28] . [c1] . [00] . [00]   [20] . [c0] . [00] . [00] . [04] A [41] . [00] . [00] " [22] . [c1] . [00] . [00]   [20] . [c0] . [00] . [00] . [0e] . [c1] . [00] . [00] . [1c] . [c0] . [00] . [00] . [18] . [c0] . [00] . [00] . [18] . [c1] . [00] . [00] . [10] . [c1] . [00] . [00] . [14] . [c1] . [00] . [00] . [12] . [c0] . [00] . [00] . [10] . [c1] . [00] . [00] . [0e] . [c1] . [00] . [00] . [0c] . [c0] . [00] . [00] . [0a] A [41] . [00] . [00] . [08] . [c1] . [00] . [00] . [00] . [c1] . [00] . [00] . [04] . [c1] . [00] . [00] ` [60] . [c0] . [00] . [00] . [00] . [01] . [00] . [00] H [48] . [c6] . [00] . [00] B [42] . [07] . [00] . [00] . [fa] . [c0] . [00] . [00] . [f8] . [c0] . [00] . [00] . [c0] . [80] . [00] . [00] t [74] . [c0] . [00] . [00] . [f2] . [c0] . [00] . [00] p [70] . [c0] . [00] . [00] . [ee] . [c0] . [00] . [00] . [e4] . [00] . [00] . [00] . [ea] . [c0] . [00] . [00] i [69] . [86] . [00] . [00] . [97] . [c7] . [00] . [00] . [e4] . [c0] . [00] . [00] . [95] . [02] . [00] . [00] ` [60] . [c0] . [00] . [00] . [dc] . [c0] . [00] . [00] . [1c] . [00] . [00] . [00] . [da] . [c0] . [00] . [00] . [d8] . [c0] . [00] . [00] V [56] . [c0] . [00] . [00] . [c0] . [80] . [00] . [00] . [d2] . [c0] . [00] . [00] . [d0] . [c0] . [00] . [00] . [0e] @ [40] . [00] . [00] . [cc] . [c0] . [00] . [00] . [86] . [c4] . [00] . [00] . [00] . [07] . [00] . [00] . [c6] . [c0] . [00] . [00] . [a0] . [82] . [00] . [00] . [11] . [07] . [00] . [00] . [c0] . [c0] . [00] . [00] . [00] . [00] ! [21] . [00] $ [24] . [00]   [20] . [00] . [02] . [00] - [2d] . [00] 0 [30] . [00] 0 [30] . [00] . [00] . [01] . [00] . [00] . [00] . [01] . [07] . [01] . [0a] . [01] . [00] . [00] . [00]

and another 24 blocks like that, I see this final message

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0004
         0x2e != 0x22
avrdude: verification error; content mismatch
avrdude: Sent: . [11] . [01] . [01] 
avrdude: Recv: . [11] . [00] 

avrdude done.  Thank you.

Not sure what the implications of of that are, as the sketch is running and putting out:
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
over and over as expected, but only on Serial3.

bump please

Last upload seemed to go thru ok:

##avrdude: Sent: . [14] . [00] . [94]   [20] 
avrdude: Recv: . [14] . [00] . [b0] . [0d] . [e1] . [1d] . [f9] . [1f] . [bd] . [01] . [cf] . [01] . [11] $ [24] . [08] . [95] . [a1] . [e2] . [1a] . [2e] . [aa] . [1b] . [bb] . [1b] . [fd] . [01] . [0d] . [c0] . [aa] . [1f] . [bb] . [1f] . [ee] . [1f] . [ff] . [1f] . [a2] . [17] . [b3] . [07] . [e4] . [07] . [f5] . [07]   [20] . [f0] . [a2] . [1b] . [b3] . [0b] . [e4] . [0b] . [f5] . [0b] f [66] . [1f] w [77] . [1f] . [88] . [1f] . [99] . [1f] . [1a] . [94] i [69] . [f7] ` [60] . [95] p [70] . [95] . [80] . [95] . [90] . [95] . [9b] . [01] . [ac] . [01] . [bd] . [01] . [cf] . [01] . [08] . [95] . [ee] . [0f] . [ff] . [1f] . [05] . [90] . [f4] . [91] . [e0] - [2d] . [19] . [94] . [f8] . [94] . [ff] . [cf] > [3e] 6 [36] 7 [37] 8 [38] 9 [39] : [3a] ; [3b] & [26] 5 [35] . [0d] . [16] . [17] . [18] . [19] . [1a] . [1b] . [1c] . [00] . [00] . [00] . [00] . [9f] . [02] o [6f] . [02] ( [28] . [02] 1 [31] . [02] F [46] . [02] W [57] . [02] . [00] . [00] . [00] . [00] . [95] . [09] . [f9] . [0a] ) [29] . [09] Z [5a] . [09] : [3a] . [09] . [83] . [09] . [00] . [00] 
## | 100% 2.19s

avrdude: verifying ...
avrdude: 6292 bytes of flash verified
avrdude: Sent: . [11] . [01] . [01] 
avrdude: Recv: . [11] . [00] 

avrdude done.  Thank you.

Serial 1/2 still not Txing. Serial(0) is okay, I was looking at the wrong place. Serial3 still working okay.

You probably don't want to hear this, but FYI, I am running a 2560 custom board and used the 1.0.1 IDE to load the standard boot loader using an AVRISPMkII (Burn Bootloader option). All four ports are transmitting OK.

If you can tell me how to copy the verbose output of the status window of the IDE (select and copy does not work) I can post the avrdude output if required.

I don't think that will help.
I just use the mouse to highlight it, then CTRL-C & CTRL-V.

Gonna go have to look at the underlying traces I guess, see what's going on.

Okay, found my problem. 4 of the serial signals didn't make it in the board file. I'm thinking perhaps a last minute tweak caused the signals to have a conflict, they got ripped up and then never rerouted. I'm usually using the Rats Nest after every change, don't know how those got left out.
Will have to take/send the boards somewhere to add the 4 wires, that's smaller than I can do and not cause more problems.
Need a Mini USB-B connector added also, also has very small pins.

Rats.

Sorry Bob, not ignoring you just haven’t got a clue.

If you have 2 ports working and 2 not working it’s very unlikely that the MAX chip is faulty. Especially as you are probing the TTL inputs.

(no way I’m going to try probing the 2560!)

I think you need to verify that the 2560 is actually not outputting anything and there isn’t a fault in the PCB. Very unlikely to stuff up with both ports but possible.

You haven’t defined any of those pins you’re toggling as the same as the UART outputs? Does it work if you remove all that extra stuff (including the pinModes() in setup()) and just send out the serial ports.

EDIT: Our posts crossed, highlighting added :slight_smile:


Rob

Thanks Rob, yes, missing traces in the PCB.
Will start on getting the next component working while I find a place that can add wires. The '2560 pins are too small for me.