PDA

View Full Version : ICD & PBP && how to get it to work



archendekta
- 2nd March 2009, 21:16
if this has been thrashed a bit already forgive the redundancy. my dev partner and I are having a bit of a time of getting the ICD to work.

we have a pic18 series->level converter->computer comm port->PCP

we then compile for ICD ops, ICD run, then bring up the serial communicator and viola, nothing is displayed. the program is a very very simple, short one using "hserout' and 'hserin" in a loop.

so, are we making this ICD too complicated or what?

tia

Archangel
- 3rd March 2009, 00:14
The text below is copy / pasted from the Microcode Studio Plus help file, if you are not using the plus version it only supports one chip:<br><b>
MicroCode Studio uses an ICD Model in order to initialise and control the operation of the ICD for a given PIC microcontroller.

MicroCode Studio Plus

The ICD for MicroCode Studio Plus supports the following PIC microcontroller devices.

16F627(A), 16F628(A), 16F73, 16F74, 16F76, 16F77, 16F870, 16F871, 16F873(A), 16F874(A), 16F876(A), 16F877(A), 16F87, 16F88, 18F242, 18F248, 18F252, 18F258, 18F442, 18F448, 18F452, 18F458, 18F1220, 18F1320, 18F2220, 18F2320, 18F4220, 18F4320, 18F6620, 18F6720*, 18F8620 and 18F8720*

* Please note that for these devices, the ICD will only support the first 64K of your program.

MicroCode Studio

The ICD for MicroCode Studio supports the following PIC microcontroller devices.

16F628

Please note that the ICD is not enabled if using the demonstration PICBasic PRO compiler. If you would like to purchase MicroCode Studio Plus, please read How to Purchase MicroCode Studio Plus.

archendekta
- 3rd March 2009, 07:17
pic = 18f252 I/SP
MCS+ = 3.0.0.5
PCP = 2.46

should be supported, yes?

Archangel
- 3rd March 2009, 07:40
pic = 18f252 I/SP
MCS+ = 3.0.0.5
PCP = 2.46

should be supported, yes?
PBP YES from ver 2.40
MCS+ YES

Bruce
- 3rd March 2009, 14:47
compile for ICD ops, ICD run, then bring up the serial communicator
If you're using MCS+ ICD, then you should not be trying to use the standard serial
communicator in MCS+.

Inside the ICD window HSEROUT will display whatever you send in the lower section of
the ICD window. When it lands on an HSEROUT while running the ICD, and small serial
ICD terminal window will automatically pop-up asking for input.



DEFINE LOADER_USED 1 ' using MCS+ bootloader
DEFINE OSC 20 ' <-- DEFINE your OSC speed. gotta have this for MCS ICD.

MyVar VAR BYTE

Loop2:
HSERIN [MyVar] ' <-- window pops-up waiting for input
HSEROUT ["MyVar = ",DEC MyVar,13,10] '<-- displays input
PAUSE 500
GOTO Loop2
I've attached a screen capture of the above running in MCS+ ICD. Tested on an
18F4431.

If you still have trouble try blinking an LED with the ICD just to make sure you have
everything setup properly.

archendekta
- 6th March 2009, 07:06
got it. thanks.

also looked at this that helped ;-)

http://www.rentron.com/PicBasic/MCS_X3.htm

jellis00
- 21st March 2010, 01:53
I've attached a screen capture of the above running in MCS+ ICD. Tested on an
18F4431.

If you still have trouble try blinking an LED with the ICD just to make sure you have
everything setup properly.

Bruce,
I have my program running so I can monitor it line-by-line with the MCS+ ICD. However, in the ICD Project Window I only see Registers, Memory and EEPROM.....no Variables are shown. How do I get them to appear so I can see how they are changing during the ICD??

Bruce
- 21st March 2010, 20:09
It's tough to offer help on source code I haven't seen. Can you post the code you're having problems with?

jellis00
- 22nd March 2010, 00:28
It's tough to offer help on source code I haven't seen. Can you post the code you're having problems with?

Bruce, to simplify things so I can figure out what is going on, I am running the MCS+ ICD for a rather simple program, for which I have attached the code at the end of this posting.

My main problem is that when I get the ICD to run, there is no Tab in the ICD Explorer window for Variables (to the right in the attached image), when all the documentation, including your tutorial at your web site, says there should be. I looked everywhere for a menu item or switch to make the Variables tab visible and couldn't find any info on how to do so.

