Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 14th March 2008, 12:49 AM   #1
Default A/D On 18F1320

This is so confusing this is basically my setup but its on RB1



This is the code im trying to use or well trying to correct. Can someone help. Im using a junebug (you prob know by now) as my Test Circuit and connecting RB1 from side pins to my switch.

Code:
list p=18F1320
	include <p18F1320.inc>
	CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF

LED	macro	x,y	     	;MACRO LED <PORTA>, <TRISA>
	movlw	x
	movwf	LATA		;LATA = x
	movlw	y
	movwf	TRISA		;TRISA = y
	call	Delay		;call the Delay subroutine
	endm		    	;end macro
Count	equ	0	    	;delay loop counter
	org 0x00            ; reset vector
	goto Main
	org 0x08            ;  ISR Low vector
	goto ISR
	org 0x18            ;  ISR Low vector
	goto ISR
Main
;	bsf	ADCON1,0	    ;make RA0 digital
	CLRF	PORTB		;Initialize PORTB by clearing output data latches
	CLRF	LATB		;Alternate method to clear output data latches
	MOVLW	b'00000001'
	MOVWF	ADCON1	
	MOVLW	b'11010101'
	MOVWF	ADCON0	
	MOVLW	b'00010011'
	MOVWF	ADCON2	
	MOVLW	b'11001111'
	MOVWF	TRISB	
	MOVLW	b'11111000'
	MOVWF	INTCON
	MOVLW   b'01110000'
	MOVWF	INTCON2
	MOVLW	b'00011000'
	MOVWF	INTCON3
	MOVLW   b'01000000'
	MOVWF	PIE1
LED1	LED	b'00000001',b'10111110'
LED2	LED	b'01000000',b'10111110'
LED3	LED	b'01000000',b'00111111'
LED4	LED	b'10000000',b'00111111'
LED5	LED	b'10000000',b'01111110'
LED6	LED	b'00000001',b'01111110'
	goto	LED1		;loop forever

Delay	decfsz	Count,f	;decrement Count and skip when zero
	goto	$-2	     	;not zero? repeat
	return

ISR	BCF INTCON3, 0
	BCF INTCON3, 1
	BCF INTCON, 0
	BCF INTCON, 1
	BCF INTCON, 2
	call Delay
	LED	b'00000001',b'01111110'
	call	Delay
	BSF ADCON0, 1
Loop1	BTFSC ADCON0, 1
	goto Loop1
	call	Delay
	call	Delay
	retfie
	END
AtomSoft is online now  
Old 14th March 2008, 12:57 AM   #2
Default

Hey Atom. Here's a thread with some interesting discussion on Junebug A/D. At the end of the second page is my final demo code. You may find it interesting.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is online now  
Old 14th March 2008, 01:19 AM   #3
Default

Thanks a bunch working on editing it now
AtomSoft is online now  
Old 14th March 2008, 12:55 PM   #4
Default

Well i understand a small portion but i have 3 multiplexed switches how can i get the value from it on 1 pin? This confused me. My inpu tto the switches is 5v my steady output is 3.23 volts

When button 1 pressed
4.86V
When button 2 pressed
.09v
When button 3 pressed
2.43v

Why is it all mixed? And how would i set it so default value is not a interrupt and if it changes then interrupt?
AtomSoft is online now  
Old 14th March 2008, 01:24 PM   #5
Default

i redid the buttons and now in the watch
when nothing is pressed i get

ADRESH = FF
ADRESL = C0

When Btn 1 pressed
ADRESH = 00
ADRESL = 80

When Btn 2 pressed
ADRESH = FF
ADRESL = C0

why is it the same when bt2 is pressed as no button?

AtomSoft is online now  
Old 14th March 2008, 01:33 PM   #6
Default

ok now i get

when nothing is pressed i get

ADRESH = FF
ADRESL = 80

When Btn 1 pressed
ADRESH = 00
ADRESL = 80

When Btn 2 pressed
ADRESH = 80
ADRESL = 80

Would these be good results?
AtomSoft is online now  
Old 14th March 2008, 02:02 PM   #7
Default

Ok sort of got it working
Code:
	list p=18F1320
	include <p18F1320.inc>
	CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF

	cblock	0x00
	advtemp
	endc

LED	macro	x,y	     	;MACRO LED <PORTA>, <TRISA>
	movlw	x
	movwf	LATA		;LATA = x
	movlw	y
	movwf	TRISA		;TRISA = y
	call	Delay		;call the Delay subroutine
	endm		    	;end macro
