I want to link a teensy 4.1 to an arduino mega 2560 R3.
What is the best way to hook these two together to exchange data? Serial? a parallel bus? SPI etc? Are there any libraries available to handle this?
What to do about the 3.3v to 5v and visa versa?
Level shifting from 5v to 3.3v with a resistor divider works for slower speeds, say < 38400 baud. On my devices for serial communications over a couple of meters at 115200 I've been using 74HCT245s
or some of these https://www.analog.com/media/en/technical-documentation/data-sheets/ADuM1200_1201.pdf which are intended for that job, are compact and inexpensive.I stand corrected -- I've been using 74HCT245s to bump 3.3v up to 5v, not the other way around. For down converting you'll be looking at 74LV parts such as a 74LVC125 or a 74LVC245.