SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By ah_sandiego
#10589
I have read that the interrupt vector table on ARM processors needs to have the 2's complement sum of the other vectors at address 0x14.

So looking the current vector table on my board, I see that it looks like this

Addr Values
0000 18F09FE5 18F09FE5 18F09FE5 18F09FE5
0010 18F09FE5 845F20B9

So, if I am correct, then 845F20B9 is the 2's complement sum. The problem is I cannot calculate this. My understanding is this is how it is calculated.

1) Get the SUM
18F09FE5+18F09FE5+18F09FE5+18F09FE5+18F09FE5 = 7CB31F79

2) Then for 2's complement
not(7CB31F79)+1 = 834CE086

So can someone tell me what I am doing wrong? Am I missing some vectors?

Thanks,
AH
By atom
#10593
I think you are missing the IRQ and FIQ vectors (@ 0x18 & 0x1c)
By ah_sandiego
#10599
Thanks for the reply

Addr Values
0000 18F09FE5 18F09FE5 18F09FE5 18F09FE5
0010 18F09FE5 845F20B9 F0FF1FE5 14F09FE5

Including 0x18 and 0x1C I get

1) Get the SUM
18F09FE5+18F09FE5+18F09FE5+18F09FE5+18F09FE5+F0FF1FE5+14F09FE5 = 82A2DF43

2) Then for 2's complement
not(82A2DF43)+1 = 7D5D20BD

So I still am not getting it?

Thanks,
AH
By atom
#10604
The values in your calculation are little endian representations of the numbers. Are you looking at the contents of a HEX file by chance? You need to flip the byte order to turn them into their true 32-bit integer values.

If you do this then you will have:
e59ff018 + e59ff018 + e59ff018 + e59ff018 + e59ff018 + e51ffff0 + e59ff014 = 46DFA07C

not(46dfa07c)+1 = b9205f84
By ah_sandiego
#10610
Thanks Atom,

Little vs big endian didn't occur to me. Thanks for your help, you are correct. And yes, I was looking at the HEX file itself.

AH