Continue to Site

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.

  • 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.

error 302

Status
Not open for further replies.

Thunderchild

New Member
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
 
hi TC
Just add this line in the header of your program.:) Just under the #include....


errorlevel -302, -207
 
Last edited:
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
 
That is NOT an error. Is just information passed to you.

It simply tells that something is going on.
 
Well, it should. Have you got a crystal correctly wired up and MCLR connected to Vdd via a resistor?

Mike.
 
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....
 
Last edited:
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.
 
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)
 
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.
 
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.
 
And the 628A is obsolete, replaced by the 16F88. etc.:D

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.
 
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 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.

see same logic as sellig the programmer !
 
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,

It's the identical 14 bit core to all the other 16 series chips, it's simply a question of setting the hardware correctly - so turn off the analogue inputs etc., and make sure you set the start of GPR's correctly.
 
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,

Some 16F88 code at the back of my Firefly manual, I like the 16F88 it's a really nice part and has debug support, self flashing, and plenty of other goodies.

I've migrated over to the 18F series well because they're just that much nicer than the 16F IMO

I don't miss STATUS,RP0 or the RMW stuff ;)
 
It's the identical 14 bit core to all the other 16 series chips, it's simply a question of setting the hardware correctly - so turn off the analogue inputs etc., and make sure you set the start of GPR's correctly.

so really its a case of putting in the correct __config directives ? and setting the inc file to the F88
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top