Count	equ	0	    	;delay loop counter
	org 0x00            ; reset vector
	goto Main
	org 0x08            ;  ISR Low vector
	goto ISR
	org 0x18            ;  ISR Low vector
	goto ISR
Main
;	bsf	ADCON1,0	    ;make RA0 digital
	CLRF	PORTB		;Initialize PORTB by clearing output data latches
	CLRF	LATB		;Alternate method to clear output data latches
	MOVLW	0x10        ;b'00010001'	; Set RB0
	MOVWF	ADCON1		;digital I/O pin
	MOVLW	b'11001111' ;0xCF		;Value used to initialize data direction
	MOVWF	TRISB		;Set RB<3:0> as inputs RB<5:4> as outputs RB<7:6> as inputs
	MOVLW	b'11111000' ;b'11011000'
	MOVWF	INTCON
	MOVLW   b'01110000' ;b'11110101'
	MOVWF	INTCON2
	MOVLW	b'00011000' ;b'00001000'
	MOVWF	INTCON3
	movlw	b'00010101'	;enable A/D, AN5
	movwf	ADCON0
LED1	LED	b'00000001',b'10111110'
LED2	LED	b'01000000',b'10111110'
LED3	LED	b'01000000',b'00111111'
LED4	LED	b'10000000',b'00111111'
	bsf	ADCON0,GO	;go do a/d conversion
adloop	btfsc	ADCON0,DONE
	goto	adloop
	;movff	ADRESH,advtemp
	MOVLW	0x80
NoChange	CPFSGT	ADRESH
	goto	Check1
	goto	LED1		;loop forever
Check1	MOVLW	0x80
	CPFSEQ	ADRESH
	goto Check2
	goto LED6
Check2	MOVLW	0x00
	CPFSEQ	ADRESH
	goto LED1
	goto LED5
LED5	LED	b'10000000',b'01111110'
	call Delay
	call Delay
	goto LED1
LED6	LED	b'00000001',b'01111110'
	call Delay
	call Delay
	goto	LED1		;loop forever
Delay	decfsz	Count,f	;decrement Count and skip when zero
	goto	$-2	     	;not zero? repeat
	return

ISR	BCF INTCON3, 0
	BCF INTCON3, 1
	BCF INTCON, 0
	BCF INTCON, 1
	BCF INTCON, 2
	call Delay
	LED	b'00000001',b'01111110'
	call	Delay
	call	Delay
	call	Delay
	retfie
	END
only works when holding button down i assume because its not on a interrupt?
AtomSoft is online now  
Old 14th March 2008, 02:20 PM   #8
Default

Got it! When button 1 is pressed it scrolls 1 time when button 2 is pressed it scrolls 2 times
Code:
	list p=18F1320
	include <p18F1320.inc>
	CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF

	cblock	0x00
	advtemp
	L2T
	endc

LED	macro	x,y	     	;MACRO LED <PORTA>, <TRISA>
	movlw	x
	movwf	LATA		;LATA = x
	movlw	y
	movwf	TRISA		;TRISA = y
	call	Delay		;call the Delay subroutine
	endm		    	;end macro
Count	equ	0	    	;delay loop counter
	org 0x00            ; reset vector
	goto Main
	org 0x08            ;  ISR Low vector
	goto ISR
	org 0x18            ;  ISR Low vector
	goto ISR
Main
;	bsf	ADCON1,0	    ;make RA0 digital
	CLRF	PORTB		;Initialize PORTB by clearing output data latches
	CLRF	LATB		;Alternate method to clear output data latches
	MOVLW	0x10        ;b'00010001'	; Set RB0
	MOVWF	ADCON1		;digital I/O pin
	MOVLW	b'11001111' ;0xCF		;Value used to initialize data direction
	MOVWF	TRISB		;Set RB<3:0> as inputs RB<5:4> as outputs RB<7:6> as inputs
	MOVLW	b'11111000' ;b'11011000'
	MOVWF	INTCON
	MOVLW   b'01110000' ;b'11110101'
	MOVWF	INTCON2
	MOVLW	b'00011000' ;b'00001000'
	MOVWF	INTCON3
	movlw	b'00010101'	;enable A/D, AN5
	movwf	ADCON0
