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
 
LinkBack Thread Tools Display Modes
Old 7th June 2005, 08:18 PM   (permalink)
Default using Interrupts....

How can i set the port b as an interruption....i want to take tha value in that port everytime i change a input pin....help me please!
striker2509 is offline  
Old 7th June 2005, 08:41 PM   (permalink)
Default

you must specify on wich PIC do you work? :?:

but there is a special source of interruption for PORTB

1st on pin0

2nd on changes at B port

i think you must enabel all interrupt & set correctly the "INTCON" register
i am not about the register nam

& olso set the interrupyion vector on 0x04 EX:
org 0x04
goto interruption

interruption is the label of the sub routin for reading portb

i will give you more details after i chek the DATASCHEET
__________________
digital-electronics
DTMF is offline  
Old 7th June 2005, 08:46 PM   (permalink)
Default

Try Nigels tutorials :

PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk or
http://www.lpilsley.uklinux.net/picprog

It should solve whatever your problem is.
__________________
"I share, thus I am"
Jay.slovak
Read this!
ICD2 Clone
Best PIC/DsPIC Bootloader

Read my Inchworm ICD2 review!
Jay.slovak is offline  
Old 7th June 2005, 09:45 PM   (permalink)
Default Re: using Interrupts....

Quote:
Originally Posted by striker2509
How can i set the port b as an interruption....i want to take tha value in that port everytime i change a input pin....help me please!
sorry about that...im using pic16f877, i tried to interrupt through rb4-rb7 pins...and didn't work out....dont know what i did wrong
striker2509 is offline  
Old 8th June 2005, 02:27 AM   (permalink)
Default

Just enable the interrupts with.

Code:
            bsf    INTCON,RBIE
            bsf    INTCON,GIE
In your interrupt you need to read port b before resetting RBIF
I.E.
Code:
            movfw  PORTB
            bcf    INTCON,RBIF
HTH

Mike.

Edit, you will only get an interrupt if a change happens to any of the b4 - b7 bits that are inputs, not outputs. Note also, the datasheet doesn't mention RBIE in the description under PORTB - only RBIF.
Pommie is online now  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 12:49 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker