WestfW/OptiLoader

Probably doesn't work right on Arduino MEGA

Opened this issue · 0 comments

There's that bit in the SPI peripheral documentation:

If SS is configured as an input, it must be held high to ensure Master SPI operation. If the SS pin is driven low by peripheral circuitry when the SPI is configured as a Master with the SS pin defined as an input, the SPI system interprets this as another master selecting the SPI as a slave and starting to send data to it.

On 328p-based boards, SS is pin10, and we use it as the RESET signal output. But on the Mega, SS is pin53, which will default to being an input, and it's FLOATING, so that could easily result in ... incorrect behavior.

Maybe we need a "pinMode(53, OUTPUT);" to the SPI Setup code, or something more generic...