[aprssig] PIC and telemetry question
Ben Jackson
ben at ben.com
Fri Jan 26 12:50:29 EST 2007
On Fri, Jan 26, 2007 at 08:53:27AM -0500, Robert Bruninga wrote:
> > How do you get a register that may be say 234 in value, to be
> > sent as ASCII as "2" "3" and "4"
> >
> > Do you process by 100, 10 and 1's ?
>
> Yes, divide by 100, keep remainder, divide by 10, and keep
> remainder...
> Bob
No, on a PIC you count how many times you subtract 100 to get below 100,
then how many 10 to get below 10 and then the remainder is the last
digit.
Or, as someone else said, you never store or generate it as '234', you
keep it in BCD (packed if necessary). The PIC has some features to help
with packed BCD. Look at piclist.com
If the answer on a PIC is ever "divide", you asked the wrong question!
--
Ben Jackson AD7GD
<ben at ben.com>
http://www.ben.com/
More information about the aprssig
mailing list