PIC development board - n00b Needs Advice

Status
Not open for further replies.

stormBytes

New Member
So I got on the scene a few weeks ago and started reading like crazy. I took an interest in the PIC flavor of micros mostly because of their price, availability, free tools from Microchip and of course their overwhelming popularity among hobby-engineers.

I scoured eBay and the forums looking for a decent development board and finally went with mikroelectronika's EasyPIC6. A couple of weeks went by and the board arrived in the mail. I've played with it for some weeks now and have come to the conclusion that there's absolutely nothing 'easy' about it. I've even contacted microE about returning the board for a refund. (they agreed to take it back, suggesting I first play with it for some weeks just to be sure)

So I went back to the boards, back to eBay, looking for alternatives. But sadly there don't really seem to be any! The EasyPIC6 is pretty well made, sort-of well supported and seems to be pretty popular. Any other (comparable) board costs about as much and don't appear to be any simpler.

I guess I'm looking for a nice board to prototype my projects. For the time being, I'm using MPLab/MPASM and reading through Gooligum's tutorials (pretty well put together). The thing that really gets me with the EasyPIC6 is that nothing seems to "just work". Just yesterday I placed an IC into one of the sockets, setup the jumpers. The PIC seems to work with their own PicFlash programmer software (and on-board programmer) but when I try to use my own ICD2 programmer/debugger through MPLab, using their own on-board RJ6 Ext PGM socket, I get an error. Also, I don't get their port mapping. I'm using an PIC12F683 which has GPIO. The EasyPic6 only has ports A-E and all sorts of LED's go off for no apparent reason.

THis is really frustrating!

Did I make a mistake purchasing this board?

Should I send it back and cash out?

Am I going to need a development board down the line? (What are some of the considerations to owning one, pro's/con's like?)

I'm looking to learn more, and develop all sorts of projects using LCDs, IC2, etc. I just need a little bit of direction in my learning.

Thanks for any help people!
 
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.

The LPC demo board 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.
 
Well you have to like all the bells and whistles of the EasyPIC6.

I don't entirely understand what these "bells & whistles" are, to be quite honest. Do you?


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.

What do you mean by "interface issues" and how would the bells & whistles come in handy? Right now I simply don't get how the heck this board works! 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.

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.

I was considering picking up one of these as this is the model discussed in Gooligum's tutorials. Would make it much simpler to follow along. However, having an ICD2, I'm not sure how much sense it would make to pick up a PicKit2, and as you said, you don't know how nicely that board would play with my ICD2.

The short of it is that I'm debating sending the EasyPIC6 board back to mikroE. On the one hand, I'm not sure the board's to blame for any of my troubles, or if I even need one. On the other hand, should I want a board (provided I understand how its even useful) the alternatives I've seen so far (counting bell for bell and whistle for whistle) are about on parr with what I paid for the EP6
 
Last edited:
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!!!
 

Hey nick,

Thanks for that quick turn-around!

Hah! No I know what the expression means ("bells & whistles") I was wondering if you might give me a practical rundown (some examples?) of what the bells & whistles on this board would be good for. Right now all I have are dry and meaningless "specs".

You're spot-on. The PicFlash programmer is not compatible with MPLab, so I went for the next best option - the ICD2. I could've gone the PicKit2 route, but decided I wanted to view my code execute in real time.

As for the frustration -

Heh! Its clear you've been down this path. When starting out, its VERY frustrating. And right again - lots and lots of patience and determination. So far, Gooligum's been a great help. I should say I started (and put aside) at least half a dozen books. Some were obsolete, others felt like the author was more of an English lit professor then an engineer. Gooligum, though challenging at times, is the best tutorials I've yet to come across. Oh, and don't let their relative brevity fool you! I've spent more then a week on 6 pages at times!

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!
 
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.

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?
 
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!
Well I don't have the EasyPIC6 board, nor do I use much assembler either. So not much help there for examples.

get into using an lcd and RS232, those deserve a good looking over. Somewhere along the line you will probably choose a high level language. Try out a demo Mikroe compiler? The people that built the board would seem to be your best source of examples and support.
 
Well you won't learn much from this hex file, but at least you can blink some of those leds. It is for your 12f683 and uses the internal oscillator at 8 Mhz. Paste file into notepad with a xxxxx.hex suffix and import with the ICD2 or on board programmer. Burn it, and you will have a state machine (or menu button) example. Hold down the MCLR button a bit, and you can alternate back and forth between a soft up/down PWM on GPIO.0, or blinky leds on GPIO1,2,4,and 5. On the Pickit 2 LPC board, GPIO.0-5 correlate to RA0-5. Good luck

