nick703
Advanced Member level 1
- Joined
- Oct 17, 2011
- Messages
- 422
- Helped
- 21
- Reputation
- 44
- Reaction score
- 22
- Trophy points
- 1,298
- Location
- surat
- Activity points
- 3,987
hello friends i have a configure UART on pic18f4431 using c18 compiler in MPlab ide.
and below is the my code
now when i run this program using mplab simulator that time i am directly enter in this line if (!strncmp(C,"{3QFG}",6)) and every time i receive [3COM] . i am not sending any{3QFG} COMMAND.
and same code used in pic32 device using c32 compiler this function completely work. i don't know this type of behaviour of Strncmp function.
below is my full project file.
and below is the my code
Code:
void main()
{
initial_all();
initial_intrrupt();
initial_start();
initial_variables();
/********************************************************************************************/
UART2_txArray(PowerOn,strlen(PowerOn));
/*******************************************************************************************/
while(1)
{
if (!strncmp(C,"{3QFG}",6))
{
PORTAbits.RA1 = 1;
UART2_txArray(ComOn,strlen(ComOn));
bPassword = TRUE;
}
}
}
now when i run this program using mplab simulator that time i am directly enter in this line if (!strncmp(C,"{3QFG}",6)) and every time i receive [3COM] . i am not sending any{3QFG} COMMAND.
and same code used in pic32 device using c32 compiler this function completely work. i don't know this type of behaviour of Strncmp function.
below is my full project file.