• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how do you use the include file

Status
Not open for further replies.

tempus

Member
Hey all;

I just tried to build my first PIC project, but got tons of errors, most of which were:
Code:
Error[113]   TEMPLATE\CODE\MYCODE.ASM 18 : Symbol not previously defined (osccan)
or porta, or ircf2, etc.

I had originally had equ statements for these addresses, but after reading about the .inc file, I thought they were unnecessary (i.e., the inc file took care of these things). Evidently I was wrong, unless I'm using the inc file incorrectly. Here's my code from the top:

Code:
	list	p=pic16f737
		#include	<P16F737.inc>		; processor specific variable definitions
		radix	hex
;
	__CONFIG    _CONFIG1,  _CP_OFF & _CCP2_RB3 & _DEBUG_OFF & _VBOR_2_0 & _BOREN_0 & _MCLR_ON & _PWRTE_ON & _WDT_OFF & _INTRC_IO
	__CONFIG    _CONFIG2,  _BORSEN_0 & _IESO_OFF & _FCMEN_OFF
;------------------------------------------------------------
Is this the proper way to implement the inc file? Also, if the inc file is not a replacement for the equ directive, what is its purpose?
Oh, I also am writing in assembly language, if that makes a difference.

Thanks
 
Last edited:

kchriste

New Member
Forum Supporter
Yes, that is the proper way to implement the inc file by using the #include.
If you open the include file and look at the EQU and DEFINE statements inside it, you'll be able to determine the correct syntax/spelling.
 

tempus

Member
Code:
;=============Pedalboard PIC code JFETs===============2009 08 26===

		list	p=pic16f737
		#include	<P16F737.inc>		; processor specific variable definitions
		radix	hex
;
	__CONFIG    _CONFIG1,  _CP_OFF & _CCP2_RB3 & _DEBUG_OFF & _VBOR_2_0 & _BOREN_0 & _MCLR_ON & _PWRTE_ON & _WDT_OFF & _INTRC_IO
	__CONFIG    _CONFIG2,  _BORSEN_0 & _IESO_OFF & _FCMEN_OFF
;------------------------------------------------------------
;				Counter locations
dbcount		equ		0x21
dc1			equ		0x22
;------------------------------------------------------------
			org		0x000
;
;Initialization

start		bsf 	osccan,ircf2 	;set int osc 110=4Mhz	
			bsf 	osccan,ircf1			
			bcf 	osccan,ircf0
			bsf		adcon1,pcfg3	;make all pins digital I/O
			bsf		adcon1,pcfg2			 
			bsf		adcon1,pcfg1
			bsf		adcon1,pcfg0	
			movlw	0xf8			;load w with 11111000
			tris	porta			;make RA0-RA4 inputs,RA5-RA7 outputs
			movlw	0xff			;load w with 1's
			tris	portb			;make portb inputs	
			bcf		option_reg,7	;enable portb pullups
			movlw	0x00			;load w with 0's
			tris	portc			;make portc outputs
			bsf		porta,6			;output hi RA6 - mute on
			nop		
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			movlw	0xaa			;load w with 10101010
			movwf	portc			;all effects bypassed
			bcf		porta,6			;output lo RA6 - mute off

;Main Program			

switch		btfss	porte,3			;bypass switch hi?
			goto	bypass			;no - swtich pressed
			btfss	porta,0			;comp vb switch hi?
			goto	compvb			;no - switch pressed
			btfss	porta,1			;comp switch hi?
			goto	comp			;no - switch pressed
			btfss	porta,2			;flanger switch hi?
			goto	fl				;no - switch pressed
			btfss	porta,3			;chorus switch hi?
			goto	chorus			;no - switch pressed
			btfss	porta,4			;delay switch hi?
			goto	delay			;no - switch pressed
			btfss	portb,0			;comp delay switch hi?
			goto	compdly			;no - switch pressed
			btfss	portb,1			;comp flanger switch hi?
			goto	compflanger		;no - switch pressed
			btfss	portb,2			;ch delay switch hi?
			goto	chdelay	 		;no - switch pressed
			btfss	portb,3			;clch delay switch hi?
			goto	clch delay		;no - switch pressed
			btfss	portb,4			;cl flanger switch hi?
			goto	clflanger		;no - switch pressed
			btfss	portb,5			;cl chorus switch hi?
			goto	clchorus		;no - switch pressed
			btfss	portb,6			;clean switch hi?
			goto	clean			;no - switch pressed
			btfss	portb,7			;comp delay vb switch hi?
			goto	compdlyvb		;no - switch pressed
			goto	switch			;check all switches again

