hi...
I am trying to program the pic12f629, but unfortunately i have still not understood some basic definitions making it.. these are:
i have just encountered a problem in the interrupt section of the datasheet...
if one looks at the memory map of this micro he can notice that the general purpose registers can be accessed also from bank1...
so can we define say location 20h and A0h as say reg1 by
reg1 equ 20h
reg1 equ A0h i think this would produce an error, but if i understood correctly in the datasheet there is written that this is possible
quote" 9.5 Context Saving During Interrupts
The user register, W_TEMP, must be defined
in both banks and must be defined at the same offset
from the bank base address (i.e., W_TEMP is defined
at 0x20 in Bank 0 and it must also be defined at 0xA0
in Bank 1) "
?????
also, there is written that "The user register, STATUS_TEMP, must be defined in Bank 0."
why is this so? why only in bank 0? in the memory map there is written that status register is in both bank 0 and bank 1!.. so what does this mean? is status in bank1 a reflection of the status register in bank 0 or what(other examples are the FSR PCL and PCLATH, i really wonder why they are in both banks )??
sry for my grade of confusion by the way...
finally,
i need to make myself sure about two other things with regards to the sleep function:
1.in section 9.7 the datasheet says that theoscillator driver is turned off... now, timer0 is surely turned off during sleep, but with regards to timer1, if say an hs oscillator is used, does this mean that the timer1 won't continue to increment(since the HS oscillator driver is switched off) will it only continue to operate if the internal oscillator is used as a main oscillator??
2. in the same section there is a note saying :
Note: If the global interrupts are disabled (GIE is
cleared), but any interrupt source has both
its interrupt enable bit and the corresponding
interrupt flag bits set, the device will
immediately wake-up from SLEEP. The
SLEEP instruction is completely executed
therefore if the micro would in such a case wake up but not start the ISR ?
thanks a lot... i am really grateful
I am trying to program the pic12f629, but unfortunately i have still not understood some basic definitions making it.. these are:
i have just encountered a problem in the interrupt section of the datasheet...
if one looks at the memory map of this micro he can notice that the general purpose registers can be accessed also from bank1...
so can we define say location 20h and A0h as say reg1 by
reg1 equ 20h
reg1 equ A0h i think this would produce an error, but if i understood correctly in the datasheet there is written that this is possible
quote" 9.5 Context Saving During Interrupts
The user register, W_TEMP, must be defined
in both banks and must be defined at the same offset
from the bank base address (i.e., W_TEMP is defined
at 0x20 in Bank 0 and it must also be defined at 0xA0
in Bank 1) "
?????
also, there is written that "The user register, STATUS_TEMP, must be defined in Bank 0."
why is this so? why only in bank 0? in the memory map there is written that status register is in both bank 0 and bank 1!.. so what does this mean? is status in bank1 a reflection of the status register in bank 0 or what(other examples are the FSR PCL and PCLATH, i really wonder why they are in both banks )??
sry for my grade of confusion by the way...
finally,
i need to make myself sure about two other things with regards to the sleep function:
1.in section 9.7 the datasheet says that theoscillator driver is turned off... now, timer0 is surely turned off during sleep, but with regards to timer1, if say an hs oscillator is used, does this mean that the timer1 won't continue to increment(since the HS oscillator driver is switched off) will it only continue to operate if the internal oscillator is used as a main oscillator??
2. in the same section there is a note saying :
Note: If the global interrupts are disabled (GIE is
cleared), but any interrupt source has both
its interrupt enable bit and the corresponding
interrupt flag bits set, the device will
immediately wake-up from SLEEP. The
SLEEP instruction is completely executed
therefore if the micro would in such a case wake up but not start the ISR ?
thanks a lot... i am really grateful