Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Anybody knows how to use C prog to do interupt? pls help mi

Status
Not open for further replies.

santourui

Newbie level 1
Joined
Jul 20, 2005
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,289
#int_button

i need to do interupt using pic18 with C programming. Pls help mi or gif mi some hints. i wil appreciate. thX
 

ccs int_tbe

what type of C compiler are you using?
 

how to use timers overflow in ccs compiler

You should know more about device that you use... read a device data sheet..

In C programming for embedded are depend on compiler you're using... for PIC many people use HT-PICC or MPLABC..

First thing you have to do is locate the "INTERRUPT HANDLER" function in your compiler...
 

b int_rb

hi,

It depends upon which compiler you are using .

Actually C intrupt routines are not like assembly ones.

In PIC asembly we place the code starting with address of 0x04.

But in assembly its being managed by Compiler.

So interrupt routines are like simple routines in C.

With a special macro or special return type.

In some compilers we have install interupts.

regards
Gopi
 

#int_ssp spi ccs

Salam,

i'm using CCS compilor so if u r interested in it just do the following

#int_ext

write the interupt function here


then in the main function don't forget to enable the interrupt

this is for external interrupt if u want to use any other interrupt just replace #int_ext with the desired one of the following:

#INT_AD Analog to digital conversion complete

#INT_ADOF Analog to digital conversion timeout

#INT_BUSCOL Bus collision

#INT_BUTTON Pushbutton

#INT_CCP1 Capture or Compare on unit 1

#INT_CCP2 Capture or Compare on unit 2

#INT_COMP Comparator detect

#INT_EEPROM write complete

#INT_EXT External interrupt

#INT_EXT1 External interrupt #1

#INT_EXT2 External interrupt #2

#INT_I2C I2C interrupt (only on 14000)

#INT_LCD LCD activity

#INT_LOWVOLT Low voltage detected

#INT_PSP Parallel Slave Port data in

#INT_RB Port B any change on B4-B7

#INT_RC Port C any change on C4-C7

#INT_RDA RS232 receive data available

#INT_RTCC Timer 0 (RTCC) overflow

#INT_SSP SPI or I2C activity

#INT_TBE RS232 transmit buffer empty

#INT_TIMER0 Timer 0 (RTCC) overflow

#INT_TIMER1 Timer 1 overflow

#INT_TIMER2 Timer 2 overflow

#INT_TIMER3 Timer 3 overflow


Hope that helps
 

pic18 rtcc example code asm

Hi .. like it has been said it depends..
You should know that there is no provision on the standart C language to do interrupt handling .In big systems this is done in assembler and then from there a C function or handler was called .In embedded systems that shorcut has been added to the C language by the compiler editors as a key word interrupt or other ,so is not standart and it is not portable .You have to read your compiler documentation .
This is why every body asked for "which compiler"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top