Another problem I am having intermittently is that sometimes the ICD Run shows what is titled as an "ICD Message" as shown in the second attached image. It doesn't happen all the time, but when it does, I don't understand what is causing it or how to fix it. Since the ICD is apparenty very sensitive to having the clock specified correctly for it to run, I thought it might be that my OSC speed wasn't properly specified in the configs and the DEFINE OSC 16 statement, but I double checked this and it appears correct.

If you can help me figure out these two problems, it would be greatly appreciated.


'************************************************* ***************
'* Name : Blinky_test.pbp *
'* Author : John R. Ellis *
'* Notice : Copyright (c) 2010 LodeStar Assoc., Inc. *
'* : All Rights Reserved *
'* Date : 3/4/2010 *
'* Version : 1.0 *
'* Notes : 1) Iterations of this program will test all ports *
' of the MCU by blinking the EasyPic6 LED connected *
' to each port. *
'* : 2) This version of the code is written to test *
' the EasyPic6 when 18F2550 or 18F4550 is *
' installed. *
'************************************************* ***************
Pause 10 ' This statement is placed at beginning of code for ICD breakpoint
ASM ; 18F2550/4550, 8mhz crystal
__CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H ; PortB resets as digital
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
ENDASM

Include "Modedefs.Bas"

DEFINE OSC 16
TRISA = 0 ' Set all ports to outputs as test LEDs
TRISB = 0
TRISC = 0
TRISD = 0
TRISE = 0

INCLUDE "ALLDIGITAL.pbp" ' Sets all registers for digital ops.

PORTA = 0 ' Turn all test LED's off before test mainloop
PORTB = 0
PORTC = 0
PORTD = 0
PORTE = 0

mainloop:
' After running this program for PORTA, use EDIT/REPLACE menu to
' then change PORTA to PORTB, PORTC, PORTD and PORTE and run each
' case again to complete testing of all ports/LED's.

HIGH PORTA.1 ' Turn on LED connected to PORTA.0
PAUSE 500 ' Delay for .5 seconds
LOW PORTA.1 ' Turn off LED connected to PORTA.0
PAUSE 500 ' Delay for .5 seconds

HIGH PORTA.2
PAUSE 500
LOW PORTA.2
PAUSE 500

HIGH PORTA.3
PAUSE 500
LOW PORTA.3
PAUSE 500

HIGH PORTA.4
PAUSE 500
LOW PORTA.4
PAUSE 500

HIGH PORTA.5
PAUSE 500
LOW PORTA.5
PAUSE 500

HIGH PORTA.6
PAUSE 500
LOW PORTA.6
PAUSE 500

HIGH PORTA.7
PAUSE 500
LOW PORTA.7
PAUSE 500

Goto mainloop ' Go back to loop and blink LED sequence forever
End

Bruce
- 22nd March 2010, 00:33
I think you might need to actually declare a few variables if you expect MCS ICD to show them...;o)

I don't think MCS+ ICD is smart enough to yank variables from include files. That + ZERO support is
why I no longer use, nor recommend, MCS+ ICD.

Byte_Butcher
- 22nd March 2010, 01:21
I don't think MCS+ ICD is smart enough to yank variables from include files. That + ZERO support is
why I no longer use, nor recommend, MCS+ ICD.

pssst... so... just between you, me, and that lamp post over there... What do you use and recommend?
I'm not looking to jump ship any time soon, but it's nice to know what other folks are using and why they like it.


steve

Bruce
- 22nd March 2010, 02:53
If I need to know specific timing for time critical routines, I'll use MPLAB/MPSIM software simulation. Testing on hardware, I just build it & test the code on the hardware it's going to run on. Haven't seen any software yet that acts 100% the same as hardware..;o)

MCS+ ICD used to be a pretty cool option, but support for it seems to have dropped off the planet.

Byte_Butcher
- 22nd March 2010, 03:29
If I need to know specific timing for time critical routines, I'll use MPLAB/MPSIM software simulation. Testing on hardware, I just build it & test the code on the hardware it's going to run on. Haven't seen any software yet that acts 100% the same as hardware..;o)

Thanks Bruce,

Actually, I've never used ICD. (been to lazy to figure it out I guess :o )
I just "build the hardware and run it" and if I've got a extra few pins I'll connect a LCD display so that I can show the values of select variables.

