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
 
Thread Tools Display Modes
Old 22nd May 2008, 06:53 AM   (permalink)
Red face

Sorry ! to bother my bread board is damaged the ckt works on the other one
__________________
CHRIS
c36041254 is offline   Reply With Quote
Old 22nd May 2008, 08:50 AM   (permalink)
Default

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
You can add as many other checks as you have interrupts enabled. So, if you want a timer0 interrupt you would check INTCON,T0IF and branch as necessary.

Mike.
Pommie is online now   Reply With Quote
Old 23rd May 2008, 02:14 AM   (permalink)
Default

Thanks Mike! but, some times interrupt with goto did work.!!! though I'll never do that again
__________________
CHRIS
c36041254 is offline   Reply With Quote
Old 23rd May 2008, 02:43 AM   (permalink)
Default

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
c36041254 is offline   Reply With Quote
Old 23rd May 2008, 07:46 AM   (permalink)
Default

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.
Pommie is online now   Reply With Quote
Old 23rd May 2008, 08:04 AM   (permalink)
Default

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
c36041254 is offline   Reply With Quote
Old 23rd May 2008, 08:11 AM   (permalink)
Default

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.
Pommie is online now   Reply With Quote
Old 23rd May 2008, 08:13 AM   (permalink)
Default

Does that damaged the KIT permanently ?
__________________
CHRIS
c36041254 is offline   Reply With Quote
Old 23rd May 2008, 08:39 AM   (permalink)
Default

Quote:
Originally Posted by c36041254 View Post
Does that damaged the KIT permanently ?
I don't think so but it's not a good idea.

Mike.
Pommie is online now   Reply With Quote
Old 23rd May 2008, 08:42 AM   (permalink)
Default

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.
c36041254 is offline   Reply With Quote
Old 23rd May 2008, 08:59 AM   (permalink)
Default

The Pickit2 doesn't support the 16F628, only the 16F628A. How did you get it working previously?

Mike.
Pommie is online now   Reply With Quote
Old 23rd May 2008, 11:00 AM   (permalink)
Default

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.
c36041254 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
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



All times are GMT. The time now is 11:42 AM.


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