Code: Select all
if Usart_Data_Ready = 1 then
Usart_Read_Text(txt, delim)
if strcmp(txt,"STOP")= 0 then
KEY_POW = 0
MAINPOW = 0
start_status = 0
goto main2
end if
if strcmp(txt,"POW1")= 0 then
MAINPOW = 1
RES_MCU = 1 'RESET MCU
start_status = 1 ' disabilito pulsante start
end if
if strcmp(txt,"POW0")= 0 then
MAINPOW = 0
RES_MCU = 1
start_status = 0
end if
if strcmp(txt,"KEY1")= 0 then
KEY_POW = 1
end if
if strcmp(txt,"KEY0")= 0 then
KEY_POW = 0
end if
......
end if
I have too much string to check then i suppose is the cause of error in communication.
PC send ADCread command, PIC compare string ADCread and make ADC read then send data back to PC
sometimes i read 0 but is not true
thanks for suggestions