2022-07-31 10:16 PM
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.
Solved! Go to Solution.
2022-07-31 11:30 PM
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
2022-07-31 11:30 PM
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
2022-08-03 09:13 PM
Thanks