
thus generate the required frequency on a corresponding pin and create the
desired note. By adding a suitable amplifier and speaker the system is
complete. The important points of the software is to use the timer/counter
as a counter to control the output frequency. This frequency has to be
calculated.
Circuit design
PA0~PA7 are setup as inputs with each line connected to a pull up resistor.
Pressing a key will bring the corresponding line low. PB0 is setup as an output
and is the line where the required frequency appears. By changing this line
from hi to lo and vice-versa the required frequency can be generated.
Program
#include ht48c50.inc
;------------------------------------------------------------
data .section ’data’
;== data section ==
temp
db ?
;hold temporary data
sound
db ?
;hold freq.
;------------------------------------------------------------
code .section at 0 ’code’
;== program section ==
org
00h
;
jmp
start
;
org
04h
;external interrupt subroutine
reti
;for safeguard
HT-IDE User’s Guide
210
Содержание 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 ...