Just curious what the "experienced users" use. Thanks!


steve

jellis00
- 22nd March 2010, 03:38
I think you might need to actually declare a few variables if you expect MCS ICD to show them...;o)


OK, I could understand that no Variables Tab would show if no variables had been declared. However, here is another program in which many variables were declared. I have also attached an image of the MCS+ screen while the ICD was running that shows it stopped at a breakpoint....but notice that even though the variables are declared in the program no Variables Tab appears in the ICD Explorer window. So the problem is still there.
Can anyone tell me how to make the Variables Tab appear in MCS+???



Pause 10 ' This statement is placed at beginning of code for ICD use
;--- if you un-comment these, you must comment the ones in the .inc file--
ASM ; 18F2550/4550, 8mhz crystal
__CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H ; PortB resets as digital
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
ENDASM

' Set Registers
TRISA = 0 ' PortA output connections are used for LCD interface
TRISB = %00000100 ' PORTB.2 is an input from switch grounding
TRISC.0 = 0 ' PortC.0 is used for a Heartbeat LED output
TRISC.2 = 0 ' PortC.2 is used for the LCD R/W connection

DEFINE OSC 16
DEFINE I2C_SLOW 1 ' Set i2c to the standard speed
DEFINE I2C_HOLD 1 ' Enable recieving i2c device to pause communication
Include "Modedefs.Bas"
INCLUDE "ALLDIGITAL.pbp" ' Sets all registers for digital ops.

' * NOTES for use with EasyPic6 development board:
' Make sure that SW6.8 on the EasyPic6 is set to ON position before powerup
' for LCD's requiring backlight.
'For use with COG 2x16 LCD:
' - Turn on Port Expander switches SW6.1, SW6.2, SW6.3, SW6.4 and SW6.5.
' - Turn on COG LCD 2x16 switches SW10.1, SW10.2, SW10.3, SW10.4, SW10.5 and SW10.6.

'---------------------- 18F4550 Port/PIN Connections ]--------------------
'I/O pin connections to the 18F4550 MCU are as follows:
'PORTA.0 (02) RA0 connected to LCD D4.
'PORTA.1 (03) RA1 connected to LCD D5.
'PORTA.2 (04) RA2 connected to LCD D6.
'PORTA.3 (05) RA3 connected to LCD D7.
'PORTA.4 (06) RA4 not connected
'PORTA.5 (07) RA5 not connected
'PORTB.0 (21) Connected as I2C SDA output to DS1337
'PORTB.1 (22) Connected as I2C SCL output to DS1337
'PORTB.2 (23) Connected as INT2 interrupt from pin-7 (_INTA) of DS1337 RTC.
'PORTB.3 (24) RB3 not connected
'PORTB.4 (25) RB4 not connected
'PORTB.5 (26) RB5 not connected
'PORTB.6 (27) Connected as PGC for ICSP connection
'PORTB.7 (28) Connected as PGD for ICSP connection
'PORTC.0 (11) RC0 not connected.
'PORTC.1 (12) RC1 connected as an output to a Red LED for battery low.
'PORTC.2 (13) RC2 connected to LCD R/W.
'PORTC.3 (14) RC3 not provided on 18F4550.
'PORTC.4 (15) not connected.
'PORTC.5 (16) not connected.
'PORTC.6 (17) RC6 normally connected to poll grounding of external switch.
'PORTC.7 (18) normally not connected.

'--------------[ Declare Variables, Aliases & Constants ]---------------
' Variables & Aliases for Pins other than RTC use
' ===============================================
Digit1 var byte ' Used to parse 3-digit integer into LCD characters
Digit2 var byte ' NOTICE ALL OF THESE DECLARED VARIABLES!!
Digit3 var byte
ext_pwr VAR PORTC.6 ' Alias to control power to Ultrasonic sensor
rng0 VAR w0.Byte0 ' LSB of range measurement when right justified
rng1 VAR w0.byte1 ' MSB of range measurement when right justified
rngNum1 Var Byte ' 1st numeral of rng0 for display on LCD as character
rngNum2 VAR Byte ' 2nd numeral of rng0 for display on LCD as character
rngNum3 VAR BYTE ' 34d numeral of rng0 for display on LCD as character
SCL VAR PORTB.1 ' I2C clock pin
SDA VAR PORTB.0 ' I2C data pin
Spare_1 VAR PORTB.7 ' PGD for ICSP & Spare I/O for normal ops
Spare_2 VAR PORTB.6 ' PGC for ICSP & Spare I/O for normal ops
w0 var word ' W0 is the word value to store the range data