StartUp 	bsf	ADCON0,GO	;go do a/d conversion
adloop	btfsc	ADCON0,DONE
	goto	adloop
	;movff	ADRESH,advtemp
;	MOVLW	0x80
;NoChange	CPFSGT	ADRESH
	;goto	Check1
	;goto	adloop		;loop forever
	MOVLW	0x02
	MOVWF	L2T
Check1	MOVLW	0x80
	CPFSEQ	ADRESH
	goto Check2
	goto LED2T
Check2	MOVLW	0x00
	CPFSEQ	ADRESH
	goto StartUp
	goto LED1T
LED1T	
	LED	b'00000001',b'10111110'
	LED	b'01000000',b'10111110'
	LED	b'01000000',b'00111111'
	LED	b'10000000',b'00111111'
	LED	b'10000000',b'01111110'
	LED	b'00000001',b'01111110'
	goto StartUp
LED2T
	LED	b'00000001',b'10111110'
	LED	b'01000000',b'10111110'
	LED	b'01000000',b'00111111'
	LED	b'10000000',b'00111111'
	LED	b'10000000',b'01111110'
	LED	b'00000001',b'01111110'
	DECFSZ	L2T
	goto	LED2T
	goto	StartUp		;loop forever
Delay	decfsz	Count,f	;decrement Count and skip when zero
	goto	$-2	     	;not zero? repeat
	return

ISR	BCF INTCON3, 0
	BCF INTCON3, 1
	BCF INTCON, 0
	BCF INTCON, 1
	BCF INTCON, 2
	call Delay
	LED	b'00000001',b'01111110'
	call	Delay
	retfie
	END
AtomSoft is online now  
Old 14th March 2008, 02:26 PM   #9
Default

issue: when i have it with LED 6 it throughs a interrupt. Why ? But works well from 1-5 LEDs
AtomSoft is online now  
Old 14th March 2008, 03:25 PM   #10
Default

Got it it had to do with INTCONx again:

Code:
	list p=18F1320
	include <p18F1320.inc>
	CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF

	cblock	0x00
	advtemp
	L2T
	endc

LED	macro	x,y	     	;MACRO LED <PORTA>, <TRISA>
	movlw	x
	movwf	LATA		;LATA = x
	movlw	y
	movwf	TRISA		;TRISA = y
	call	Delay		;call the Delay subroutine
	endm		    	;end macro
Count	equ	0	    	;delay loop counter
	org 0x00            ; reset vector
	goto Main
	org 0x08            ;  ISR Low vector
	goto ISR
	org 0x18            ;  ISR Low vector
	goto ISR
Main
;	bsf	ADCON1,0	    ;make RA0 digital
	CLRF	PORTB		;Initialize PORTB by clearing output data latches
	CLRF	LATB		;Alternate method to clear output data latches
	MOVLW	0x10        ;b'00010001'	; Set RB0
	MOVWF	ADCON1		;digital I/O pin
	MOVLW	b'11001111' ;0xCF		;Value used to initialize data direction
	MOVWF	TRISB		;Set RB<3:0> as inputs RB<5:4> as outputs RB<7:6> as inputs
	MOVLW	b'11001000' ;b'01111000' ;b'11011000'
	MOVWF	INTCON
	MOVLW   b'11110101'  ;b'01110000' ;b'11110101'
	MOVWF	INTCON2
	MOVLW	b'11011000'  ;b'00011000' ;b'00001000'
	MOVWF	INTCON3
	movlw	b'00010101'	;enable A/D, AN5
	movwf	ADCON0
StartUp 	bsf	ADCON0,GO	;go do a/d conversion
adloop	btfsc	ADCON0,DONE
	goto	adloop
	;movff	ADRESH,advtemp
;	MOVLW	0x80
;NoChange	CPFSGT	ADRESH
	;goto	Check1
	;goto	adloop		;loop forever
	MOVLW	0x02
	MOVWF	L2T
Check1	MOVLW	0x80
	CPFSEQ	ADRESH
	goto Check2
	goto LED2T
Check2	MOVLW	0x00
	CPFSEQ	ADRESH
	goto StartUp
	goto LED1T
LED1T	
	LED	b'00000001',b'10111110'
	LED	b'01000000',b'10111110'
	LED	b'01000000',b'00111111'
	LED	b'10000000',b'00111111'
	LED	b'10000000',b'01111110'
	LED	b'00000001',b'01111110'
	goto StartUp
