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 CCS Technical Support

Debugging with PIC 16F688

 
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go
View previous topic :: View next topic  
Author Message
davidMoore



Joined: 11 Apr 2006
Posts: 2

View user's profile Send private message

Debugging with PIC 16F688
PostPosted: Wed Apr 12, 2006 11:49 am     Reply with quote

Hi,

I'm not new to the world of microcontrollers, but I'm new to PICs and I "inherited" the tools of a co-worker who moved to another company.

What I received was:
- An ICD-U40 unit
- PCW C-compiler. There going to Help --> About I have:

IDE Version 3.43
PCB Version 3.202
PCM Version 3.202
PCH Version 3.202

- A custom made development board that uses PIC16F688

I've been reading the code that my ex-coworker wrote and with the help of the manual, I think I can figure it out what it does, however there are things that I don't understand:

How can I do debug with the 16F688 ?

I'm asking because in the custom board I got, the pin 6 in the RJ12 described as "B3 on target PIC - This is optional, used for advance debugging" is not used, and I noticed that PIC doesn't even have a B3 pin.
Even reading on http://www.ccsinfo.com/faq.php?page=icd_connection it's said that the 16F688 does not have debugging capability.

Does that mean that to debug, I should use LEDs and printf statements ?

When I press F9 to compile is the code compiled and then it starts running inmediatelly or should I compile and do something else to make it run ?

Where can I see the output of the printf statements ?

Should I get a PIC with debugging capabilities, do the code, debug there and then onece I'm sure it is working then move back to the PIC 16F688 ?

Are the versions that I have too old ? (I couldn't find the release number for the actual version)

Regards,

David
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 12, 2006 6:08 pm     Reply with quote

Quote:
PCM Version 3.202

You have an older version of the compiler. CCS did some significant
changes to the compiler at vs. 3.200. They were fixing bugs for quite
a while after that. Go to the CCS versions page here, and look at the
entries after 3.200.
http://www.ccsinfo.com/devices.php?page=versioninfo
Any time they say "optimization bug fixed" it means typically that some
feature of normal C code (not using CCS functions) doesn't work
correctly. This can be annoying. Here is a problem specific to your PIC:
Quote:
3.206 A problem with the 16F688 UART is fixed

So, you might consider upgrading the compiler. Or at least be ready
to expect problems.


Quote:
it's said that the 16F688 does not have debugging capability.

Read this Microchip document for information on the "ICD header"
versions of certain PICs (such as the 16F688) and how to use them:
http://ww1.microchip.com/downloads/en/DeviceDoc/ICD2_Header_51292L.pdf


Quote:

When I press F9 to compile is the code compiled and then it starts
running inmediatelly or should I compile and do something else to
make it run ?

I don't have the CCS IDE. But in MPLAB, you have to compile and then
click on the Program button to program the PIC after you have compiled.
Then you have to click another button to take the PIC out of reset. Then
it starts running.

Quote:
Where can I see the output of the printf statements ?
Normally, the hardware UART is used for printf output. You would
use pins C4 and C5 on the 16F688 for this. (Tx and Rx, respectively).
Example of how to set it up:
#use rs232(baud=9600, xmit=PIN_C4, rcv=PIN_C5, ERRORS)
You then connect the PIC to your PC's COM port with a MAX232A
(or equivalent) chip which translates TTL levels to RS232 levels.

Except that it's likely the hardware UART library code has problems with
your version of the compiler. See the CCS versions web page.


Quote:

Should I get a PIC with debugging capabilities, do the code, debug there
and then onece I'm sure it is working then move back to the PIC 16F688

If you feel that you must do hardware debugging, then that would be the
easiest method.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go 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