![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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! | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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! | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| Just enable the interrupts with. Code: bsf INTCON,RBIE
bsf INTCON,GIE I.E. Code: movfw PORTB
bcf INTCON,RBIF 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. | |
| |