Also:
See also:
Archive:
Comments:
Questions:
Convert the Hex digits to binary (16bits) and then convert the binary to ASCII.
Apply one of the "2 digit Hex to Binary 8 bits" routines to the first two hex digits and then again to the second, thereby producing two 8 bit values that are then passed to any one of the "16bit to ASCII Decimal 5 digits" routines. +
See:
+;some code snippets that someone might find useful... ;This routine will return the number of decimal ;hundreds from an 8-bit binary ;Input: w ;Output: w ;RAM:2 ;Cycles: 12-24 GETHNDS movwf t1 clrf w2 gethnds_loop movlw .100 incf w2,f subwf t1,f btfsc STATUS,C goto gethnds_loop decf w2,w return ;--- ;This routine will return the number of decimal ;tens from an 8-bit binary ;Loop based, so it might take some time... ;It needs getones too GETTENS movwf t1 clrf w2 gettens_loop movlw .10 incf w2,f subwf t1,f btfsc STATUS,C goto gettens_loop decf w2,w goto getones ;--- ;This routine will return the number of decimal ;ones from an 8-bit binary GETONES movwf w2 movlw .10 deltens_loop subwf w2,f btfsc STATUS,C goto deltens_loop addwf w2,w return
| file: /Techref/microchip/math/radix/index.htm, 14KB, , updated: 2011/1/14 15:09, local time: 2012/5/24 02:40,
38.107.179.233:LOG IN |
| ©2012 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://www.piclist.com/tecHREF/microchip/math/radix/index.htm"> PIC Microcontoller Radix Math Methods</A> |
| Did you find what you needed? |
|
o List host: MIT, Site host massmind.org, Top posters @20120524 RussellMc, IVP, alan.b.pearce, cdb, V G, Isaac Marino Bavaresco, Electron, John Gardner, Carl Denk, Dwayne Reid, * Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: None at this time. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
|
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.