Otomatis Audiometer adalah aplikasi mikrokontroler dalam medis untuk menyelidiki ambang pendengaran dalam Hz 0 sampai 22.000 rentang frekuensi Hz dan dB -20 sampai 100 dB SPL jangkauan. Ini berjalan pada perangkat keras yang sangat sederhana, termasuk headphone, tekan tombol dan tidak memerlukan perangkat milik eksternal atau internal. Hal ini sangat tepat, mudah digunakan dan, karena stabilitas sirkuit digital, perlu dikalibrasi hanya sekali.
Otomatis Audiometer akan meningkatkan frekuensi dan SPL setelah pasien tidak mendengar apa pun dari headphone. Jika pasien mendengar suara dari telepon kepala, kemudian Poli harus menekan tombol untuk menunjukkan bahwa Dia mendengar suara dari headphone, dan mikrokontroler secara otomatis akan meningkatkan frekuensi ini akan terjadi sampai 8k Hz, maka SPL wil desibel peningkatan ..
;======================================================= ; Automatic AUDIOMETER ; by : Triwiyanto ;; Prosedur operasi ;=============================================================== ;R0 = to save transfer data Frequency ;R1 = to save transfer data Decibel ;R2 = to save data Counter Down in Convert Data DB dan Frequency subroutine MUX equ P0 ; DAC_Prnt equ P2 ; ttombol bit P3.2 ; INT0 = interupsi dari tombol pasien DataFreq equ 30h; RAM location for Data Frequency DataDb equ 31h; Ram location for DataDB Count200 equ 32h;RAM location for counter 200 CounterDFreq equ 36h;RAM location for Counter Frequency CounterDDB equ 37h;RAM location for counter DB ;40h s/d 4fh data array for frequency ;50h s/d 5fh data array for decibel ; org 00h sjmp Start ; org 03h ; interrupt external 0 address ljmp Xternal_Interupsi_0; jump to subroutineinterrupt external 0 address INT0 reti ; org 0bh ; timer interrupt 0 address ljmp Timer_Interupsi_0 ; jump to timer interrupt 0 TF0 ; org 13h; no interrupt reti ; org 23h;no interrupt reti ; Start: call Init_Interupsi_Xternal_Timer; call timer external interrupt Setb TR0 ; timer 0 run ; mov DataFreq,#0 ;initiate data datafreq=0 mov CounterDFreq,#40h ;RAM location for DFreq -> address 40h mov CounterDDB,#50h ;RAM location for DDB-> address 50h ; Clr A mov DPTR,#DataDecibel ;save address DataDecibel in DPTR Movc A,@A+DPTR ;look up table and take to A Mov DataDB,A ;saving data A to DataDB ; ;As you see in this subroutine. program will stack to this subroutine ; and jumps out to the others subroutine if there is an interruption Forever: mov MUX,DataFreq ; Choosing address in Multiplexer 4051 mov DAC_Prnt,DataDb ; Outputing data to DAC sjmp Forever ; Program will hang to this routine ; Xternal_Interupsi_0: jnb P3.2,$ call Simpan_DataDBdanDataFreq Mov Count200,#20 ;After interruption Xternal happen, Counter Down Timer will be Reset call Inc_Freq ;call subroutine increment Frequency reti ; Inc_DB_Fr_Xternal: Clr A inc DPTR ;Increment ROM Address Data Decibel movc A,@A+DPTR ;look up table data ROM and save to A cjne A,#'S',SendDb;Compare A and 'S' character if not equal will jump to SendDb call inc_Freq ;if A = 'S' then call subroutine inC_Freq SendDb: mov DataDB,A ;save data A in DataDB ret ; Inc_Freq: inc DataFreq ;Increment dataFreq this increment will happen if DataDb in maximum limit mov A,DataFreq ;save dataFreq to A cjne A,#7,GO_Inc;Compare A and #7,ifnotequalthen jump to Go_inc Clr TR0 ;Shutdown Timer 0 Clr EA ;Shutdown all Interrupt quit: sjmp quit ; GO_Inc: clr A ; mov DPTR,#DataDecibel ;look up tabel Datadecibel from ROM movc A,@A+DPTR mov DataDB,A ret ; Timer_Interupsi_0: ;This interruption will happen every 0.05s and must be reload mov tl0,#0afh ; by loading data 3CAFh to TL0 and TH0 will create an interruption mov th0,#03ch ;to TF0 every 0.05 second. djnz Count200,EndIntr ;Counter down = 200 x 0.05s = 10 detik mov Count200,#20 ;If there is no interruption external then DataDB ;or DataFreq will increment every 10 second call Inc_DB_Fr_Xternal ; EndIntr: reti ; Init_interupsi_XTernal_Timer: mov R0,#40h mov R1,#50h mov Count200,#200 ; initiate for interruption every 10 second mov tl0,#0afh mov th0,#03ch mov TMOD,#00000001b ; mode 1 timer 0 16 bit setb ET0 ; Enable timer 0 interrupt ; Setb IT0 ;Activate negative transition interrupt external 0 Setb EX0 ;Activate external interrupt 0 Setb EA ;Master Enable All Interrupt Setb PX0 ;First Interrupt for External Interruption ret ; Simpan_DataDBdanDataFreq: mov R0,CounterDFreq mov R1,CounterDDB mov @R0,DataFreq ;saving dataFreq to RAM mov @R1,DataDb ;saving dataDb to RAM inc CounterDFreq ;increment Address RAM for Frequency inc CounterDDB ;increment Address RAM for Frequency ret ; DataDecibel: DB 10,20,30,40,50,60,70,80,90,100,110,'S' end
Tidak ada komentar:
Posting Komentar
Demi Sempurnanya ^ ^