|
|
View previous topic :: View next topic |
Author |
Message |
davidMoore
Joined: 11 Apr 2006 Posts: 2
|
Debugging with PIC 16F688 |
Posted: Wed Apr 12, 2006 11:49 am |
|
|
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
|
|
Posted: Wed Apr 12, 2006 6:08 pm |
|
|
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. |
|
|
|
|
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
|