- How to make sure that there is large capacitance at RESET PIN ?
You may vector COP reset to routine, which loops forever. Then, you make your main code giving some startup signal like sending message over SCI or blinking a LED few times, and then enable COP and write non 0xAA-0x55 byte to ARMCOP register. In case /RESET pin RC is too large you should keep observing startup signal again and again. In case RC is OK you should see startup signal only once.
But way ismplier it is to measure /RESET pin rise time when COP reset occurs.
- Apart from COP Reset Vector, is there any other way to determine COP Reset is occured in last power cycle ?
No
- Please see sample code to understand what I want to do,
Like I said already, you need to defined COP flag variable in NO_INIT memory segment. To do so edit PRM file and reserve part of your RAM for noinit variables:
SEGMENTS
RAM _NOINIT = NO_INIT 0x2800 TO 0x280F;
RAM = READ_WRITE 0x2810 TO 0x3FFF;
...
END
PLACEMENT
NOINIT_VARS INTO RAM_NOINIT
...
END
Then in your code
#pragma DATA_SEG NOINIT_VARS
char COPflag;
#pragma DATA_SEG DEFAULT
Then you make COP vector pointing to this routine
void COPreset(void)
{
COPflag = 1;
asm jmp _Startup
}
void mainreset(void)
{
COPflag = 0;
asm jmp _Startup
}
And then
main()
{
if(COPflag)
{
Task1( );
}
else
{
Task2();
}
}
- Are there any Registers (In MC9S12xDG128 Micro) to check if Reset is COP Reset ?
No
- How to make use of SCTL Register to determine COP Reset ?
As far as I know there's no such register on S12D
- Suggest me to Determine COP Reset (assuming there is large Capacitance at RESET PIN).
No way.
Complete S12Dx128 documentation is here:
http://cache.freescale.com/files/microcontrollers/doc/data_sheet/9S12DT128_ZIP.zip