PDA

View Full Version : How to debug with MPLAB and PicKit3 with PicBasic Pro 3 - debugging



Joeygo
- 2nd April 2012, 04:12
Hi all,

I am trying to use MPLAB 8.80, PicKit3 and PICBasic Pro 3 to debug some simple PBP 3 basic code in a PIC16F690.

I have my PBP 3 code compiling and working in MicroCode Stuido and MPLAB..... but can not get the debugging working

Using MPLAB traditionally with C or ASM... I am required to select the TAB in MPLAB for debug or release mode.... yet there is no TAB when PBP3 code project is used.

What steps have I missed? OR is there no debugging options with these set of tools?

Thanks in advance Joseph

Compiling output screen

Executing: "C:\PBP3\PBPMPLAB.BAT" -ampasmwin -k# -p16F690 "C:\PBP3\EXAMPLES\LABX20-16F690\ADC_ Joseph.pbp"
PBPMPLAB.BAT 4.0.0.0
Using MPASM from C:\Program Files\Microchip\MPASM Suite\.
Executing: "C:\PBP3\PBPX.EXE" -ampasmwin -k# -p16F690 "C:\PBP3\EXAMPLES\LABX20-16F690\ADC_ Joseph.pbp"
PICBASIC PRO(TM) Compiler 3.0.5.1, (c) 1998, 2012 microEngineering Labs, Inc.
All Rights Reserved.
Trial version. 5 days left.
Warning[205] C:\PBP3\EXAMPLES\LABX20-16F690\ADC_ JOSEPH.ASM 29 : Found directive in column 1. (__config)

Debug output during debug programming and debugging.

PICkit 3 detected
Connecting to PICkit 3...
Firmware Suite Version...... 01.26.81
Firmware type......................Midrange
PICkit 3 Connected.
Device ID Revision = 00000006

Programming...
Programming/Verify complete

Running...
PK3Err0040: The target device is not ready for debugging.
Please check your configuration bit settings and program
the device before proceeding.


Configuration bits

Address Value Field Category Setting

2007 3FF4 FOSC Oscillator Selection bits INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN
WDTE Watchdog Timer Enable bit WDT disabled and can be enabled by SWDTEN bit of the WDTCON register
PWRTE Power-up Timer Enable bit PWRT disabled
MCLRE MCLR Pin Function Select bit MCLR pin function is MCLR
CP Code Protection bit Program memory code protection is disabled
CPD Data Code Protection bit Data memory code protection is disabled
BOREN Brown-out Reset Selection bits BOR enabled
IESO Internal External Switchover bitInternal External Switchover mode is enabled
FCMEN Fail-Safe Clock Monitor Enabled bitFail-Safe Clock Monitor is enabled

Darrel Taylor
- 2nd April 2012, 17:11
Do you have the Debug Header for the 16F690?
http://www.microchipdirect.com/ProductSearch.aspx?keywords=AC162061

You can't debug a 16F690 the same way as many of the other parts with built-in hardware debuggers.

dhouston
- 2nd April 2012, 18:30
Know your PICs,...Not the other way around

Can't I do both?

My project uses multiple PICs (12-13 if fully populated), most of which will be 12F1840 & 16F1825 or their enfeebled PicAxe variants 08M2 & 14M2. All will be socketed PDIP chips.

The PICs will have the ds30 loader preprogrammed and the PicAxes will have the PicAxe interpreter/loader. Rather than try to make it possible to download to each in situ (too complicated for my ancient grey cells), I am designing a small PCB with a DIP-14 socket that can be used to download programs and, since I doubt this will generate sufficient volume to justify having Microchip burn the ds30 loader into the PICs at purchase, it will also allow doing this with a PICkit 3 programmer.

I'm confused about two things (actually, I confused about many things but let's take them one-by-one). Fig 2.6 of the PICkit 3 User’s Guide shows a resistor between Vdd & Vpp but gives no value. And Fig 28.1 of both PIC datasheets shows a regulator added to the Vpp line from the MPLAB ICD 2, Does this also apply to the PICkit 3? If not, what value resistor, if any, is needed between Vdd & Vpp?

I will not be doing any debugging but it seems related to this thread.

Joeygo
- 3rd April 2012, 08:27
Do you have the Debug Header for the 16F690?
http://www.microchipdirect.com/ProductSearch.aspx?keywords=AC162061

You can't debug a 16F690 the same way as many of the other parts with built-in hardware debuggers..

No I don't have a 16F690 debug head... there wasn't any mention of it product information page

OK looks like we need we need AC162961 for debugging.


Another Question
If I have a part with internal debug hardware - can i use PBP3 +MPLAB+PicKit3 to debug this part?


Regards
Joe

Joeygo
- 3rd April 2012, 08:32
in mplab help under pickit3 or icd3 there is a schematic showing the resistor is somewhere between 4k7 and 10k.

The resistor pulls up the Vpp (/MCLR) to Vdd when noting is connected.. during programming the pickit3 or icd3 will driver Vpp low at some stage to put the part in to reset and eventually drive to Vpp programming voltage.



regards
Joe

Joeygo
- 3rd April 2012, 08:33
Do you have the Debug Header for the 16F690?
http://www.microchipdirect.com/ProductSearch.aspx?keywords=AC162061

You can't debug a 16F690 the same way as many of the other parts with built-in hardware debuggers.

I'm using the the low pin count board.
http://ww1.microchip.com/downloads/en/DeviceDoc/Low%20Pin%20Count%20User%20Guide%2051556a.pdf

regards
Joe

Acetronics2
- 3rd April 2012, 09:26
.

Another Question
If I have a part with internal debug hardware - can i use PBP3 +MPLAB+PicKit3 to debug this part?

Regards
Joe

Hi, Joe

I think you HAVE to use the special debug head AC162061 ( wich is a higher range processor that simulates the 690 ... no more ! ) the 690 itself is unable of debugging !
The LPC just is a " test board " to learn programming ... without any debugging abilities.

you also could use MPSIM and manually input the ADC result ...

Alain

dhouston
- 3rd April 2012, 12:17
in mplab help under pickit3 or icd3 there is a schematic showing the resistor is somewhere between 4k7 and 10k.

Thanks, Joe.