The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN
HANEL

BCD AND ASCII APPLICATION PROGRAMSPacked BCD to


ACSII Conversion


‰The DS5000T microcontrollers have a real-time clock (RTC)


¾The RTC provides the time of day (hour, minute, second) and the date (year, month, day) continuously, regardless of whether the power is on or off


‰However this data is provided in packed BCD


¾To be displayed on an LCD or printed by the printer, it must be in ACSII formatPacked BCD Unpacked BCD ASCII29H


02H & 09H 32H & 39H

0010 1001 0000 0010 & 0011 0010 &

0000 1001 0011 1001
Free download pdf