Few queries on how to set real time clock value in DS1307
The 51 49makes perfect sense. They are the ASCII codes for 3 and 1, resp. Why the reverse order? You started by selecting the low order nibble, instead of the high order nibble.

How to send the character instead of its ASCII code?
Use "%c" as format string instead of "%d" (which formats a decimal number).