LED2T
	LED	b'00000001',b'10111110'
	LED	b'01000000',b'10111110'
	LED	b'01000000',b'00111111'
	LED	b'10000000',b'00111111'
	LED	b'10000000',b'01111110'
	LED	b'00000001',b'01111110'
	DECFSZ	L2T
	goto	LED2T
	goto	StartUp		;loop forever
Delay	decfsz	Count,f	;decrement Count and skip when zero
	goto	$-2	     	;not zero? repeat
	return

ISR	BCF INTCON3, 0
	BCF INTCON3, 1
	BCF INTCON, 0
	BCF INTCON, 1
	BCF INTCON, 2
	call Delay
	LED	b'00000001',b'01111110'
	call	Delay
	retfie
	END
A little smaller
Code:
	list p=18F1320
	include <p18F1320.inc>
	CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF

	cblock	0x00
	advtemp
	L2T
	endc

LED	macro	x,y	     	;MACRO LED <PORTA>, <TRISA>
	movlw	x
	movwf	LATA		;LATA = x
	movlw	y
	movwf	TRISA		;TRISA = y
	call	Delay		;call the Delay subroutine
	endm		    	;end macro
Count	equ	0	    	;delay loop counter
	org 0x00            ; reset vector
	goto Main
	org 0x08            ;  ISR Low vector
	goto ISR
	org 0x18            ;  ISR Low vector
	goto ISR
Main
;	bsf	ADCON1,0	    ;make RA0 digital
	CLRF	PORTB		;Initialize PORTB by clearing output data latches
	CLRF	LATB		;Alternate method to clear output data latches
	MOVLW	0x10        ;b'00010001'	; Set RB0
	MOVWF	ADCON1		;digital I/O pin
	MOVLW	b'11001111' ;0xCF		;Value used to initialize data direction
	MOVWF	TRISB		;Set RB<3:0> as inputs RB<5:4> as outputs RB<7:6> as inputs
	MOVLW	b'11001000' ;b'01111000' ;b'11011000'
	MOVWF	INTCON
	MOVLW   b'11110101'  ;b'01110000' ;b'11110101'
	MOVWF	INTCON2
	MOVLW	b'11011000'  ;b'00011000' ;b'00001000'
	MOVWF	INTCON3
	movlw	b'00010101'	;enable A/D, AN5
	movwf	ADCON0
StartUp 	bsf	ADCON0,GO	;go do a/d conversion
adloop	btfsc	ADCON0,DONE
	goto	adloop
	;movff	ADRESH,advtemp
;	MOVLW	0x80
;NoChange	CPFSGT	ADRESH
	;goto	Check1
	;goto	adloop		;loop forever
	MOVLW	0x02
	MOVWF	L2T
Check1	MOVLW	0x80
	CPFSEQ	ADRESH
	goto Check2
	goto LED2T
Check2	MOVLW	0x00
	CPFSEQ	ADRESH
	goto StartUp
	goto LED1T
LED1T	
	call ScrollMe
	goto StartUp
LED2T
	call ScrollMe
	DECFSZ	L2T
	goto	LED2T
	goto	StartUp		;loop forever
Delay	decfsz	Count,f	;decrement Count and skip when zero
	goto	$-2	     	;not zero? repeat
	return
ScrollMe
	LED	b'00000001',b'10111110'
	LED	b'01000000',b'10111110'
	LED	b'01000000',b'00111111'
	LED	b'10000000',b'00111111'
	LED	b'10000000',b'01111110'
	LED	b'00000001',b'01111110'
	return
ISR	BCF INTCON3, 0
	BCF INTCON3, 1
	BCF INTCON, 0
	BCF INTCON, 1
	BCF INTCON, 2
	call Delay
	LED	b'00000001',b'01111110'
	call	Delay
	retfie
	END

Last edited by AtomSoft; 14th March 2008 at 03:30 PM.
AtomSoft is online now  
Old 14th March 2008, 05:09 PM   #11
Default

OMG im so glad (for myself lol) i got it with 4 buttons.

Code:
	list p=18F1320
	include <p18F1320.inc>
	CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF

	cblock	0x00
	advtemp
	L2T
	endc

LED	macro	x,y	     	;MACRO LED <PORTA>, <TRISA>
	movlw	x
	movwf	LATA		;LATA = x
	movlw	y
	movwf	TRISA		;TRISA = y
	call	Delay		;call the Delay subroutine
	endm		    	;end macro