;					Switch Actions
;
bypass		;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	porte,3			;if button up (RE3 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly
			;	actual switching	
			bsf		porta,6			;turn mute on
			nop
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			movlw	0xaa			;load w with 10101010
			movwf	portc			;all effects bypassed
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off			
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	porte,3			;if button down (RE3 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			
compvb		;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	porta,0			;if button up (RA0 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'01101010'		
			movwf	portc			;turn comp on
			bcf		porta,5			;output lo RA5 - vb on
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	porta,0			;if button down (RA0 = lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

comp		;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	porta,1			;if button up (RA1 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'01101010'		
			movwf	portc			;turn comp on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	porta,1			;if button down (RA1 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

flanger		;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	porta,2			;if button up (RA2 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'10011010'		
			movwf	portc			;turn flanger on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	porta,2			;if button down (RA2 = lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

chorus		;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	porta,3			;if button up (RA3 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'10100110'		
			movwf	portc			;turn chorus on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	porta,3			;if button down (RA3 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

delay		;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	porta,4			;if button up (RA4 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'10101001'		
			movwf	portc			;turn delay on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
				;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	porta,4			;if button down (RA4 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

compdelay	;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	portb,0			;if button up (RB0 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'01101001'		
			movwf	portc			;turn comp and delay on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off	
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	portb,0			;if button down (RB0 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

compflanger	;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	portb,1			;if button up (RB1 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'01011010'		
			movwf	portc			;turn comp and flanger on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	portb,1			;if button down (RB1 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

chdelay		;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	portb,2			;if button up (RB2 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'10100101'		
			movwf	portc			;turn chorus and delay on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	portb,2			;if button down (RB2 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

clchdelay	;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	portb,3			;if button up (RB3 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'10100101'		
			movwf	portc			;turn chorus and delay on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bcf		porta,7			;output lo RA7 - clean channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	portb,3			;if button down (RB3 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

clflanger	;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	portb,4			;if button up (RB4 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'10011010'		
			movwf	portc			;turn flanger on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bcf		porta,7			;output lo RA7 - clean channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	portb,4			;if button down (RB4 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

clchorus	;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	portb,5			;if button up (RB5 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'10100110'		
			movwf	portc			;turn chorus on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bcf		porta,7			;output lo RA7 - clean channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	portb,5			;if button down (RB5 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

clean		;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	portb,6			;if button up (RB6 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'10101010'		
			movwf	portc			;turn chorus and delay on
			bsf		porta,5			;output hi RA5 - vb off
			nop
			bcf		porta,7			;output lo RA7 - clean channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	portb,6			;if button down (RB6 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again

compdlyvb	;	debounce switch down
db_down		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
dn_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	dn_dly
			btfsc	portb,7			;if button up (RB7 hi),
			goto	db_down			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	dn_dly	
			;	actual switching
			bsf		porta,6			;turn mute on
			movlw	b'01101001'		
			movwf	portc			;turn comp and delay on
			bcf		porta,5			;output lo RA5 - vb on
			nop
			bsf		porta,7			;output hi RA7 - lead channel on
			call	mutedelay		;mute for 2ms
			bcf		porta,6			;turn mute off
			;	debounce switch up 
db_up		movlw	0x0d			;max count = 10ms/768us = 13 = 0x0d
			movwf	dbcount
			clrf	dc1				;reset dc1
up_dly		incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			btfss	portb,7			;if button down (RB7 lo),
			goto	db_up			;	restart count
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			goto	switch			;check switches again
;-----------------------------------------------------------------------------
;					mutedelay - 2ms delay 
;
mutedelay	movlw	0x03			;max count = 2ms/768us = 3
			movwf	dbcount
			clrf	dc1				;reset dc1
			incfsz	dc1,f			;delay 256x3 = 768us
			goto	up_dly
			decfsz	dbcount,f		;else repeat until max count is reached
			goto	up_dly
			return	
			end

Yes, that is the proper way to implement the inc file by using the #include.
OK, good to know I have that right. But does the inc file replace the equ statements in the header? For example, do I need to put
Code:
porta      equ         0x05
in the header or is that already taken care of by the equ file?

Thanks again
 
Last edited:

tempus

Member
That was my understanding too, but if it has the equates, why do I get the 'Symbol not previously defined (porta)' errors? Is the inc file just to show you how to lay out the statements or does it actually replace the equ statements?

Thanks
 

tempus

Member
The TRIS PORTA is only valid for 12bit core PICs. You movwf TRISA with 14bit core PICs. You also have to set the bank first.
grrrr...

It seems all the tutorials and books I've been reading are for 12 bit core PICs, which means that most of my code must also be incorrect. Can you post an example of what the code should be for, say, configuring port A as inputs?

Thanks
 

Pommie

Well-Known Member
Most Helpful Member
That was my understanding too, but if it has the equates, why do I get the 'Symbol not previously defined (porta)' errors? Is the inc file just to show you how to lay out the statements or does it actually replace the equ statements?

Thanks
They are defined in upper case in the include file so porta should be PORTA.

Mike.
 

blueroomelectronics

Well-Known Member
And you have to be aware of which bank the SFRs are in too.
Code:
    movlw    0x00
    bsf    STATUS, RP0
    movwf    TRISA
    movwf    TRISB
    bcf    STATUS, RP0
    movlw    0xFF
    movwf    PORTA
    movwf    PORTB
 

tempus

Member
They are defined in upper case in the include file so porta should be PORTA.
...cursed case sensitivity.

Thanks for that Mike - it fixed some of my problems anyway.

BRE,

Can I append your code to make sure I know what's going on here?
Code:
 movlw    0x00
    bsf    STATUS, RP0   ;select bank 1
    movwf    TRISA        ;make porta ouputs
    movwf    TRISB        ;make portb ouputs
    bcf    STATUS, RP0    ; select bank 0
    movlw    0xFF
    movwf    PORTA        ;set porta outputs hi
    movwf    PORTB        ;set portb outputs hi
 

atferrari

Well-Known Member
Disable it, if you like

tempus ...cursed case sensitivity.
The option to disable case sensitivity exists in MPLAB
 

tempus

Member
The code is being used to monitor the state of 14 different momentary contact switches, debounce them, and turn on and off JFETs defined by that switch.

It does look cut and pasted, but there are slight differences in each one of the groups (not sure if that's the right word). I.e., the group that starts with 'bypass' is slightly different than the group that starts with 'compvb' (the difference being in the pin being tested and the bit pattern sent to the ouput port C).

Thanks
 

birdman0_o

Active Member
You are going to have "Repeated label errors"
Mplab takes the string File and converts it into the corresponding program address, it cannot go two places at once!
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top