Calculators
The value for SPIxBRG from the peripheral bus clock and the clock speed you want. SPI on the PIC32MZ explains it.
The calculator needs JavaScript. The post explains the sum.