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 #51T ;//Valores limite, 51 = 1v
- BLS CASO8
- CMP #128T ;//valores limite, 128 = 2,5v
- BLS CASOA
- CMP #168T ;168 = 3,3V
- BLS CASOT
- MOV #$76,PTBD
- BRA SALIR
- CASOT: MOV #$46,PTBD
- BRA SALIR
- CASOA:
- MOV #$40,PTBD
- BRA SALIR
- CASO8:
- MOV #$7F,PTBD
- BRA SALIR
- 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