PDA

View Full Version : ICD Malfunction?



Ramius
- 19th January 2014, 13:39
Hi All!
Okay so I have Microcode Studio Plus v 5.0.0.5 and complier PBPX 3.0.6.4. The PIC being used is an 18F1320. I keep getting an ICD timeout error message and the strange part to me is after an ICD compile and program, programming the PIC with MPLAB IDE 8.91, the pic programs without ICD! That is after you have gone through all the steps to program the PIC and you plug it in to the board and apply power it starts to blink without ICD telling it to! Any ideas?

' Name : BLINKXU.pbp
' Compiler : PICBASIC PRO Compiler 2.6
' Assembler :
' Target PIC : PIC18F1320 or similar type
' Hardware :
' Oscillator : 20MHz external
' Keywords : FOR NEXT
' Description : PICBASIC PRO program to blink an LED
'

Define OSC 20
define loader_used 1
ENABLE DEBUG

Include "Modedefs.bas"
include "hpwm10L.pbp"

#CONFIG
__CONFIG _CONFIG1H, _HS_OSC_1H & _FSCM_OFF_1H
__CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_8K_2H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _BORV_27_2L
__CONFIG _CONFIG3H, _MCLRE_OFF_3H
__CONFIG _CONFIG4L, _DEBUG_OFF_4L & _LVP_ON_4L & _STVR_ON_4L
__CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L
__CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
__CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L
__CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
__CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L
__CONFIG _CONFIG7H, _EBTRB_OFF_7H
#ENDCONFIG


ADCON1 = 255


LED Var PORTB.0 ' Alias PORTB.0 to LED

LOW led
LOW LED
mainloop:
High LED ' Turn on LED connected to PORTD.0
Pause 500 ' Delay for .5 seconds
Low LED ' Turn off LED connected to PORTD.0
Pause 500 ' Delay for .5 seconds
GoTo mainloop ' Go back to loop and blink LED forever

End



Thanks, Ed

Ramius
- 19th January 2014, 19:29
Not sure what happened and it works now! :D