Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Unable to connect to Inchworm

Status
Not open for further replies.

Hedos

New Member
Hello,
I finally got a DB9 cable so I can hook up my Inchworm and try it.

I turned of my FIFO buffers as MPLAB suggested and rebooted, then when attempting to connect to an MPLAB ICD 2 programmer (the inchworm that is), it can't. Here is the output:

"Connecting to MPLAB ICD 2
ICD0021: Unable to connect with MPLAB ICD 2"

Any idea what might be wrong?

I don't have anything connected to the IDC cable yet though, do I have to hook up my PIC to be programmed to the inchworm prior to be able to connect to it?
 
No, you don't need a target processor for it to work. Presumably you've programmed the processor on the Inchworm with the correct bootstrap code?. Also, is you DB9 cable wired correctly?.
 
How could I check the wiring of my DB9 cable?
It appears to be a standard serial cable (On the package it says "10 ft. Serial Null Modem Cable DB9M/DB9F)

I don't have programmed the processor on the Inchworm with anything. I thought it came already programmed? How would I be able to program it without a programmer otherwise?

EDIT: I have been told to check if the pins matched (I.E. Pin #1 -> Pin #1, Pin #2-> Pin #2, etc. on each end) on the dipmicro forums. They don't match, so my cable is not appropriate?

How can I tell apart straight and not straight DB9 cables?
 
Last edited:
Hedos said:
How could I check the wiring of my DB9 cable?
It appears to be a standard serial cable (On the package it says "10 ft. Serial Null Modem Cable DB9M/DB9F)

That's your problem then, it's NOT a standard serial cable, it's a 'null modem' cable which is a special crossed-over lead to connect two computers together - you need a standard serial cable.

I don't have programmed the processor on the Inchworm with anything. I thought it came already programmed? How would I be able to program it without a programmer otherwise?

If you bought it as a kit perhaps it does?, presumably the instructions mention it?.
 
Ah, my bad. Well, thanks a lot, I'll get a new cable!

And yes, the instructions do mention the chip comes programmed.
 
edit: nigel beat me to it...

a null modem cable is for communicating between one PC and another via the serial port. The TX and RX pins are crossed over, so the TX on one end goes to the RX on the other end, and vice versa. Thus, it's not going to work for you. However, you can rather easily cut open the cable, find the TX and RX wires, cut them, and resolder with the connections swapped. I've done this many times for crossover network cables. It might be a bit of a pain to find the wires, because it's not as easy to find the color code as with network cables, but it's doable... though if you can easily buy the right cable instead that's probably preferable.
 
I see. I got a good straight RS232 cable now.
Now MPLAB goes one step further, but does not function perfectly.

When I attempt to connect, it quickly says "Connected.", then keeps on loading for a while and then tell me the connection has been lost.

Here's the output:
"Connecting to MPLAB ICD 2
...Connected
ICDWarn0054: MPLAB IDE has lost communications with the MPLAB ICD 2. Would you like to attempt to reconnect?
Connecting to MPLAB ICD 2
...Connected
ICD0286: Unable to communicate with ICD
ICD0082: Failed MPLAB ICD 2 operation
MPLAB ICD 2 Ready"

And that is only with baud rate of 19200. With a baud rate of 57600 I don't get the "Connected" message.

What could it be now?

EDIT: Oohhh, I was playing around and tried "Download ICD2 Operating System".. it seems to have done it, it works now. Vdd: 5.04, Vpp: 12.38, MPLAB ICD 2 Vpp: 12.78. Sounds good?

When connecting I always get a pop-up with the following warning: "ICDWarn0020: Invalid target device id (expected=0x21, read=0x0)", what does that mean? Is it normal?
 
Last edited:
I was getting that message for 2 reasons :

1. I had a faulty PIC
2. I had forgotten to change the PIC device that I was trying to use in the CONFIGURE>SELECT DEVICE in MPLAB v7.50, It's probably the latter if you haven't selected the PIC you are trying to program , or haven't even got one in there at all.
 
Ok, thanks.

Is it okay to use a 1N4001 diode to hook up me PIC to the programmer, instead of the 1n1418?
I don't have that diode. Otherwise, which other diodes could do?
 
Great, thanks.

I built up my circuit just like in the firefly.. tested every connection, but MPLAB still says "Invalid target device id (expected=0x21, read=0x0)".

PGC is connected to pin 12.
PGD is connected to pin 13.
+5V is connected to pin 14.
GND is connected to pin 5.
VPP is connected to pin 4, and also to +5V via a diode and 22K resistor. (Diode in the direction to less current pass from +5V to VPP of course).

Anything missing?

edit: There is that 330 ohm resistor with a switch connected to VPP too.. What does it do?
 
Last edited:
It works:
"Target Device PIC16F628A found"

I just had to go into "Configure -> Select device", and select the appropriate chip before connecting. I guess I should be following some sort of manual or tutorial, I'm not sure which one though.

I tried to quickly build the code for your Flash a LED example for the 16F628A and program my chip. MPLAB says the process was successful, but the chip doesn't output anything out of RA.0.

But I really do need to understand more about MPLAB and the development process on a PIC before.. I guess I'm just not aware of another step yet. Once you compile the PIC, do the program starts running automatically?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top