Hi!
I'm new to 8051 controllers and are now using the nRF24LE1 for a school project.
I am used to the AVR architecture and writing interrupts like "ISR_interrupt_vector()" but I can see that 8051 uses "void interrupt() interrupt #number", and I can not find what #number to use.
Can anyone help me with this issue?
Thank you all in advance!
Start with this: www.8052.com/.../120112 and this: http://www.8052.com/tutorial
Books: http://www.keil.com/books/8051books.asp
These will all give you information about the 8051 architectuer in general.
For details about the Nordic devices in particular you will, of course, have to refer the the manufacturer's specific documentation.
For details about the Keil tools, including examples, etc, see: http://www.keil.com/support
The problem was that my included definitions file was wrong for some reason. 8052.com is a great page, but all the code is assembly, something I'm not comfortable with.
Thank you for your answer!
I don't think that's entirely true but, as far as things like interrupt numbers go, it is completely irrelevant.
The interrupt numbers are fixed by the architecture - they don't depend on what programming language you use.
"...assembly, something I'm not comfortable with"
I strongly suggest that you need to get confortable with it at least to the level of being able to follow the simple examples in things like the 8052.com tutorials.
Most of those examples are just about writing to & reading from SFRs - which is has no real differences in 'C' or ASM.
You don't necessarily need to be able to write your own assembler - but you should really be able to follow simple examples.
When it comes to bedugging - even though your source is in 'C' - you are going to be greatly handicapped if you can't follow the instructions that the processor is actually executing.
I seem to be spending all of my life bedugging at the moment ;)
some datasheets use interrupt numbers that are (as far as all toolsets I know of) wrong.
The only way to ensure that you get the correct interrupt numbers is to go by the interrupt vector addresses in the datasheet and use the formula
interrupt_number = (vector_address -3)/8
Erik
Bebugging or bedugging :-)
I second the motion
in the non-OS world you will be at a great disadvantage if you can not read assembler comfortably.
Just an example: a missing 'volatile' is blatantly obvious looking at the generated assembler and invisible in C. There are many more examples where your debugging will be greatly hampered by "assembly, something I'm not comfortable with".
I shall try and get more experienced then. I know how to read most of it, but for my small apps until now I haven't needed to go disassembly.
Thanks for your help.
They become correct when I include the header files from the manufacturer