AnsweredAssumed Answered

SPI Issues

Question asked by salazar.timothy on Jul 21, 2013
Latest reply on Jul 21, 2013 by Clive Two.Zero
Currently im using SPI to send information to configure the internal registers of a ENC28J60. The minimum SCK allowed is 8 Mhz. Im using the STM32F103RB, which can operate at 78Mhz. For some reason when i try to boost the speed of the SPI to 8 Mhz the signal and data become distorted. Below is a clip from my clock, maybe i made a mistake somewhere. Any help is welcomed.
// 1. Clocking the controller from internal HSI RC (8 MHz)
  // wait until the HSI is ready
  while(RCC_GetFlagStatus(RCC_FLAG_HSIRDY) == RESET);
  // 2. Enable ext. high frequency OSC
  // wait until the HSE is ready
  while(RCC_GetFlagStatus(RCC_FLAG_HSERDY) == RESET);
  // 3. Init PLL
  RCC_PLLConfig(RCC_PLLSource_HSE_Div1,RCC_PLLMul_9); // 72MHz
  // wait until the PLL is ready
  while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);
  // 4. Set system clock dividers
 /* Select PLL as system clock source */
#ifdef EMB_FLASH
  // 5. Init Embedded Flash
  // Zero wait state, if 0 < HCLK 24 MHz
  // One wait state, if 24 MHz < HCLK 56 MHz
  // Two wait states, if 56 MHz < HCLK 72 MHz
  // Flash wait state
  // Half cycle access
  // Prefetch buffer
#endif // EMB_FLASH
  // 5. Clock system from PLL