Hello everybody,

Although this topic might be quite old, I would like to "try my luck" to sort out a problem that bothers me for some time.

From the very begining want to state that I am rather a noobie in relation with PIC's and peculiar with its EEPROM operation and actualy this is my first interaction with this forum.

On short, I use DEBUGIN command to capture a 16 characters alphanumeric strings sent from a PC, something like following example:

85D4E88A3B52AA40 (or more corect said "8","5","D","4","E","8","8","A","3","B","5","2","A ","A","4","0").

I do need to WRITE these characters into onchip (PIC16F88) EEPROM, location 0, as pairs consisting of 2 characters in 1 Byte.

At the end of operation the first location of EEPROM memory must looks like this: 85 D4 E8 8A 3B 52 AA 40.
Unfortunately I have ended up with this result: 85 44 58 81 32 52 11 40.

Concernig the pairs of data within the string please note that there are several kind of possible combinations:

- 2 digits (i.e. 85, 40);
- 2 characters (i.e. AA);
- 1 digit and one character, in this order (i.e. 8A, 3B)
- 1 character and one digit, in this order (i.e. D4, E8)

Mention that I have used and adapted BigWumpus' above proposed algorithm.
It works perfectly as long the string contains only digits (0-9).
However, it fails whenever HEX like characters (A,B,C,D,E F) come into picture.

Any help to sort out this problem will be highly appreciated.

Many hanks in advance and wishing you all a Happy and Prosperous New Year !

Best regards,
Andrew