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

Problems debugging 16F690

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



Joined: 25 Nov 2005
Posts: 13
Location: San Diego

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

Problems debugging 16F690
PostPosted: Sat Dec 03, 2005 7:48 pm     Reply with quote

Greetings I bought CCS PCWH two weeks ago in order to finish my senior project. I was able to for the most part program a 18F4520 to run a display and decode a 4x4 keypad. Now I am trying to program the 16F690 to drive an H bridge and take an analog input. THe two chips are going to communicate via i2c. Here is my setup:

compiler: PCWH ver 3.239
Microcontroller: 16F690
Mode: Works in Standard, not in debug
Target voltage: 5v
oscillator: 4Mhz crystal with caps

My problem is that I can't get the debugger in PCWH to work on this chip. When I turn on the debugger it starts with "ataching", then "Loading, and then "busy". THen I get an error: "Could not start target: The target was not halted after reset Check the targer oscillator and MCLR".

In order to verify my circuit I wrote a simple program to flash a light in MPLAP IDE switched to the ICD-2 instead of the ICD-U40, and it worked fine. I am only getting this error when trying to debug within PCWH.

If I go to tools, then choose ICD. The program loads fine. and I get the message that the chip should be running. And I can see the lights turing on and off.

Does this sound familiar to anyone else? I would really appriciate any help that I can get.

Here is my code:
Code:

#include "D:\ControlLogic\ControlPIC.h"
#int_SSP
#define GREEN_LED PIN_B7
SSP_isr()
{

}

#int_TIMER0
TIMER0_isr()
{

}



void main()
{

   setup_adc_ports(sAN2|VSS_VDD);
   setup_adc(ADC_CLOCK_INTERNAL);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DIV_BY_1,0,1);
   setup_ccp1(CCP_PWM);
//   setup_comparator(   setup_vref(FALSE));
   enable_interrupts(INT_SSP);
   enable_interrupts(INT_TIMER0);
   enable_interrupts(GLOBAL);
   setup_oscillator(False);

 
   while (TRUE) {
      output_low (GREEN_LED);
      delay_ms (1000);
      output_high (GREEN_LED);
      delay_ms (1000);

   }
   

}


If you need any other of the code let me know. Thanks for your time.

Mark
PCM programmer



Joined: 06 Sep 2003
Posts: 21371

View user's profile Send private message

PostPosted: Sun Dec 04, 2005 1:41 am     Reply with quote

Look at this chart on the CCS website. In the line for the 16F690,
it has a "No" in the column for CCS Debugger support.
http://www.ccsinfo.com/icddevices.shtml
kg6vkg



Joined: 25 Nov 2005
Posts: 13
Location: San Diego

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

That would explain alot
PostPosted: Sun Dec 04, 2005 2:20 am     Reply with quote

Thanks for for the heads up.

-Mark
kg6vkg



Joined: 25 Nov 2005
Posts: 13
Location: San Diego

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

One more question
PostPosted: Sun Dec 04, 2005 2:23 am     Reply with quote

On the page you linked me to there is # sign next to it as follows:

PIC16F690 #

And at the bottom of the page it says:

# Indicates a special -ICD part is required for debugging

Any idea what that special part would be?

Thanks, Mark
PCM programmer



Joined: 06 Sep 2003
Posts: 21371

View user's profile Send private message

PostPosted: Sun Dec 04, 2005 2:50 am     Reply with quote

Here's the document that describes the headers used for the ICD2.
Generally, it's the smaller PICs that require a special header to do
debugging. The document explains the various reasons why.
The chart on page 2 of the document shows that p/n AC162061 is the
header for the 16F690.
http://ww1.microchip.com/downloads/en/DeviceDoc/ICD2_Header_51292L.pdf
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