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.

PIC 18f452: Interrupt using CCS.. Help!

Status
Not open for further replies.

w_bwr

Member level 3
Joined
Feb 4, 2010
Messages
66
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Karachi, Pakistan
Activity points
1,810
Whenever i compile the program, it gives the following Warning:
Interrupts disabled during call to prevent re-entrancy.

and the interrupt function doesn't work. I have posted the shortened program as the program is large, so I only posted the relevant code.
it contains the main program and the interrupt routine.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <18F452_new.h>
#fuses NOWDT,WDT128,HS,NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, NOPUT, STVREN, NODEBUG, NOLVP, NOWRT, NOWRTD, NOWRTB, NOWRTC, NOCPD, NOCPB, NOEBTR, NOEBTRB
#use delay(clock=20000000)
#INCLUDE <stdlib.h>
#ZERO_RAM
#use fast_io(A)
#define NOP #asm nop #endasm
#INCLUDE <dt_lcd_v01.c>
 
#INT_EXT
void ext_isr() 
{
if(!input(RST))
{
delay_ms(3000);
if(!input(RST))
{
state=0;
output_low(FD_F);output_low(MDM_L);output_low(ALARM);output_low(IGN);output_low(Pilot);
output_low(MAIN_1);output_low(MAIN_2),output_low(MDM_H);
state=0;round=0;timer9=0;timer8=0;timer7=0;timer6=0;timer5=0;
cs_ldu=0;cs_sq2=0;cs_p=0;cs_ig=0;cs_sq5=0;cs_st=0;cs_str=0;
f=0;ELA=0;Errors=0;
}
}
}
void main()
{
SET_TRIS_A(0B1000000);
setup_adc(ADC_OFF);
setup_adc(NO_ANALOGS );
enable_interrupts(INT_EXT);// turn on interrupts
ext_int_edge(H_TO_L);      // init interrupt triggering for button press
dt_lcd_init();
dt_lcd_clear_screen();
dt_lcd_gotoxy(44,0);
printf(lcd_printchar,"OMNI");
dt_lcd_gotoxy(10,1);
printf(lcd_printchar,"TELEMETRY CO.");
dt_lcd_gotoxy(0,2);printf(dt_lcd_printchar,"----------------------");
dt_lcd_gotoxy(44,3);
printf(dt_lcd_printchar,"BURNER");
dt_lcd_gotoxy(10,4);
printf(dt_lcd_printchar,"MANAGEMENT SYSTEM");
dt_lcd_gotoxy(10,5);printf(dt_lcd_printchar,"BMS 5400");
dt_lcd_gotoxy(60,5);printf(dt_lcd_printchar,"(VER: 1.09)");
dt_lcd_gotoxy(0,6);
printf(dt_lcd_printchar,"----------------------");
dt_lcd_gotoxy(25,7);
printf(dt_lcd_printchar,"www.omnitm.ca");
delay_ms(7000);
dt_lcd_clear_screen();
rtos_run();
}

 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top