Trouble with Serial1 port in SPI mode - Port mapping problem on 2560?

Hello,

I am using a Seeduino Mega 2560 mega. Very similar to Arduino mega 2560, except it has accessible headers for some of the pins that are not accessible on the Arduino mega. I am able to run the 1st serial port(Serial) in SPI mode, but I am having trouble running the 2nd serial port(Serial1) in SPI. I suspect it has to do with the missing port mappings when IDE compiles the code, but I am not sure how to fix. Can somebody give me a hint or lead on how to fix problem?

Thanks,

-diesel

//Init
UBRR1H = 0;
UCSR1A = _BV (TXC1);
XCK1_DDR |= (1<<XCK1);
UCSR1C = _BV (UMSEL10) | _BV (UMSEL11);
UCSR1B = _BV (TXEN1) | _BV (RXEN1);
UBRR1H =0;

//Transfer byte
while (!(UCSR1A & _BV (UDRE1)));
UDR1 = _data;
while (!(UCSR1A & _BV (RXC1)));
return UDR1;

Had the same problem. But with a real mega.

I had forgotten SPI.begin(); in setup()

diesel:
run the 1st serial port(Serial) in SPI mode,

What does that mean?

When I use SPI on my Mega it is completely separate from the serial ports.

...R

The usart on avrs supports spi as well as async protocols. That’s the “s” part.

What kind of troubles are you having?

XCK1_DDR |= (1<<XCK1);

For example, I don't believe that XCK0_DDR. XCK1_DDR, etc are actually defined symbols, despite the datasheet. That should be just "the DDRx register that matches up with the pin that will be used for SCK of that USART."
Hmm. Apparently, exactly ONE part (atmega644pa) has XCK1_DDR defined:

> cd /Applications/Arduino-1.8.9\ copy.app/Contents/Java/hardware/tools/avr/avr/include/avr/
> grep DDR *|grep XCK
iom169pa.h:#define XCK_DDR   DDRE
iom324pa.h:#define XCK_DDR   DDRB
iom644pa.h:#define XCK1_DDR   DDRD
iom644pa.h:#define XCK_DDR   DDRB
iom649p.h:#define XCK_DDR   DDRE
iom88pa.h:#define XCK_DDR   DDRD
iotn2313a.h:#define XCK_DDR   DDRD
iotn4313.h:#define XCK_DDR   DDRD

XCK1 is also not generally defined (the 644a has XCK1_BIT)