CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PICDEM2 problems & ICD2

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ConfusedOne
Guest







PICDEM2 problems & ICD2
PostPosted: Tue Mar 01, 2005 3:25 am     Reply with quote

Steps that i have made before programming>
After successfull program compile i went to debugger.
Debugger test was passed. I went to Programmer/Program and this is the result
----------------------------------------------

Programming Target...
...Erasing Part
...Programming Program Memory
...Loading DebugExecutive
...Programming DebugExecutive
...Programming Debug Vector
...Programming RSBUG
...Programming Configuration Bits
Verifying...
...Program Memory
...Debug Executive
...Debug Vector
...Verify Succeeded
.. Config Memory
...Programming succeeded
MPLAB ICD 2 Ready
------------------------------
The power supply is switched directly to target application.
Problem:
There's nothing happening (LED should flash ).

I have tryed to programm on the way that i have put extra power supply to ICD2 and the debugging/programming part was passed but again with no result..
--------------------------------
Im using 18f452 and this basic demo code:

Code:

#include<test3.h>

#define LED PIN_B1

#int_ext             
LED_AUSGABEN()
{
output_high(LED);
delay_ms(500);
}

void main(){

set_tris_a(0);
set_tris_b(1);

setup_counters(RTCC_INTERNAL,RTCC_DIV_2);

ext_int_edge(L_TO_H);         
enable_interrupts(INT_EXT);
enable_interrupts(GLOBAL);

while(1)
{
output_high(PIN_B2);
delay_ms(500);
output_low(PIN_B2);
delay_ms(500);
output_low(LED);
}


}



Any idea would be good....
bluetooth



Joined: 08 Jan 2005
Posts: 74

View user's profile Send private message

PostPosted: Tue Mar 01, 2005 6:10 am     Reply with quote

You don't say whether B2 is blinking or not or if B1 doesn't blink when you get an interrupt...

Delay_ms is not re-entrant, so I wouldn't be surprised if your interrupts are being masked most of the time by the compiler.

You might try replacing the delay_ms(5000) in the interrupt routine with delay_us(50000) - that MIGHT work (although it's going to be shorter!). The real way to do it is to timers so you don't spend scads of time in an interrupt routine!

Good luck...
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Mar 01, 2005 7:02 am     Reply with quote

No fuses, no device statement, I don't see where in the code that you specify the ICD = TRUE or the debug in the fuses. Still not clear if you are using the debugger or not. The info you gave suggests that you are since the debug executive is being loaded. However, you indicate that you program the part from the Programmer menu which would disable the debugger! There was a very early version of MPLAB that allowed the ICD2 to be loaded as a debugger and a programmer but none of the versions now do that.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group