cancel
Showing results for 
Search instead for 
Did you mean: 

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};

PKuma.9
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III

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

View solution in original post

2 REPLIES 2
KnarfB
Principal III

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
Associate II

Thanks