'0x01'
is not the same as
0x01
(without the quotes).
For example 0x77 is a hexadecimal representation of the value 119, which in turn is
character[
^] 'w'.
Remove the quotes from the second format and it should work.
char ch[18];
ch[0]=0x01;
ch[1]=0x01;
ch[2]=0x01;
ch[3]=0x02;
ch[4]=0x00;
ch[5]=0x01;
ch[6]=0x01;
ch[7]=0x0C;
ch[8]=0x05;
ch[9]=0x00;
ch[10]=0x01;
ch[11]=0x01;
ch[12]=0x55;
ch[13]=0x55;
ch[14]=0x55;
ch[15]=0x55;
ch[16]=0x55;
ch[17]=0x77;
pPortInterface->Writechar(ch);