' Constants
'==========
srfdevice CON $E0 ' Device address for SRF02 ultrasonic range finder
Vthr CON 46 ' Threshold (3.3v) to trigger battery low voltage warning
' ...this is dictated by the drop-out and output voltage
' of the voltage regulator used in the power circuit.

' Initialize the display
Pause 500 ' Wait for LCD to startup after power on
GOSUB InitializeDisplay

mainloop:
Lcdout $fe, 1 ' Clear LCD screen
PORTC.0 = 1 ' Blink Heartbeat LED during mainloop
Pause 500 ' Wait 0.5 second
PORTC.0 = 0
If PORTB.2 = 0 Then
Gosub Range
Endif
Goto mainloop ' Do it forever

' ----------------------[ START LIST OF SUBROUTINES ]-------------------
'************************************************* **********************

InitializeDisplay: ' Commented out till LCD installed
'=================
'--SETUP FOR USING 2x16 LCD THAT IS INSTALLED IN EASYPIC6-----
' LCD DEFINES FOR USING 2x16 LCD with PortA in EASYPIC6
'================================================= =====
DEFINE LCD_DREG PORTA ' Use PORTA for LCD Data
DEFINE LCD_DBIT 0 ' Use lower(4) 4 bits of PORTA
' PORTA.0 thru PORTA.3 connects to
' LCD DB4 thru LCD DB-7 respectively
DEFINE LCD_RSREG PORTA ' PORTA for RegisterSelect (RS) bit
DEFINE LCD_RSBIT 4 ' PORTA.4 pin for LCD's RS line
DEFINE LCD_RWREG PORTC ' LCD read/write port
DEFINE LCD_RWBIT 2 ' LCD read/write bit
DEFINE LCD_EREG PORTA ' PORTA for Enable (E) bit
DEFINE LCD_EBIT 5 ' PORTA.5 pin for LCD's E line
DEFINE LCD_BITS 4 ' Using 4-bit bus
DEFINE LCD_LINES 2 ' Using 2 line Display
DEFINE LCD_COMMANDUS 1500 ' Command Delay (uS)
DEFINE LCD_DATAUS 44 ' Data Delay (uS)

' DEFINE LCD Control Constants
Line1 CON 128 ' Point to beginning of line 1 ($80)
Line2 CON 192 ' Point to beginning of line 2 ($C0)

' Test the LCD during initialization
LCDOut $FE,1:FLAGS=0:Pause 250 ' Clear Display
LCDOut $FE,Line1+3," LCD TEST " ' Display "Power On" on 1st line
Pause 500
LCDOut $FE,Line2+2,"..Power On..!!" ' Display "LCD Test" on 2nd line
PAUSE 1000
Return

Move_Delay: ' Subroutine used during text moving on an LCD
'==========
' Function used for text moving
Pause 500 ' You can change the moving speed here
Return

Range:
'=====
ENABLE DEBUG
High PORTC.0 ' Turn on Test LED to indicate Ranging routine entered
HIGH ext_pwr ' Turn on power to the SRF02 in order to use the I2C bus
' without distortion.
PAUSE 3000 ' Delay to let I2C bus stabilize after SRF02 turn on
'DEFINE WRITE_USED 1 'Required if only writing WORD variables in v2.6
' Make SRF02 Range Measurement
I2CWRITE SDA,SCL,$E0,0,[80]' Request start of ranging in inches
pause 100 ' Wait for ranging to finish
I2CREAD SDA,SCL,$E0,2,[rng1,rng0] ' Get ranging results
pause 10
WRITE 253,rng1 ' Write range to EEPROM
PAUSE 10
Write 254,rng0
PAUSE 10
'Convert measurement to LCD numerals in inches
Digit1 = rng0 DIG 0
Digit2 = rng0 DIG 1
Digit3 = rng0 DIG 2
' Display range measurement on LCD display in inches
LCDOut $FE,1 ' Clear display
Pause 50
LCDOut $FE,$80,"Range:" ' Display on 1st line
PAUSE 10
LCDOut $FE,$C0,Digit1,Digit2,Digit3," in." ' Display on 2nd line
PAUSE 1000 ' Allow Time for user to view
LOW ext_pwr ' Turn off power to the SRF02 at end of display
' This statement will distort the I2C bus and ext_pwr
' must be HIGH before any attempts are made to use the
' I2C bus.
PAUSE 1000 ' Delay to permit I2C bus to stabilize after SRF02 off
DISABLE DEBUG
' Resume Main Program
Return
End ' Safety measure to insure program stops if reaches here

