Thanks to all for your answers. Below is the simple logic i implemented....
void DecToHex(unsigned char* dst, unsigned char* src);
unsigned char digits[12] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x01,0x02,0x03};
unsigned char result[10]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
void main(void)
{
/* digits[12] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x01,0x02,0x03}; */
DecToHex(result, digits);
/* result[10] : 0x1C,0xBE,0x99,0x1A,0x83,......... */
while(1);
}
void DecToHex(unsigned char* dst, unsigned char* src)
{
unsigned char tmp;
unsigned char i, j=10;
while(j!=0)
{
j -= 1;
/* reinitialize for every division */
tmp = 0;
for(i=9-j;i<12;i++){
tmp = (tmp*10)+src[i];
if(tmp < 16){
src[i] = 0x00;
}
else{
src[i] = tmp/16;
tmp = tmp%16;
}
}
/* last tmp is the reminder of first division */
dst[j] = tmp;
}
/* for hex array */
for(i=0,j=0;i<12;i+=2, j+=1){
dst[j] = (unsigned char)((dst[i] << 4)|(dst[i+1]));
}
}