set
pdc
;
set
pec
;
set
pfc
;
set
pgc
;
main:
set
pac.2
;set receive pin to input mode
clr
pac.3
;set transmit pin to output mode
loop:
ifdef
TRANSMIT_MODE
;transmit mode
mov
a,32
;transmit 32 bytes
mov
counter,a
clr
tblp
;tble=0 (data pointer)
again:
tabrdl transmit_data
;load transmit data
mov
a,transmit_data
call
transmit
;transmit
inc
tblp
;tble+1 (point to next)
sdz
counter
;transmit over? (counter-1)
jmp
again
;no. next byte
jmp
loop
;repeat from loop else
mov
a,40h
;receive mode
mov
mp0,a
;mp0-receive buffer (40h~5Fh)
mov
a,32
;load counter
mov
counter,a
;
again:
call
receive
;receive 1 byte
mov
r0,a
;put received data to buffer
inc
mp0
;buffer index+1
sdz
counter
;receive over?
jmp
again
;no. continue receiving
jmp
$
;yes. stop program
endif
test .section at 1f00h ’code’
test_table:
;data fo transmitting (32 bytes)
dc 012h,034h,056h,078h,09ah,0bch,0deh,0f0h,011h,022h,033h,
044h,055h,066h,077h,088h
dc 099h,0aah,0bbh,0cch,0ddh,0eeh,0ffh,000h,055h,0aah,055h,
0aah,055h,0aah,055h,0aah
end
;==============
;= Serial.asm =
;==============
;serial port library
ifndef HEADER_HT48C70
;depends on what type of IC is selected
#define HEADER_HT48C70
#include ht48c70.inc
endif
#include dfseript.inc
public transmit
;external functions
public receive
;
Chapter 15 Input/Output Applications
205
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...