Bruce
- 22nd March 2010, 14:29
I don't have a 4550 to test, but it works fine with an 18F4431. See attached.

Does it work if you try something simple like this?


Pause 10 ' This statement is placed at beginning of code for ICD use
;--- if you un-comment these, you must comment the ones in the .inc file--
ASM ; 18F2550/4550, 8mhz crystal
__CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H ; PortB resets as digital
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
ENDASM

DEFINE OSC 16

MyVar VAR BYTE

Main:
FOR MyVar = 0 TO 50
HIGH 0
PAUSE 5
LOW 0
PAUSE 5
NEXT
GOTO Main

END

If the above works, then it may be something in your code causing the problem
or maybe a bad ICD model file?

Sorry I can't offer more help, but I haven't used MCS+ ICD in years.

Have you tried contacting Mecanique for tech support?

jellis00
- 22nd March 2010, 16:07
I don't have a 4550 to test, but it works fine with an 18F4431. See attached.

Does it work if you try something simple like this?


Pause 10 ' This statement is placed at beginning of code for ICD use
;--- if you un-comment these, you must comment the ones in the .inc file--
ASM ; 18F2550/4550, 8mhz crystal
__CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H ; PortB resets as digital
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
ENDASM

DEFINE OSC 16

MyVar VAR BYTE

Main:
FOR MyVar = 0 TO 50
HIGH 0
PAUSE 5
LOW 0
PAUSE 5
NEXT
GOTO Main

END

If the above works, then it may be something in your code causing the problem
or maybe a bad ICD model file?

Sorry I can't offer more help, but I haven't used MCS+ ICD in years.

Have you tried contacting Mecanique for tech support?

I pasted your code into my MCS+ and ran the ICD and it still doesn't show the Variables Tab (see attached image).
I notice that the image of your ICD run shows a couple of additional items in the Tool Bar that mine doesn't show. It makes me wonder if there is a version difference between us that may be causing my problem. My version of MCS+ is 3.0.0.5. What is yours??

I am also going to send your image and my image to Mechanique and ask them what is going on. I really appreciate your help on this

Bruce
- 22nd March 2010, 16:33
MCS+ 3.0.0.5 on Windows XP.

jellis00
- 22nd March 2010, 16:47
MCS+ 3.0.0.5 on Windows XP.

Bruce, if you would be so kind, would you please put your cursor on each of the four icons on the right end of the 1st Tool Bar line of your version of MCS+ and then tell me what their individual descriptions are? Once I know what these missing icons are for I want to ask mechanique why they don't appear on my version of 3.0.0.5 when running XP.
Thanks!
JE

Bruce
- 22nd March 2010, 16:56
Those are icons for the MCS+ boot-loader. Loader Read, Verify, Erase, Information.

jellis00
- 22nd March 2010, 23:07
Thanks to Darrel Taylor's response at techsupport assitant at meLabs, I have solved this mysterious problem. Let me explain, because this may be encountered by other users of the Micro Code Studio Plus (MCS+) ICD.

It turns out that the ICD model that came on my CD-ROM that delivered MCS+ to me was not correct for the 18F4550. Darrel had downloaded this .inc file from the Beta models and emailed it to me. When I replaced the ICD model I had for the 18F4550 with the one he sent I started seeing Variables Tab.
The icons I thought I was missing in the tool bar only show when using a boot loader, as explained by Bruce Rentron in above post.
Chasing down this problem took 3 days out of my time....no thanks to Mecanique's tech support who never responded to my emailed request for support.

Bruce
- 22nd March 2010, 23:21
That was one of my suspicions, but I'm glad you got it sorted.

Post #15 above;

or maybe a bad ICD model file?


no thanks to Mecanique's tech support who never responded to my emailed request for support.

Bummer, but that does reinforce my little ending blurb in post #10 above...;o)

