> Hello, > > I am a new user of the PIC and was wondering if anyone could help me > with the problem of converting 8 bit binary to 3 BCD in the PIC 16F877. > I am programming in C. While there is code out there that does it, since you are doing it in C, it's probably much better for you to do it yourself. The algorithm basically is: given x: hundreds_digit = 0; tens_digit = 0; ones_digit = 0; while (x >= 100) { x = x - 100; hundreds_digit++; } while (x >= 10) { x = x - 10; tens_digit++; } ones_digit = x; Done. TTYL ---------------------------------- Herbert's PIC Stuff: http://repatch.dyndns.org:8383/pic_stuff/ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body