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 22nd June 2008, 12:13 PM   #1
Default error 302

I keep getting:

Message[302] K:\CODE\BLINKER\BLINKER 16F84A.ASM 23 : Register in operand not in bank 0. Ensure that bank bits are correct.

the program is as follows:

Code:
;Declarations and microcontroller configuration

		PROCESSOR 16f84
		#include "p16f84A.inc"

	__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC

; Declaration of variables

	cblock 	0x20 			;start of general purpose registers
		count1 			;used in delay routine
		counta 			;used in delay routine 
		countb 			;used in delay routine
	endc
	
	org	0x0000			;org sets the origin, 0x0000 for the 16F628,
					;this is where the program starts running	


   	bsf 	STATUS,		RP0	;select bank 1
   	movlw 	b'00000000'		;set PortB all outputs
   	movwf 	TRISB
	movwf	TRISA			;set PortA all outputs
	bcf	STATUS,		RP0	;select bank 0

Loop	
	movlw	0xff
	movwf	PORTA			;set all bits on
	movwf	PORTB
	nop				;the nop's make up the time taken by the goto
	nop				;giving a square wave output
	call	Delay			;this waits for a while!
	movlw	0x00
	movwf	PORTA
	movwf	PORTB			;set all bits off
	call	Delay
	goto	Loop			;go back and do it again

Delay	movlw	d'250'			;delay 250 ms (4 MHz clock)
	movwf	count1
d1	movlw	0xC7
	movwf	counta
	movlw	0x01
	movwf	countb
Delay_0
	decfsz	counta, f
	goto	$+2
	decfsz	countb, f
	goto	Delay_0

	decfsz	count1	,f
	goto	d1
	retlw	0x00

	end
__________________
I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

www.simonsphotography.org.uk/ - My other hobby
www.rushdenrotaract.org.uk/ - make a difference and have fun !


Never buy "Trust" products, all mine broke !!!
Thunderchild is offline  
Old 22nd June 2008, 12:39 PM   #2
Default

hi TC
Just add this line in the header of your program. Just under the #include....


errorlevel -302, -207
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 22nd June 2008 at 12:40 PM.
ericgibbs is offline  
Old 22nd June 2008, 12:55 PM   #3
Default

ok so what does it do ?

is the error really a problem ? or just a warning

the program does not seem to work in any case
__________________
I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

www.simonsphotography.org.uk/ - My other hobby
www.rushdenrotaract.org.uk/ - make a difference and have fun !


Never buy "Trust" products, all mine broke !!!
Thunderchild is offline  
Old 22nd June 2008, 01:18 PM   #4
Default

That is NOT an error. Is just information passed to you.

It simply tells that something is going on.
__________________
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
atferrari is offline  
Old 22nd June 2008, 01:22 PM   #5
Default

ok well the program does not work anyhow
__________________
I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

www.simonsphotography.org.uk/ - My other hobby
www.rushdenrotaract.org.uk/ - make a difference and have fun !


Never buy "Trust" products, all mine broke !!!
Thunderchild is offline  
Old 22nd June 2008, 03:14 PM   #6
Default

Well, it should. Have you got a crystal correctly wired up and MCLR connected to Vdd via a resistor?

Mike.
Pommie is online now  
Old 22nd June 2008, 03:15 PM   #7
Default

Quote:
Originally Posted by Thunderchild View Post
ok well the program does not work anyhow
hi TC,
Made some minor changes, marked with ++++ symbols.

It works OK in the PIC simulator, PORTA & B On/Off/On....
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 7th July 2008 at 12:26 PM.
ericgibbs is offline  
Old 22nd June 2008, 09:30 PM   #8
Default

Quote:
Originally Posted by Pommie View Post
Well, it should. Have you got a crystal correctly wired up and MCLR connected to Vdd via a resistor?

Mike.
pommie it don't need a crystal basically its nigels 1.2 tutorial code pasted into a basic 18F84A setup i was just trying to fool around.
__________________
I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

www.simonsphotography.org.uk/ - My other hobby
www.rushdenrotaract.org.uk/ - make a difference and have fun !