HenrikOlsson
- 23rd March 2010, 06:21
It seems to be an on-off kind of thing. Or it depends on if it involves any sort of time-investment for them/him, I don't know.

When I had problems with MCS+ and Win7-64 I emailed them and got zero response but thanks to Darrel and Charles that problem too got sorted. A month or so later I emailed Mecanique again inquiring about a bootloader file I didn't have and got a response (and file) within hours.

/Henrik.

phoenix_1
- 23rd March 2010, 21:39
If you're using MCS+ ICD, then you should not be trying to use the standard serial
communicator in MCS+.

Inside the ICD window HSEROUT will display whatever you send in the lower section of
the ICD window. When it lands on an HSEROUT while running the ICD, and small serial
ICD terminal window will automatically pop-up asking for input.



DEFINE LOADER_USED 1 ' using MCS+ bootloader
DEFINE OSC 20 ' <-- DEFINE your OSC speed. gotta have this for MCS ICD.

MyVar VAR BYTE

Loop2:
HSERIN [MyVar] ' <-- window pops-up waiting for input
HSEROUT ["MyVar = ",DEC MyVar,13,10] '<-- displays input
PAUSE 500
GOTO Loop2
I've attached a screen capture of the above running in MCS+ ICD. Tested on an
18F4431.

If you still have trouble try blinking an LED with the ICD just to make sure you have
everything setup properly.

One question :
If I want to use ICD with 18F4550


DEFINE LOADER_USED 1 ' using MCS+ bootloader
DEFINE OSC 48

I get error from MCSP that can't find OSC48 setup for ICD in any file...
Any help please.
Regard's

Darrel Taylor
- 23rd March 2010, 22:53
You can't use the ICD with the PIC running at greater than 40Mhz.
There's no real reason other than MCS+ won't let you.

But, you can increase the divider so the the core runs at a lower freq.
_CPUDIV_OSC3_PLL4_1L will give 24mhz.

Then change to DEFINE OSC 24.

Also, the ICD is not compatible with standard USB routines.
It will likely drop the connection to the PC because it's not servicing fast enough. (Unless using USB_ASM_Service.pbp)
<br>

phoenix_1
- 23rd March 2010, 23:03
You can't use the ICD with the PIC running at greater than 40Mhz.
There's no real reason other than MCS+ won't let you.

But, you can increase the divider so the the core runs at a lower freq.
_CPUDIV_OSC3_PLL4_1L will give 24mhz.

Then change to DEFINE OSC 24.

Also, the ICD is not compatible with standard USB routines.
It will likely drop the connection to the PC because it's not servicing fast enough. (Unless using USB_ASM_Service.pbp)
<br>
OK Darrel ,
I only test ICD on 18F4550.
In Proton+ I was probe and work OK. But I was edit .XML to accept 48Mhz clock and at that freq. need to use 115200 speed in definition of HSEROUT ..
That is problem in PBP ICD 100% but we or I cant edit .ICD file for new devices...

I was probe your suggesst an work 100% ok. :cool:
In my code for test I not use USB. Only simple keypad reding + LCDOUT.

Best regards

jellis00
- 23rd March 2010, 23:57
One question :
Originally Posted by Bruce
If you're using MCS+ ICD, then you should not be trying to use the standard serial
communicator in MCS+.

Inside the ICD window HSEROUT will display whatever you send in the lower section of
the ICD window. When it lands on an HSEROUT while running the ICD, and small serial
ICD terminal window will automatically pop-up asking for input.


Code:
DEFINE LOADER_USED 1 ' using MCS+ bootloader
DEFINE OSC 20 ' <-- DEFINE your OSC speed. gotta have this for MCS ICD.

MyVar VAR BYTE

Loop2:
HSERIN [MyVar] ' <-- window pops-up waiting for input
HSEROUT ["MyVar = ",DEC MyVar,13,10] '<-- displays input
PAUSE 500
GOTO Loop2I've attached a screen capture of the above running in MCS+ ICD. Tested on an
18F4431.

If you still have trouble try blinking an LED with the ICD just to make sure you have
everything setup properly.

Where did this quote come from since I don't see it in this thread. I would like to go to it and review the referenced image.

Darrel Taylor
- 24th March 2010, 01:56
Where did this quote come from...not in this thread??Post #5, this thread.