Count	equ	0	    	;delay loop counter
	org 0x00            ; reset vector
	goto Main
	org 0x08            ;  ISR Low vector
	goto ISR
	org 0x18            ;  ISR Low vector
	goto ISR
Main
;	bsf	ADCON1,0	    ;make RA0 digital
	CLRF	PORTB		;Initialize PORTB by clearing output data latches
	CLRF	LATB		;Alternate method to clear output data latches
	MOVLW	0x10        ;b'00010001'	; Set RB0
	MOVWF	ADCON1		;digital I/O pin
	MOVLW	b'11001111' ;0xCF		;Value used to initialize data direction
	MOVWF	TRISB		;Set RB<3:0> as inputs RB<5:4> as outputs RB<7:6> as inputs
	MOVLW	b'11001000' ;b'01111000' ;b'11011000'
	MOVWF	INTCON
	MOVLW   b'11110101'  ;b'01110000' ;b'11110101'
	MOVWF	INTCON2
	MOVLW	b'11011000'  ;b'00011000' ;b'00001000'
	MOVWF	INTCON3
	movlw	b'00010101'	;enable A/D, AN5
	movwf	ADCON0
StartUp 	bsf	ADCON0,GO	;go do a/d conversion
adloop	btfsc	ADCON0,DONE
	goto	adloop
	;movff	ADRESH,advtemp
;	MOVLW	0x80
;NoChange	CPFSGT	ADRESH
	;goto	Check1
	;goto	adloop		;loop forever
	MOVLW	0xEE
	CPFSLT	ADRESH
	goto	StartUp
	MOVLW	0x02
	MOVWF	L2T
Check1	MOVLW	0xBF
	CPFSGT	ADRESH
	goto Check2
	MOVLW	0x04
	MOVWF	L2T
	goto LEDXT
Check2	MOVLW	0x7F
	CPFSGT	ADRESH
	goto Check3
	MOVLW	0x03
	MOVWF	L2T
	goto LEDXT
Check3	MOVLW	0x3F
	CPFSGT	ADRESH
	goto Check4
	MOVLW	0x02
	MOVWF	L2T
	goto LEDXT
Check4	MOVLW	0x00
	CPFSEQ	ADRESH
	goto StartUp
	goto LED1T
LED1T	
	call ScrollMe
	goto StartUp
LEDXT
	call ScrollMe
	DECFSZ	L2T
	goto	LEDXT
	goto	StartUp		;loop forever
Delay	decfsz	Count,f	;decrement Count and skip when zero
	goto	$-2	     	;not zero? repeat
	return
ScrollMe
	LED	b'00000001',b'10111110'
	LED	b'01000000',b'10111110'
	LED	b'01000000',b'00111111'
	LED	b'10000000',b'00111111'
	LED	b'10000000',b'01111110'
	LED	b'00000001',b'01111110'
	return
ISR	BCF INTCON3, 0
	BCF INTCON3, 1
	BCF INTCON, 0
	BCF INTCON, 1
	BCF INTCON, 2
	call Delay
	LED	b'00000001',b'01111110'
	call	Delay
	retfie
	END
AtomSoft is online now  
Old 14th March 2008, 05:43 PM   #12
Default

Here is it commented for those who get stuck:
Code:
	list p=18F1320
	include <p18F1320.inc>
	CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF

	cblock	0x00
	advtemp
	L2T
	endc

LED	macro	x,y	     	;MACRO LED <PORTA>, <TRISA>
	movlw	x
	movwf	LATA		;LATA = x
	movlw	y
	movwf	TRISA		;TRISA = y
	call	Delay		;call the Delay subroutine
	endm		    	;end macro
Count	equ	0	    	;delay loop counter
	org 0x00            ; reset vector
	goto Main
	org 0x08            ;  ISR Low vector
	goto ISR
	org 0x18            ;  ISR Low vector
	goto ISR
Main
	CLRF	PORTB		;Initialize PORTB by clearing output data latches
	CLRF	LATB		;Alternate method to clear output data latches
	MOVLW	0x01        ;A/D Config
	MOVWF	ADCON1		;ADCON1: All analog except AN0
	MOVLW	b'00000010' ;TRISB Config
	MOVWF	TRISB		;Set RB1 as input RB<7:2> and RB0 as outputs
	MOVLW	b'11001000' ;INTCON Config
	MOVWF	INTCON		;Enable GIE/GIEH, PEIE/GIEL, RBIE Disable rest
	MOVLW   b'11110101' ;INTCON2 Config
	MOVWF	INTCON2		;Enable RBPU, Rising Edge Interrupts, High Priority
	MOVLW	b'11001000' ;INTCON3 Config
	MOVWF	INTCON3		;High Priority, Enable INT1 and Clear Flags
	movlw	b'00010101'	;enable A/D, AN5
	movwf	ADCON0
StartUp 	bsf	ADCON0,GO	;Start A/D conversion
adloop	btfsc	ADCON0,DONE ;Check if done. If not goto adloop else skip loop
	goto	adloop
	MOVLW	0xEE 			;Button Pressed Preset
	CPFSLT	ADRESH			;If ADRESH < Skip the goto else start over 
	goto	StartUp			;because no button pressed
Check1	MOVLW	0xBF		;4th button Preset
	CPFSGT	ADRESH			;If ADRESH > BFH then this button was pressed
	goto Check2				;If not then it wasnt pressed skip to next check
	MOVLW	0x04			
	MOVWF	L2T				;Set L2T to 0x04 (MY LOOP COUNTER)
	goto LEDXT				;Goto LEDXT which is the Light X Times where x = 4h for this button
Check2	MOVLW	0x7F		;3rd button preset
	CPFSGT	ADRESH			;If ADRESH > 7FH then this button was pressed
	goto Check3				;If not then it wasnt pressed skip to next check
	MOVLW	0x03			
	MOVWF	L2T				;Set L2T to 0x03 (MY LOOP COUNTER)
	goto LEDXT				;Goto LEDXT which is the Light X Times where x = 3h for th
Check3	MOVLW	0x3F		;Same as others
	CPFSGT	ADRESH
	goto Check4
	MOVLW	0x02
	MOVWF	L2T
	goto LEDXT
Check4	MOVLW	0x00		;Same
	CPFSEQ	ADRESH			;If ADRESH = 0 then goto LED1T because button 1 was hit
	goto StartUp			;if not then goto startup
	goto LED1T				;LED 1 Time
LED1T	
	call ScrollMe			;Scroll LEDs 1 time
	goto StartUp			;Goto Startup
LEDXT 						;LEDXT loop
	call ScrollMe			;Scroll 1 time
	DECFSZ	L2T				;Decrement L2T and skip the next line if 0
	goto	LEDXT			;goto ledxt loop
	goto	StartUp			;Goto StartUp
Delay	decfsz	Count,f	;decrement Count and skip when zero
	goto	$-2	     	;not zero? repeat
	return
ScrollMe
	LED	b'00000001',b'10111110'	; Light LED 1
	LED	b'01000000',b'10111110'	; Light LED 2
	LED	b'01000000',b'00111111'	; Light LED 3
	LED	b'10000000',b'00111111'	; Light LED 4
	LED	b'10000000',b'01111110'	; Light LED 5
	LED	b'00000001',b'01111110'	; Light LED 6
	return 						; Return from where called
ISR	BCF INTCON3, 0 				; Clear INT1
	BCF INTCON, 0				; Clear RBIF: RB Port Change Interrupt Flag bit
	LED	b'00000001',b'01111110' ; Light LED 6
	call	Delay				; 2 delays 
	call	Delay
	retfie						; Return from where called
	END
AtomSoft is online now  
Old 14th March 2008, 06:19 PM   #13
Default



AtomSoft is online now  
Old 14th March 2008, 09:17 PM   #14
Default

AtomSoft is online now  
Old 14th March 2008, 09:42 PM   #15
Default

That's great, did you use the debugger to help solve it?
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com/
blueroomelectronics is offline  
Reply

Tags
a or d

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
18F1320 A/D Conversion UTMonkey Micro Controllers 5 27th December 2007 05:48 AM
18f1320 - Tris = Ok, Lat = ? UTMonkey Micro Controllers 6 8th December 2007 02:55 AM
A/D question YAN-1 Micro Controllers 6 26th October 2007 01:50 AM
a/d conversion16f877 Handel Micro Controllers 4 16th October 2007 08:05 AM
18F1320 internal OSC doubling itself Oznog Micro Controllers 1 12th October 2005 07:50 AM



All times are GMT. The time now is 04:28 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker