ChriX
Member
I'm doing a project with a 16F628 and a GPS receiver. The only problem is that I need to get a reading in MPH rather than KMH as given by the receiver so I need to do a conversion on the PIC. It's relatively simple to do (when not dealing with asm that is!) as it's only a multiplication by 0.621.
I have a number that can be from 000.0 to 999.9 stored in BCD, using 4 registers with one digit in each, so I guess ill need to convert that to a 16 bit binary number and then multiply it before changing it back to BCD, but i'm really unsure about dealing with numbers less than 1 in binary and the multiplication.
Any help appreciated! I'm sure someone must have come across this before so I thought there would be code snippets around to help, but i've not managed to find any.
I have a number that can be from 000.0 to 999.9 stored in BCD, using 4 registers with one digit in each, so I guess ill need to convert that to a 16 bit binary number and then multiply it before changing it back to BCD, but i'm really unsure about dealing with numbers less than 1 in binary and the multiplication.
Any help appreciated! I'm sure someone must have come across this before so I thought there would be code snippets around to help, but i've not managed to find any.