My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

conf_clock.h 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /**
  2. * \file
  3. *
  4. * \brief SAM3X clock configuration.
  5. *
  6. * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions are met:
  14. *
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. *
  18. * 2. Redistributions in binary form must reproduce the above copyright notice,
  19. * this list of conditions and the following disclaimer in the documentation
  20. * and/or other materials provided with the distribution.
  21. *
  22. * 3. The name of Atmel may not be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * 4. This software may only be redistributed and used in connection with an
  26. * Atmel microcontroller product.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
  29. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  30. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  31. * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
  32. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  36. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  37. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * \asf_license_stop
  41. *
  42. */
  43. /*
  44. * Support and FAQ: visit <a href="https://www.atmel.com/design-support/">Atmel Support</a>
  45. */
  46. #ifndef CONF_CLOCK_H_INCLUDED
  47. #define CONF_CLOCK_H_INCLUDED
  48. // ===== System Clock (MCK) Source Options
  49. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_RC
  50. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_XTAL
  51. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_SLCK_BYPASS
  52. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_4M_RC
  53. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_8M_RC
  54. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_12M_RC
  55. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_XTAL
  56. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_MAINCK_BYPASS
  57. #define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLACK
  58. //#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_UPLLCK
  59. // ===== System Clock (MCK) Prescaler Options (Fmck = Fsys / (SYSCLK_PRES))
  60. //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_1
  61. #define CONFIG_SYSCLK_PRES SYSCLK_PRES_2
  62. //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_4
  63. //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_8
  64. //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_16
  65. //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_32
  66. //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_64
  67. //#define CONFIG_SYSCLK_PRES SYSCLK_PRES_3
  68. // ===== PLL0 (A) Options (Fpll = (Fclk * PLL_mul) / PLL_div)
  69. // Use mul and div effective values here.
  70. #define CONFIG_PLL0_SOURCE PLL_SRC_MAINCK_XTAL
  71. #define CONFIG_PLL0_MUL 14
  72. #define CONFIG_PLL0_DIV 1
  73. // ===== UPLL (UTMI) Hardware fixed at 480MHz.
  74. // ===== USB Clock Source Options (Fusb = FpllX / USB_div)
  75. // Use div effective value here.
  76. //#define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL0
  77. #define CONFIG_USBCLK_SOURCE USBCLK_SRC_UPLL
  78. #define CONFIG_USBCLK_DIV 1
  79. // ===== Target frequency (System clock)
  80. // - XTAL frequency: 12MHz
  81. // - System clock source: PLLA
  82. // - System clock prescaler: 2 (divided by 2)
  83. // - PLLA source: XTAL
  84. // - PLLA output: XTAL * 14 / 1
  85. // - System clock is: 12 * 14 / 1 /2 = 84MHz
  86. // ===== Target frequency (USB Clock)
  87. // - USB clock source: UPLL
  88. // - USB clock divider: 1 (not divided)
  89. // - UPLL frequency: 480MHz
  90. // - USB clock: 480 / 1 = 480MHz
  91. #endif /* CONF_CLOCK_H_INCLUDED */