FIX: found old thread on forum from 2010, saying this bitshifts are wrong.

ref:   http://www.proxmark.org/forum/viewtopic.php?id=643
This commit is contained in:
iceman1001 2017-09-26 00:19:54 +02:00
commit 0f7241f4b3
2 changed files with 23 additions and 23 deletions

View file

@ -55,7 +55,7 @@ static void ConfigClocks(void) {
// PLL output is MAINCK * multiplier / divisor = 16Mhz * 12 / 2 = 96Mhz
AT91C_BASE_PMC->PMC_PLLR =
PMC_PLL_DIVISOR(2) |
PMC_PLL_COUNT_BEFORE_LOCK(0x50) |
PMC_PLL_COUNT_BEFORE_LOCK(0x10) |
PMC_PLL_FREQUENCY_RANGE(0) |
PMC_PLL_MULTIPLIER(12) |
PMC_PLL_USB_DIVISOR(1);

View file

@ -44,8 +44,8 @@
#define PMC_MAIN_OSC_STARTUP_DELAY(x) ((x) << 8)
#define PMC_PLL_DIVISOR(x) (x)
#define PMC_PLL_MULTIPLIER(x) (((x)-1) << 16)
#define PMC_PLL_COUNT_BEFORE_LOCK(x) ((x)<<8)
#define PMC_PLL_FREQUENCY_RANGE(x) ((x)<<14)
#define PMC_PLL_COUNT_BEFORE_LOCK(x) (((x) & 0x3F) << 8) // 6bit register 0011 1111
#define PMC_PLL_FREQUENCY_RANGE(x) (((x) & 0x3) << 14) // 2bit register
#define PMC_PLL_USB_DIVISOR(x) ((x) << 28)
#define UDP_INTERRUPT_ENDPOINT(x) (1 << (x))