Skip to main content
PKuma.9
Associate
August 1, 2022
Solved

How does AHB Prescaler value fill? const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

  • August 1, 2022
  • 2 replies
  • 2715 views

I want to know what kind of value we fill in this and what affects the AHB Bus please make me understand.

const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

I tried to find out but only figured out the value of 1 to 9 it is the Prescaler value. and the rest of Zeros why we use it and what it the work of them.

This topic has been closed for replies.
Best answer by KnarfB

Always consult the reference manual of your chip (which one?) to interpret these "magic" tables and values. The reference manual will probably say:

0xxx: SYSCLK not divided
1000: SYSCLK divided by 2
1001: SYSCLK divided by 4
1010: SYSCLK divided by 8
1011: SYSCLK divided by 16
1100: SYSCLK divided by 64
1101: SYSCLK divided by 128
1110: SYSCLK divided by 256
1111: SYSCLK divided by 512

The 'x' bits are don't care, so the first 8 table entries are doing the same: not dividing the AHB clock.

One advantage of using this table layout is, that the usage is straightforward like here:

hth

KnarfB

2 replies

KnarfB
KnarfBBest answer
Super User
August 1, 2022

Always consult the reference manual of your chip (which one?) to interpret these "magic" tables and values. The reference manual will probably say:

0xxx: SYSCLK not divided
1000: SYSCLK divided by 2
1001: SYSCLK divided by 4
1010: SYSCLK divided by 8
1011: SYSCLK divided by 16
1100: SYSCLK divided by 64
1101: SYSCLK divided by 128
1110: SYSCLK divided by 256
1111: SYSCLK divided by 512

The 'x' bits are don't care, so the first 8 table entries are doing the same: not dividing the AHB clock.

One advantage of using this table layout is, that the usage is straightforward like here:

hth

KnarfB

PKuma.9
PKuma.9Author
Associate
August 4, 2022

Thanks