Maxim Integrated Secure Microcontroller User Manual

Page 172

Advertising
background image

Secure Microcontroller User’s Guide

172 of 187

LCALL

TEXT_OUT

LCALL

HEX_IN

LCALL

WBYTE

; Set the year.

MOV

DPTR,

#MONTH

LCALL

TEXT_OUT

LCALL

HEX_IN

LCALL

WBYTE

; Set the month.

MOV

DPTR,

#DAY

LCALL

TEXT_OUT

LCALL

HEX_IN

LCALL

WBYTE

; Set the day.

DEC

R0

MOV

DPTR,

#DAYW

LCALL

TEXT_OUT

LCALL

HEX_IN

LCALL

WBYTE

; Set day of the week.

DEC

R0

MOV

DPTR,

#HOUR

LCALL

TEXT_OUT

LCALL

HEX_IN

LCALL

WBYTE

; Set the hour.

DEC

R0

MOV

DPTR,

#MINUTE

LCALL

TEXT_OUT

LCALL

HEX_IN

LCALL

WBYTE

; Set the minute.

CLR

A

LCALL

WBYTE

; Set seconds

LCALL

WBYTE

; to 00.00

MOV

DPTR,

#TRIGGER

LCALL

TEXT_OUT

LCALL

CHAR_IN

; Wait for trigger.

MOV

A,

#80H

MOV

R0,

#11

LCALL

WBYTE

; Un–freeze the registers.

;
TELL_TIME:

MOV

DPTR,

#TEXT4

LCALL

TEXT_OUT

; Invite user to read time.

CONTINUE:
;

LCALL

CHAR_IN

; Wait for read request.

CLR

A

MOV

R0,

#11

LCALL

WBYTE

; Freeze the registers.

MOV

DPTR,

#TEXT1

LCALL

TEXT_OUT

MOV

R0,

#9

LCALL

RBYTE

; Read the month.

ANL

A,

#1FH

; Isolate it.

LCALL

HEX_OUT

; Display month.

MOV

A,

#’/’

LCALL

CHAR_OUT

LCALL

RBYTE

; Read the day of month.

ANL

A,

#3FH

; Isolate it.

LCALL

HEX_OUT

; Display day of month.

MOV

A,

#’/’

LCALL

CHAR_OUT

MOV

R0,

#10

LCALL

RBYTE

; Read the year.

LCALL

HEX_OUT

; Display the year.

Advertising