Code:
:020000040000FA
:020000000528D1
:080008000900672005088316BA
:100010008500FF308312A800A001A10185191628D0
:100020000A30F200F3015920A40A0E282408033CE8
:10003000031CA109A401A108031922282108013CDD
:10004000031C3E28A201A2030130A6002208AA0038
:100050000330A90074202208003C031C2328FF3031
:10006000A300A30A0130A6002308AA000330A900B8
:100070007420FF302302031C312856288514C83011
:10008000F200F301592085100515C830F200F30184
:10009000592005110516C830F200F3015920051248
:1000A0008516C830F200F301592085120E2863002E
:1000B0005828F30A0430F100A530F000F00B5E2858
:1000C000F10B5C28F20B5A28F30B5A280800703009
:1000D00083168F0483121F109F1383169F0107300E
:1000E0008312990085010800A701A70AA501A50AA6
:1000F0002A082502031880282603031905148328DB
:10010000260303190510FF302502031C7728290850
:080110002702031C75280800FA
:02400E00D43F9D
:00000001FF
 
Hey Nick,

Thanks for that!

I did as you said, copied to a notepad file, saved as hex, imported into MPLab and used my ICD2 to program to the 12F683 on the DIP8 socket of the EasyPIC6 board. After playing around with the RESET button on the board, the LED labeled RA2 started flashing on and off about every 500ms. That's about it.

Not sure about the PWM signal or anything else :0)

Also, I don't know how the board (EP6) maps out GPIO. All that's on the board are ports A-E.
 
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
 
Would you mind elaborating on this comment, please? Perhaps there's some misconception here.

Well, my understanding is that with the ICD2 you could monitor a micro's registers, program memmory, etc in real-time, as the program executed. You can add break points, use the stop watch and a myriad of other tools. You could also edit the registers in real time.

Hope that clears things up - this is my personal understanding. I'm very new to the whole microcontroller/PIC scene so I'd suggest confirming the accuracy of the above with someone more knowledgeable.
 

Talk about frustation!

I've been tinkering with this board all evening, to no avail. I've managed to get the ICD2 to interface with the board through the RJ-12 Ext ICD port. Now MPLab is giving me grief. It's not happy with the code (posted below) I've written to try to get some signs of life out of the 12F683 on the EasyPIC6 board.

Code:
 ;	*********************************************************************** 

	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
 
Last edited:
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.

Here's the ICD2 + ZIFF breakout board I was talking about. In the auction they are pictured separately (meaning you'd have to pay extra for the breakout ZIFF) but if you're serious about purchasing I'd suggest emailing the seller to ask for the same deal he gave StormBytes.

**broken link removed**

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?

I did look at the datasheet last night, section 12.11 I believe it was, but not in any great detail. I was finally able to connect my ICD2 to the EasyPic6/12F683 for programming but not for ICD. This is really weird! I get the following errors in MPLab output window:

Code:
ICD0083: Debug:  Unable to enter debug mode.  Please double click this message for more information.ICD0069: Debug:  Unable to run target

When I click the error, as it instructs me to, I get this from the help file:

Code:
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.

Seeing as I know nothing about the 12F683 OSC setting(s) I'm a little stuck at this point. I'll probably try to work through the problem or just contact mikroE again - So far they're support people have offered me nothing beyond generic responses. I'm seriously going to consider posting a YouTube video with this whole situation. MikroElektronica touts their "world class support" - seriously people. 2-3 days (or more sometimes) to get back to you with some cheesy one-liner? Come on..

Here's my code:

Code:
;	********************************************************************** 

	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:
 
Last edited:
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.
 

Dang it! Does this uC thing every get LESS complicated???

Well in any event, I'm thankful that folks (present company included) take the time to help out!

I just double checked the device setting and under ICE/ICD HEADERS it says AC162058. I take it that's the part that would be required in order for ICD2 to work as an in-circuit debugger.

I also have a 16F88 and having selected it in the device settings, no header board requirement is specified. I'm thinking I'll just go the 16F88 route to practice/learn with the ICD2 in debugger mode.

You are correct about it working just fine as a programmer, but if all I wanted was a programmer I didn't need to go the ICD2 route when the EasyPIC6 board has one on-board (used with PicFlash software - free!).

