Hi,
I'm starting learning 8051 mcu, came up with the startup code written in assembly. I have few things I need to know.
Here is the sample startup source code of bootloader:
My questions start with ????? below.
;SOME INITIALIZATION HERE CSEG AT 0 ?C_STARTUP: LJMP Start LJMP ISRApp_ExternalInt0 LJMP _WritePageOnFlash ds 2 ????? Why reserve 2-bytes? LJMP ISRApp_Timer0 LJMP GetP2Value ds 2 ????? Why reserve 2-bytes? ... LJMP ISRApp_UART1 ds 10 ????? Why reserve 10-bytes, does it overlap the 8-byte interrupt interval? LJMP ISRApp_SMB1 ... CSEG AT 1400h Base: dw $ ISRApp_Reset: lcall Error ????? Why it calls Error? ISRApp_ExternalInt0: lcall Error ISRApp_Timer0 lcall Error ... ISRApp_UART1 lcall Error Error: clr EA Loop: jmp Loop ... END
Also, what I don't understand here is, why it didn't indicate CSEG AT 03h for Interrup 0, CSEG AT 0Bh for Interrup 1, etc. as to what states here http://www.keil.com/support/docs/132.htm?
Hope somebody can lighten me up here.
I used Silabs 8051 mcu w/ keil's C51.
thanks gee
Sir,
The calls to "Error" are there for unused interrupts. Their purpose is to catch an unexpected interrupt. That is to say, one that could be generated, but should not be because your code has not enabled it. If it were to occur, you would want to try and catch the unexpected event and maybe report it. The "Error" routine could be used to carry out this trivial, but potentially very useful, operation.
I trust this response answers your question in a satisfactory manner.
With kindest regards,
F. St Jones-Wilson (MILF)
I trust this response answers your question in a satisfactory manner. Thank you very much. Your response answer my question very well.
And to others who responded my post, I'd like to say thank you all for your time and skills helping others to learn. Very much appreciated.
regards Gee