![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
__________________
CHRIS |
|
|
|
|
|
|
(permalink) |
|
You can't have a goto inter in your interrupt. It will never get out of the interrupt code.
Your interrupt should check the relevent bits and execute the appropriate code. Something like this, Code:
inter: movwf temp swapf STATUS,w clrf STATUS movwf temp_s btfss INTCON,RBIF ;is it Port B change interrupt goto NotPortB ;no, go check other interrupts movfw PORTB ;read port B to clear change condition bcf INTCON,RBIF ;Yes so clear the interrupt flag ;put code here for RB4 change NotPortB btfss INTCON,INTF ;is it INT0 interrupt goto NotIntF ;no bcf INTCON,INTF ;Yes so clear the interrupt flag ;Put code here for RB0 rising edge NotIntF swapf temp_s,w movwf STATUS swapf temp,w retfie Mike. |
|
|
|
|
|
|
(permalink) |
|
Thanks Mike! but, some times interrupt with goto did work.!!! though I'll never do that again
__________________
CHRIS |
|
|
|
|
|
|
(permalink) |
|
I used 220 ohm resistor as pull down and the codes work well but now it is melfunctioning, is it possible that the PIC is damaged because of very low (220 ohm) pull down resistance ? Can I verfy that ? Please answer me I'm worried
__________________
CHRIS |
|
|
|
|
|
|
(permalink) |
|
Even if you set the pin to output you wouldn't damage it (5/220=22mA). With it set to input it is impossible to damage it with a pullup/down unless you are using a supply that is too high (>5.5V).
Mike. |
|
|
|
|
|
|
(permalink) |
|
O.K. again it is working right but, by mistake I shorted Vss and Vdd once and then the busy LED on PIC kit 2 start blinking and I have to turn off the PC and then the PIC again start melfunctioning but, after reloading the codes it works fine, Can shrting Vss and Vdd damage PIC kit or PIC ?
__________________
CHRIS |
|
|
|
|
|
|
(permalink) |
|
You probably crashed the Pickit2. When this happens, you can rectify it by unplugging the Pickit2 from the USB (and any other source of power) wait a few seconds and then plug it back in. Next, in MPLAB, deselect PicKit2 by selecting none and then reselect it.
Mike. |
|
|
|
|
|
|
(permalink) |
|
Does that damaged the KIT permanently ?
__________________
CHRIS |
|
|
|
|
|
|
(permalink) |
|
|
|
|
|
|
|
|
(permalink) |
|
Mine MPLAB shows (in programmer selection) pic kit 2 in gray (not available) thiugh transfering hex file still do work on kit, what should I do to make pic kit 2 available in programmer list ?
__________________
CHRIS Last edited by c36041254; 23rd May 2008 at 08:43 AM. |
|
|
|
|
|
|
(permalink) |
|
The Pickit2 doesn't support the 16F628, only the 16F628A. How did you get it working previously?
Mike. |
|
|
|
|
|
|
(permalink) |
|
previously I was working on 16f690 demo board supplied with kit, so I thought it was working and now it stops but, if the kit does'nt support 16f628 then how can I be able to programme it ? That's what I have done successfuly
Edit: Though I got what do you mean by not supported but still curious that why so ?
__________________
CHRIS Last edited by c36041254; 23rd May 2008 at 11:08 AM. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| PIC16F628a Problem generating a RCIE interrupt | Norlin | Micro Controllers | 3 | 16th January 2008 01:43 AM |
| Priority Interrupt Controller | Stellarcore | Datasheet/Parts Requests | 14 | 13th September 2007 04:13 PM |
| Help with timer and interrupt please.. | AntRoFiZ | Micro Controllers | 2 | 29th May 2007 11:48 AM |
| Question about Interrupt | tinhnho | Micro Controllers | 3 | 11th February 2007 07:07 PM |
| Interrupt on GP Change problem | Dan East | Micro Controllers | 2 | 22nd May 2004 05:12 PM |