In my humble and very short experience, it seems the lack of any structured learning for newbies contributes to a lot of the confusion. I'm currently following Goolgum's tutorials and find them better then any book I've seen so far. Thing is, Gooligum (at least thus far) deals only with the 12F509 and I don't own one. I guess I could buy one but why spend more money on more PICs when I already have some that are just fine. The reason I opted to start out with baseline PICs is because they seem less intimidating, functionally speaking. I don't know much about any of this, only that I'm fascinated to 'stay the course' and learn as I go along. The 12F509 (which I don't own) seemed less "scary". No complicated timers, ADCs, Comparators, etc. I thought it'd be a good place to start learning

I did look at some books initially, but most deal with the (now obsolete) 16F84 (which might also need a header board).

Without typing out a whole page, here are 2 questions for you:

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?


Thanks for the help!

Cheers,

Daniel
 
OK, I understand your hardware setup now. The ZIF socket is just an easy way for you to connect the PIC to the ICD2 if you didn't already have a development board. And not to nit pick but just for your edification, it is ZIF with only one F and it stands for "zero insertion force".

Now, with respect to your problems getting ICD to work. Here is an expert for the data sheet section 12.11:


What I interpret this to mean is that ICD is not available in the 8-pin version of 12F683. ICD requires 3 dedicated pins to function. Since the 8-pin 12F683 only has 6 I/O pins, it is not practical to dedicate 3 of them to using ICD. Because of this, Microchip makes a 14-pin ICD adapter for the 12F683. It functions the same at the 8-pin version but there are extra pins that are there and dedicated only to using the ICD function of the PIC. Long story short, I don't think you can access the ICD features of your PIC without this adapter. If you look at table 1 on page 2 of the data sheet, it doesn't even specify which pins on the 8-pin 12F683 are to be used with ICD.

In order for ICD to work properly, you have to have an ICD hardware device (which you do, the ICD2), you have to have the available I/O pins (depends on the application and program), your development board must be properly configured (we think it is), and the specific PIC has to have ICD capability built into it. It seems that the PIC you have chosen does not on its own have that capability. At least that's what I interpret the expert from the data sheet to mean. This is a limitation of the PIC you have chosen and has nothing to do with the EasyPIC6 board.

ICD is not required for you to program PICs or for you to learn about programming PICs. I didn't use it even once until I had be using PICs for over a year and I only used it then because I had a bug with a fairly complex program. In general, smaller PICs are only used for simple programs where ICD may not be necessary which, in addition to the I/O pin issue, is my guess as to why your PIC doesn't on its own have ICD capabilty.

If you are dead set on using ICD to view your code execute line by line, then I'd recommend you buy a larger PIC to experiment with. If not, you can still get a lot of value out of just writing the code, burning it to the PIC, and using the development board to interact with the program and view the output.

Hope this helps.
 
In my humble and very short experience, it seems the lack of any structured learning for newbies contributes to a lot of the confusion.

I'm sorry but I disagree with this statement. 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.


1. What exactly IS a header board and how does it work, in practice?

Reference my last post, if that doesn't answer it, I'll take another stab at explaining it.

2. What part of the data sheet provides information about a particular PICs built-in ICD-compatible circuitry or need for an accessory board?

Info on ICD if it's available is usually contained in the "Special Features of the CPU" section of the datasheet but it can vary from PIC to PIC. In your case, it's in section 12.11.
 
1. Everything you want to know about headers.
2. It's easier to look in MPLAB. However, for the 16F88 it's on page 2 under Special Microcontroller Features.


Here's some code to get you started,
Code:
;*******************************************************************  
;                           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
It simply flashes bit 0 of port A.

I don't have the hardware to try it but it should work.

Mike.
 
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.

I can appreciate the importance of learning "correctly". Having followed Gooligum tutorials, I'm under the impression that hardware ICD is not unlike using MPLab SIM, which material has already been covered in the preceding 3 tutorials (I'm currently working through #4). I thought it would be cool to write some code, no matter how primitive, and watch it execute, observing changes in registers, stop watch, and program memory. Apparently it isn't written in the stars. Its been far too frustrating an experience so far and I'm thinking to leave it for now.


While I'd like to progress to coding in high level languages, I'm curious to learn Assembly through MPLab. Despite the steep (and frustrating) learning curve, I seem to pick up stuff about the inner workings of the micro by way of ASM. I imagine there are a number of equally valid approaches to learning microcontrollers, and that all roads eventually lead to Rome.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…