Never buy "Trust" products, all mine broke !!!
Thunderchild is offline  
Old 22nd June 2008, 09:30 PM   #9
Default

Quote:
Originally Posted by ericgibbs View Post
hi TC,
Made some minor changes, marked with ++++ symbols.

It works OK in the PIC simulator, PORTA & B On/Off/On....
thanks eric I'll give it a go later (just got to prepare another wall wart for breadboard use the last one went caput for no reason)
__________________
I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

www.simonsphotography.org.uk/ - My other hobby
www.rushdenrotaract.org.uk/ - make a difference and have fun !


Never buy "Trust" products, all mine broke !!!
Thunderchild is offline  
Old 23rd June 2008, 02:11 AM   #10
Default

Quote:
Originally Posted by Thunderchild View Post
pommie it don't need a crystal basically its nigels 1.2 tutorial code pasted into a basic 18F84A setup i was just trying to fool around.
The 16F84 doesn't have an internal oscillator, so if you don't have a crystal the PIC won't run at all.
BeeBop is offline  
Old 23rd June 2008, 09:05 AM   #11
Default

Quote:
Originally Posted by Thunderchild View Post
pommie it don't need a crystal basically its nigels 1.2 tutorial code pasted into a basic 18F84A setup i was just trying to fool around.
As already mentioned, the long obselete 16F84A doesn't have an internal oscillator, so you MUST provide an external one.

But you shouldn't be using the 16F84, it was replaced last century by the 16F628, which is much higher spec and cheaper.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 23rd June 2008, 03:22 PM   #12
Default

Quote:
Originally Posted by Nigel Goodwin View Post
As already mentioned, the long obselete 16F84A doesn't have an internal oscillator, so you MUST provide an external one.

But you shouldn't be using the 16F84, it was replaced last century by the 16F628, which is much higher spec and cheaper.
The 628 is also obsolete. Replaced by the 628A. The PICkit 2 won't program the 628, but it will program the 628A.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is online now  
Old 23rd June 2008, 03:54 PM   #13
Default

And the 628A is obsolete, replaced by the 16F88. etc.

Mike.
Pommie is online now  
Old 23rd June 2008, 05:17 PM   #14
Default

Quote:
Originally Posted by Pommie View Post
And the 628A is obsolete, replaced by the 16F88. etc.
Except MicroChip never released a migration document from the 628 to the 88, nor have ever listed the 628A as obselete and not recommended for new projects, as they did for the 84A way back in the last century.

The 84 is the PIC equivilent of the 741, an old obselete expensive device, that people still seem to keep using for some silly reason.

I think the worst thing MicroChip did was re-release the 84A, I can see their point, why not sell a cheaper device for more money than more expensive ones - but it stikes me as a very shoddy practice.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 23rd June 2008, 06:27 PM   #15
Talking

Quote:
Originally Posted by Nigel Goodwin View Post
As already mentioned, the long obselete 16F84A doesn't have an internal oscillator, so you MUST provide an external one.

But you shouldn't be using the 16F84, it was replaced last century by the 16F628, which is much higher spec and cheaper.
oops thanks fot that nigel now its VERY clear why it won't wotk

I'm trying to use the 16F88 as my starter pic but trying to get sample code for it is a joke,
__________________
I AM the exeption that disproves the rule in many ways but the rules still apply (unfortunately)

www.simonsphotography.org.uk/ - My other hobby
www.rushdenrotaract.org.uk/ - make a difference and have fun !


Never buy "Trust" products, all mine broke !!!
Thunderchild is offline  
Reply

Tags
302, error

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
PIC error. apple9 Micro Controllers 1 6th April 2008 10:01 AM
Pspice LED Error kogula14 Electronic Projects Design/Ideas/Reviews 3 14th March 2007 05:03 AM
PCB error Electronics4you General Electronics Chat 4 20th October 2006 09:29 PM
Error 302 Six-Sixteen Micro Controllers 7 17th February 2004 05:07 PM
Need Assistance , Another Verify Error At OOOOh! Error MindShaper Micro Controllers 0 4th September 2003 03:05 PM



All times are GMT. The time now is 03:36 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker