View previous topic :: View next topic |
Author |
Message |
clon
Joined: 21 Feb 2012 Posts: 5
|
PIC 18F2620 |
Posted: Tue Feb 21, 2012 6:17 am |
|
|
Hey bin neu hier,
Habe ein Problem will mit CCs Compiler einen Interrupt auf dem pic18f2620 programmieren und weiss nicht wie ich das machen kann :S
kann mir hier jemand helfen ?
-------------------------------------------------------------------------------------
I got a Problem, I want so create a Interrupt routine on the pic 18f2620 and I don't know how to handle this problem :S
Is there anyone who can help me ?
lg clon |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
Interrupts |
Posted: Tue Feb 21, 2012 7:53 am |
|
|
There are several interrupt programs in the CCS manual, and in the example folder. Those in the example folder are usually complete and compilable.
Mike |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Feb 21, 2012 3:08 pm |
|
|
Quote: |
create a Interrupt routine
|
a lot depends on WHICH interrupt you want to use.
there are quite a few in that particular PIC -
which ONE are you interested in ?? |
|
|
RoGuE_StreaK
Joined: 02 Feb 2010 Posts: 73
|
|
Posted: Tue Feb 21, 2012 4:48 pm |
|
|
I currently use the exact same chip, you may find something of use in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=43174
it was trouble-shooting an interrupt from Timer0. There's a stripped-down version of the code about 2/3 of the way down the page, which may be a starting point for you.
Running a 20MHz crystal, using
setup_timer_0(RTCC_INTERNAL|RTCC_8_bit|RTCC_DIV_1);
gives an interrupt of 102.4us
setup_timer_0(RTCC_INTERNAL|RTCC_8_bit|RTCC_DIV_2);
gives an interrupt of 51.2us
... and so on. |
|
|
clon
Joined: 21 Feb 2012 Posts: 5
|
|
Posted: Wed Feb 22, 2012 2:18 am |
|
|
asmboy wrote: | Quote: |
create a Interrupt routine
|
a lot depends on WHICH interrupt you want to use.
there are quite a few in that particular PIC -
which ONE are you interested in ?? |
I want to get an interrupt if I send something over my RS 232 what kind of interrupt will be the best choice for this reason ? |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
RS232 Interrupts |
Posted: Wed Feb 22, 2012 5:10 am |
|
|
The CCS example EX_SISR.C shows you how to do it.
You WILL have to change the "#include <18F452.h>" line to "#include <18F2620.h>" or your chosen processor if different.
You MAY need to change the "#use delay(clock=20000000)" to suit.
The program is complete and compilable.
Best wishes
Mike |
|
|
clon
Joined: 21 Feb 2012 Posts: 5
|
Re: RS232 Interrupts |
Posted: Fri Feb 24, 2012 7:17 am |
|
|
Mike Walne wrote: | The CCS example EX_SISR.C shows you how to do it.
You WILL have to change the "#include <18F452.h>" line to "#include <18F2620.h>" or your chosen processor if different.
You MAY need to change the "#use delay(clock=20000000)" to suit.
The program is complete and compilable.
Best wishes
Mike |
Thank you for this hint :D I manage it to run this file now now I have to run this file in a existed project how do I include this :S ?
Clon |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Fri Feb 24, 2012 9:46 am |
|
|
Depends on what you are trying to do.
You are asking "How long is a piece of string?".
Give us some clues and we may be able to help.
Mike |
|
|
clon
Joined: 21 Feb 2012 Posts: 5
|
|
Posted: Thu Mar 08, 2012 5:11 am |
|
|
My problem is that if there is an interrupt my program doesn't go into the isr. :S |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Thu Mar 08, 2012 8:51 am |
|
|
post the code you are having trouble with
and help may become possible |
|
|
clon
Joined: 21 Feb 2012 Posts: 5
|
|
Posted: Fri Mar 09, 2012 6:16 am |
|
|
I throw all my interrupt idees away haha ... I want to create a polling system so I got a new problem i don't know how to read the buffer date out of my pic16F2620 :S |
|
|
|