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.

Got stuck with my project..Pls Help

Status
Not open for further replies.

rkn

New Member
Hi der,
I was building a mini robotics project (with PIC 16F628A) having only one sensor. I hav one H bridge and an LDR proximity sensor.
The problem is that there is no output from the PIC; when checking the o/p no voltage is there . When generating the hex file of pgm using MPASM, one warning is shown. the message is:
"Message[302] D:\PGM\PGM.ASM 52 : Register in operand not in bank 0. Ensure that bank bits are correct."
I think the port is not configured. What might be the problem? pls help
 

jimlovell777

New Member
It's hard to say without seeing the code. How is the LDR connected to the PIC? Is it connected to the comparator input?
 

petrv

New Member
Check settings of the TRIS register to be sure you set the correct port bits to output. Also be sure you are in the correct bank (bank 1) when you work with bank 1 registers (like TRIS) and then do not forget to switch back to the bank 0. Another suggestion would be to use PIC16F88 (superset of 16F628A) or even PIC18F - at least for the development stage - they are debuggable (PicKit 2 is very cheap and very useful for debugging such problems). Also with PIC18F you do not need to worry about switching banks.

Petr
 

rkn

New Member
@jimlovell777

Ya! the LDR is connected to the comparator(using IC CA3410)...
I have checked the correctness of the LDR using an LED
Also the H bridge is working too...
 

rkn

New Member
See nigel's tutorials


Start small. Turn on an LED, make it blink, blablabla.

@Vizier87

I forgot to say that...
I have checked with a simple LED connecting to the PIC ..it didin't worked
I think my problem is with switching the bank..
 

rkn

New Member
Check settings of the TRIS register to be sure you set the correct port bits to output. Also be sure you are in the correct bank (bank 1) when you work with bank 1 registers (like TRIS) and then do not forget to switch back to the bank 0. Another suggestion would be to use PIC16F88 (superset of 16F628A) or even PIC18F - at least for the development stage - they are debuggable (PicKit 2 is very cheap and very useful for debugging such problems). Also with PIC18F you do not need to worry about switching banks.

Petr

here is my pgm pls rectify it guys, since there is no one to help me out

LIST p=16F628A
include "P16F628A.inc"
__config 0x30c4
intcon equ 0Bh
porta equ 05h
portb equ 06h
trisa equ 85h
trisb equ 86h
status equ 03h
count equ 20h
count1 equ 21h
count2 equ 22h
goto main
Org 0004h
clrf porta;interupt
bcf status,5
bsf porta,0
bsf porta,3;bckwrd motion
clrwdt
call mindelay
call mindelay
call mindelay
clrf porta;stop
clrwdt
bsf porta,7;sensor LED
call mindelay
btfsc portb,1
goto right
left bsf porta,0
bsf porta,2
call mindelay
clrf porta
call mindelay
decfsz count,1
goto left
bcf intcon,1
retfie
right bsf porta,1
bsf porta,3
call mindelay
clrf porta
call mindelay
decfsz count,1
goto right
bcf intcon,1
retfie
main bsf intcon,7
bsf intcon,4
bcf intcon,1;clear flag bit
bsf status,5
movlw 00h
movwf trisa
movlw 03h
movwf trisb
bcf status,5
movlw 07h
movwf 81h
fwd bsf porta,2; fwd
bsf porta,1
clrwdt
call mindelay
clrf porta
call mindelay
goto fwd
mindelay decfsz count1,1
goto mindelay
decfsz count2,1
goto mindelay
return
end
 

rkn

New Member
post the code. it helps, since your electronics seem to be functional.

I also wrote a simple pgm ... but still the same problem

LIST p=16F628A
include "P16F628A.inc"
__config 0x30c4 ;
org 0000h
count equ 20h
status equ 03h
count1 equ 21h
porta equ 05h
trisa equ 85h
bsf status,5
clrf trisa
bcf status,5
main bsf porta,0
call delay
call delay
call delay
bcf porta,0
call delay
call delay
call delay
goto main
delay decfsz count,1
goto delay
decfsz count1,1
goto delay
return
end


the error message is

"Message[302] D:\PROJECT\ONOFF.ASM 11 : Register in operand not in bank 0. Ensure that bank bits are correct.
"

pls have a look on it
 

Vizier87

Active Member
did you use templates? It'll be easier to work from there. Start from project>project wizard>get source files from microchip in prog files> establish your project.
 

spindrah

New Member
I'm still waiting for the responses.. had anyone checked my code?

I'm not a big Assembler guy, but shouldn't you use a lot of comments? I know when i write a little code, and thats all I have done, I Comment the **** out of it.
 
Status
Not open for further replies.

Latest threads

Top