Skip to content

Instantly share code, notes, and snippets.

@dancollins
Created October 24, 2012 10:38
Show Gist options
  • Save dancollins/3945393 to your computer and use it in GitHub Desktop.
Save dancollins/3945393 to your computer and use it in GitHub Desktop.
Microchip Application Library Gem
/* Continue the loop till you find SPI Baud Rate Register Value */
while (1) {
/* SPI Clock Calculation as per PIC32 Manual */
SPI_Clk_Freq = pbFreq / (2 * (SPI_Brg + 1));
if (SPI_Clk_Freq <= MAX_SPI_CLK_FREQ_FOR_P2P)
break;
SPI_Brg++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment