device sx28l,stackx_optionx device oscxt5,turbo freq 50000000 reset reset_entry org 10h dato ds 1 CLK equ rb.6 D0 equ rb.7 CS equ rb.5 ;**************************************************************************************************************** ;**************************************************************************************************************** salidapuerto jmp @salida_puerto ret conversion jmp @conver_sion ret sacodato jmp @saco_dato ret pausa jmp @pau_sa ret ;**************************************************************************************************************** org 50h reset_entry mov rc,#%00000000 ;init rc mov !rc,#%00000000 mov rb,#%00100000 ;init rb mov !rb,#%10000010 mov w,#$0E ; mov M,w ; mov !rb,#%011111111 ; mov w,#$0F ; mov M,w ; clrb CLK setb CS ;**************************************************************************************************************** ; MAIN ;**************************************************************************************************************** ; principal call @conversion mov rc,dato call @salidapuerto jmp principal ;****************************************************************************************************************** org 400 ;**************************************************************************************************************** ; SUBRUTINAS ;**************************************************************************************************************** salida_puerto clrb rb.0 ; WAIT line nopasa snb rb.1 ; Data Strobe line jmp nopasa ; nop setb rb.0 yafue sb rb.1 ; finish the handshaking when the rb.1 is high jmp yafue retp ;**************************************************************************************************************** conver_sion ; devuelve el valor leido del conversor en la variable DATO. mov dato,#0 clrb CLK clrb CS call @pausa setb CLK call @pausa clrb CLK call @pausa setb CLK call @pausa clrb CLK call @pausa ; call @sacodato ; setb CLK call @pausa clrb CLK call @pausa ; call @sacodato ; setb CLK call @pausa clrb CLK call @pausa ; call @sacodato ; setb CLK call @pausa clrb CLK call @pausa ; call @sacodato ; setb CLK call @pausa clrb CLK call @pausa ; call @sacodato ; setb CLK call @pausa clrb CLK call @pausa ; call @sacodato ; setb CLK call @pausa clrb CLK call @pausa ; call @sacodato ; setb CLK call @pausa clrb CLK call @pausa ; call @sacodato ; setb CLK call @pausa clrb CLK call @pausa setb CS retp ;**************************************************************************************************************** saco_dato snb D0 ; comparo el D0 para ver si era alto jmp @cenalto jmp @cenbajo cenalto setb $03.0 rl dato ; retp cenbajo clrb $03.0 rl dato ; retp ;**************************************************************************************************************** pau_sa ; 0.25 uSeg minimo total 13 ciclos de reloj a 50 Mhz nop nop nop nop nop retp ;****************************************************************************************************************
file: /Techref/scenix/lib/io/osi2/parallel/ADC08831sample.SRC, 3KB, , updated: 2002/2/14 17:03, local time: 2024/8/14 20:38,
3.145.93.173:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/scenix/lib/io/osi2/parallel/ADC08831sample.SRC"> scenix lib io osi2 parallel ADC08831sample</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.