Well you have to like all the bells and whistles of the EasyPIC6.
Would surely think this would come in handy after getting comfortable with the programming part, and resolving any interface issues. Not into the kitchen sink approach, but both EasyPIC and the barebone's approach equally valid.
LPC demo board[/URL] for the 8, 14, 20 pin 16f's and 20 pin 18f's is really handy with the PICkit 2 programmer; suspect it's not so friendly with the ICD2 though.
1. Bells and Whistles (lots of decoration and/or amenities): never have I seen so many leds and buttons then on the easyPIC boards, GLCD support, on board programmer, etc., etc., etc.
2. Interface issue: Why are you even using an ICD2? the on board programmer must not work with MPLAB? If a Mikroe compiler would let you use Microchip assembler, then that might work for you. Or, ask the Mikroe forum on how the ICD2 works with that board.
3. Starting out with microcontrollers can always be a little discouraging, there is not a lot of room for mistakes in coding instructions. Lots of time spent on perfecting that code, and stamping out compiler errors. Plenty of patience is required. So until a certain level of proficiency is obtained (For example, blink leds, read adc, print on lcd), things can be tough. Stick with it, and you will be rewarded!!!
I plug in a micro, set the jumpers, and the damn thing doesn't work for me. ICD2 doesn't seem to recognize the PIC that's been set. When I use a dummy programer ziff socket everything works fine.
Well I don't have the EasyPIC6 board, nor do I use much assembler either. So not much help there for examples.If you could share a few practical (project) examples of how the EasyPIC6 could be put to some use, I'd feel like less of a moron for shelling out the clams!
cheers!
:020000040000FA
:020000000528D1
:080008000900672005088316BA
:100010008500FF308312A800A001A10185191628D0
:100020000A30F200F3015920A40A0E282408033CE8
:10003000031CA109A401A108031922282108013CDD
:10004000031C3E28A201A2030130A6002208AA0038
:100050000330A90074202208003C031C2328FF3031
:10006000A300A30A0130A6002308AA000330A900B8
:100070007420FF302302031C312856288514C83011
:10008000F200F301592085100515C830F200F30184
:10009000592005110516C830F200F3015920051248
:1000A0008516C830F200F301592085120E2863002E
:1000B0005828F30A0430F100A530F000F00B5E2858
:1000C000F10B5C28F20B5A28F30B5A280800703009
:1000D00083168F0483121F109F1383169F0107300E
:1000E0008312990085010800A701A70AA501A50AA6
:1000F0002A082502031880282603031905148328DB
:10010000260303190510FF302502031C7728290850
:080110002702031C75280800FA
:02400E00D43F9D
:00000001FF
Hey nick,
I could've gone the PicKit2 route, but decided I wanted to view my code execute in real time.
cheers!
Would you mind elaborating on this comment, please? Perhaps there's some misconception here.
Here is the schematic for the EasyPIC6 you will need to become familiar with it. Multitudes of jumpers. Make sure the external osc jumpers are placed on the I/O pin setting, as the code is meant for the internal osc. Also check the following:
1. Not using the A/D so no connects there
2. Touch screen interface off
3. No clue as to Buttons disabled or no jumper or????
4. Anyplace where RA0,1,2,4,5 might be diverted
You really need help from someone who has this board
; ***********************************************************************
list p=12F683
#include <P12F683.inc>
; ***** Config Bits *********************************************************
__CONFIG 0x3FE2
; ***** Local Vars ************************************************************************
UDATA_SHR
UDATA
code
movlw b'00111100'
movwf ANSEL
movwf TRISIO
; ***** Main Program ***************************************************
movlw b'00000011'
movwf GPIO
goto $
End
Can you post a link to the ebay auction you bought your hardware from. I want to know more about the dummy ZIF socket that you're referring to.
Also, did you see from the other thread what I was talking about in the datasheet with respect to in-circuit debugging? It references an application note. Did you check it out yet?
ICD0083: Debug: Unable to enter debug mode. Please double click this message for more information.ICD0069: Debug: Unable to run target
ICD0083: Debug: Unable to enter debug mode. Please double click this message for more information.
Description: MPLAB ICD 2 was unable to establish communications with the debug software on the target. This will prevent all debug operations (run, step, halt, breakpoint, etc.)
Suggested Actions: See General Debug Failure Actions.
----------------------------------------------------------------------
FOLLOWING FURTHER:
General Debug Failure Actions
The MPLAB ICD 2 was unable to perform a debugging operation. There are numerous reasons why this might occur.
Top Reasons Why You Can't Debug
1. The oscillator is not working. Check your configuration bits setting for the oscillator.
2. The target board is not powered. Check the power cable connection.
3. Verify whether or not the device requires a header. From the MPLAB IDE main menu, select Configure>Select Device, select the device and check under the Debuggers, ICD/ICD Headers to see if a header is required.
4. The MPLAB ICD 2 has somehow become physically disconnected from the PC. Check the USB or COM communication cable connection.
5. The MPLAB ICD 2 has somehow become physically disconnected from the target board. Check the communications cable connection.
6. The device is code-protected. Check your configuration bits setting for code protection.
7. You are trying to rebuild the while in Release mode. Select Debug in the Build Configuration drop-down list on the Project menu, then rebuild the project.
8. MPLAB ICD 2 is selected as a programmer, and not as a debugger, in MPLAB IDE.
9. MPLAB ICD 2 to PC communications has somehow been interrupted. Reconnect to the ICD in MPLAB IDE.
10. The target application has somehow become corrupted or contains errors. For example, the regular linker script was used in the project instead of the MPLAB ICD 2 version of the linker script (e.g., 18F8722.lkr was used instead of 18F8722i.lkr). Try rebuilding and reprogramming the target application. Then initiate a power-on-reset of the target.
11. Other configuration settings are interfering with debugging. Any configuration setting that would prevent the target from executing code will also prevent the ICD from putting the code into debug mode.
12. MPLAB ICD 2 cannot always perform the action requested. For example, the ICD cannot set a breakpoint if the target application is currently running.
13. Brown-out Detect voltage is greater than the operating voltage Vdd. This means the device is in Reset and cannot be debugged.
Other Things to Consider
1. It is possible the error was a one-time glitch. Try the operation again.
2. There may be a problem programming in general. As a test, switch to programmer mode and program the target with the simplest application possible (e.g., a program to blink an LED.) If the program will not run, then you know that something is wrong with the target setup.
3. It is possible that the target device has been damaged in some way (e.g., over current.) Development environments are notoriously hostile to components. Consider trying another target device.
4. Microchip Technology Inc. offers myriad demonstration boards to support most of its microcontrollers. Consider using one of these applications, which are known to work, to verify correct MPLAB ICD 2 functionality.
5. Review the operational theory of ICD operation to ensure proper application setup. (MPLAB ICD 2 Overview)
6. If the problem persists contact Microchip.
; **********************************************************************
list p=12F683
#include <P12F683.inc>
; ***** Config Bits *******************************************************
__CONFIG 0x3FE1
; ***** Globals **********************************************************
; ***** Local Vars ********************************************************
UDATA_SHR
UDATA
; ***** Reset Vector ******************************************************
; ***** Subroutine VECTORS ***********************************************
code
movlw b'00111100'
movwf ANSEL
movwf TRISIO
; ***** Initialze **********************************************************
; ***** Main Program *****************************************************
movlw b'00000011'
movwf GPIO
goto $
End ; EOF:
The reason your ICD2 cannot enter debug mode is because the 12F683 doesn't have the debug circuitry built in and you have to buy a header board for it. You should be able to select the ICD2 as a programmer and it should work fine. Alternatively, you should have received a 16F886 with your board and this does have the debug circuitry, so switch to the bigger chip and see how you go. I can post some example code tomorrow if you need it.
Mike.
Since in-circuit debugging requires access to three
pins, MPLAB® ICD 2 development with a 14-pin device
is not practical. A special 14-pin PIC12F683 ICD device
is used with MPLAB ICD 2 to provide separate clock,
data and MCLR pins and frees all normally available
pins to the user.
A special debugging adapter allows the ICD device to
be used in place of a PIC12F683 device. The
debugging adapter is the only source of the ICD device.
When the ICD pin on the PIC12F683 ICD device is held
low, the In-Circuit Debugger functionality is enabled.
This function allows simple debugging functions when
used with MPLAB ICD 2. When the microcontroller has
this feature enabled, some of the resources are not
available for general use. Table 12-9 shows which
features are consumed by the background debugger.
In my humble and very short experience, it seems the lack of any structured learning for newbies contributes to a lot of the confusion.
1. What exactly IS a header board and how does it work, in practice?
2. What part of the data sheet provides information about a particular PICs built-in ICD-compatible circuitry or need for an accessory board?
;*******************************************************************
; 16F88
;*******************************************************************
include "p16f88.inc"
errorlevel -302
__config _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_ON & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO
__config _CONFIG2, _IESO_OFF & _FCMEN_OFF
cblock 20h
Count
d1
d2
d3
endc
org 0h
nop ;required by ICD2
bsf STATUS,RP0
bcf STATUS,RP1 ;bank 1
movlw b'11111110' ;A0 is output
movwf TRISA
movlw b'11111111' ;all input
movwf TRISB
movlw b'00000111' ;disable comparator
movwf CMCON
movlw B'01100000' ;select 4MHz clock
movwf OSCCON
clrf ANSEL ;no ADCs
bcf STATUS,RP0 ;bank 0
clrf PORTA
clrf PORTB
Loop call Delay
bsf PORTA,0
call Delay
bcf PORTA,0
goto Loop
Delay ;499994 cycles
movlw 0x03
movwf d1
movlw 0x18
movwf d2
movlw 0x02
movwf d3
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0
;6 cycles
goto $+1
goto $+1
goto $+1
return
end
In my opinion you are jumping levels a little here by trying out ICD with your very first programs. You have to learn to walk before you can run.
MikroC comes with tons of examples. You can study the code in the examples, burn the .hex files to the PIC using PICFlash, and then using the development board watch what the PIC does. The examples come with the free version of MikroC so you don't have to buy anything. Once you get the general ideas/concepts, you can write your program in MPLab and use the ICD2 to program. That's how I learned anyway.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?