Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INCLUDE 'derivative.inc'
- ;-------------------------------------------------------------------------------------------------------
- ORG Z_RAMStart ;MEMORIAS Y VARIABLES RAM
- ;-------------------------------------------------------------------------------------------------------
- ORG ROMStart ;PROGRAMA
- start:
- LDA #2T ;//apaga el watchdog
- STA SOPT1
- CLR PTAD ;//configuras los puertos
- CLR PTBD
- CLR PTCD
- MOV #$00,PTADD
- MOV #$FF,PTBDD
- MOV #$00,PTCDD
- ;configurar puertos
- ;cofiguras adc
- MOV #$68,ADCSC1
- MOV #$60,ADCCFG
- MOV #$01,APCTL2
- ;configuras adc
- BRA * ;bucle infinito
- ;interrupcion
- ADCISR:
- PSHH
- LDA ADCRL
- CMP #102T ;//Valores limite, 102 = 2v
- BLS CASOL
- CMP #153T ;//valores limite, 153 = 3v
- BLS CASO-
- MOV #$76,PTBD
- BRA SALIR
- CASO-:
- MOV #$40,PTBD
- BRA SALIR
- CASOL:
- MOV #$38,PTBD
- SALIR:
- PULH
- RTI
- ;interrupcion
- ;origen del adc
- ORG Vadc
- DC.W ADCISR
- ORG Vreset ;VECTOR DE INTERRUPCION
- DC.W start ;ORIGEN DEL PROGRAMA
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement