I am using AT89C55WD, 40 pin DIP, in one of my project.
I have connected 12Mhz crystal. It is 8051 variant. So inst time is 1us.
Using Keil v4.72.9.0 & C compiler V9.50.0.0
1. How to invert a bit? Is below is the correct way:
or is there any single cycle invert in it like setb & clr
if(1U == P2^3)
{
P2^3 = 0U;
}
else
{
P2^3 = 1U;
}
2. I am programming in C. In one place I have use _nop_().When I saw its reference it showed in Keil folder file "intrins.h".
But there it has reference only "extern void _nop_ (void);"
There is no definition.
I know it will something like "asm(Nop)".
But I want to know like if function definition is not present in project folder & only it has project reference, then how do code builds?
3. How to determine what's the max stack size code touch in it.
I am using almost all RAM in it. I am afraid if any point stack overflow? How to determine this is not the case.
4. Interrupt nesting:
I am using two timers interrupts in it. One at 100us time & other at 20ms time.
100us timer is turned on when it is required otherwise it is off.
20ms timer is on continuously, do some task in it, inside isr it may take max 500us.
In programming I have priority of 100us highest since it is generating some signal on bit.
I think problem may occur if 20ms timer is getting executed, since there is no nesting in 89c55, so it may miss 100us interrupt.
I dont want to miss 100us timer in any case.
What is the solution in this case.
I think only solution is to disable 20ms timer.