Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 10th March 2007, 09:12 PM   (permalink)
Default Need help badly on Inchworm and MPLAB

Hi all

I recently bought an assembled Inchworm programmer. I connected it to my computer via COM1 port and tried to connect to MPLAB 7.5.
Here's what I did after connecting the programmer physically

In Windows Device manager
1) Set it to COM1
2) Changed Byte per second to 19200
3) Row control=Hardware
4) Turned off FIFO buffer

In MPLAB
1) Programmer -> Select programmer -> MPLAB 1cd2
2) Programmer -> MPLAB ICD2 Setup Wizard
In the wizard:
i) Set it to COM1 and Baud rate to 19200
ii) Select "Target has own power supply"
iii) Check "MPLAB IDE automatically connects to the MPLAB ICD 2"
iv) Check "MPLAB ICD 2 automatically downloads the required OS"
When the wizard is finished this warning is displayed:
"ICDWarn0034: Please ensure that your system's serial FIFO buffers are disabled."

3) Programmer -> Connect
Output: Displayed the following warning:
"Connecting to MPLAB ICD 2
ICD0021: Unable to connect with MPLAB ICD 2
MPLAB ICD 2 Ready"

4) Programmer -> Download ICD 2 OS -> Select (ICD01020701.hex)
Output:
"Downloading Operating System
ICD0021: Unable to connect with MPLAB ICD 2
...Download Operating System Failed
ICD0286: Unable to communicate with ICD
ICD0286: Unable to communicate with ICD
ICD0286: Unable to communicate with ICD
ICD0286: Unable to communicate with ICD
ICD0286: Unable to communicate with ICD
MPLAB ICD 2 Ready
"

I am sure that there is nothing wrong with both programmer and serial cable connection.

Because..

I) I hocked up my oscilloscope to the COM1 pins and used some other program to see the program's out put on the oscilloscope properly.

II) The programmer was checked by some other guy and he told me it was working fine.

III) Oscilloscope didn't show any signal when MPLAB trying to connect.

I need help badly. I am pretty sure someone here can definitely help me.
thushy is offline  
Reply With Quote
Old 10th March 2007, 10:04 PM   (permalink)
Default

There have been two other threads in the past week where we covered about everything that could go or be done wrong with and inchworm. Search the forum.

Did you reboot the PC after turning off the FIFO ?

The only thing you know at this point is the MPLAB is not talking to the Inchworm.

You have not given enough details to convince me there is no problem with the cable. Where did you check ?

If everything you said was true it would be working.

Do debugger>settings>communication> and ensure that RS232 and 19200 are selected.
3v0 is offline  
Reply With Quote
Old 10th March 2007, 11:07 PM   (permalink)
Default

1) Did you reboot the PC after turning off the FIFO ?
Yes, I rebooted it several times

2) You have not given enough details to convince me there is no problem with the cable. Where did you check ?
I used a program called "Advanced Serial Port Monitor" to send data to COM1 and physically connected one end of the cable to COM1 and the other end to an oscilloscope. When I send any data through the software, I can see the signal on the oscilloscope.

When I used MPLAB to send data, I didn't see any signals on the oscilloscope.

Sorry for the lack of details in the previous post.
thushy is offline  
Reply With Quote
Old 11th March 2007, 01:38 AM   (permalink)
Default

i'm sure you know this but , every time you open MPLAB you need to redo the setup wizard or use settings in the programer tab
williB is offline  
Reply With Quote
Old 11th March 2007, 03:48 AM   (permalink)
Default

Unless you have a storage scope do not expect to see anything from MPLAB with it unless you have Inchworm connected and powered.

Do a loopback test.
If you are up to pulling and replacing chips on the inchworm try removing the PIC then jumper between the TX and RX pins on the pic socket. Now when you enter data using Hyperterm or "Serial Port Monitor" you should see the characters echoed back. When you remove the jumper they should stop echoing. If this works you cable and MAX232 are good.

How much do you trust the guy who sold it to you. Was it off Ebay ?
Have you asked him for help ? I am trying to figure out if we can trust that he had it working or if he unloaded because it did not work.
3v0 is offline  
Reply With Quote
Old 11th March 2007, 05:34 AM   (permalink)
Default

I tried the method you said. It never echoed back.

And I also captured the following data through "Advanced Serial Monitor" when MPLAB tried to connect to the programmer

COM port is opened
COM port is closed
COM port is opened
COM port is closed
COM port is opened
COM port is closed
COM port is opened
Set timeouts: ReadInterval=0, ReadTotalTimeoutMultiplier=0, ReadTotalTimeoutConstant=500, WriteTotalTimeoutMultiplier=0, WriteTotalTimeoutConstant=500
Baud rate 19200
DTR on
Data bits=8, Stop bits=1, Parity=None
Set chars: Eof=0x00, Error=0x00, Break=0x00, Event=0x00, Xon=0x11, Xoff=0x13
Handflow: ControlHandShake=(DTR_CONTROL, CTS_HANDSHAKE), FlowReplace=(TRANSMIT_TOGGLE, RTS_HANDSHAKE), XonLimit=1000, XoffLimit=1000
DTR off
DTR on
Set timeouts: ReadInterval=0, ReadTotalTimeoutMultiplier=0, ReadTotalTimeoutConstant=500, WriteTotalTimeoutMultiplier=0, WriteTotalTimeoutConstant=2000
Baud rate 19200
DTR on
Data bits=8, Stop bits=1, Parity=None
Set chars: Eof=0x00, Error=0x00, Break=0x00, Event=0x00, Xon=0x11, Xoff=0x13
Handflow: ControlHandShake=(DTR_CONTROL, CTS_HANDSHAKE), FlowReplace=(TRANSMIT_TOGGLE, RTS_HANDSHAKE), XonLimit=1000, XoffLimit=1000
DTR off
DTR on
Purge the serial port: RXCLEAR, TXCLEAR
Set timeouts: ReadInterval=0, ReadTotalTimeoutMultiplier=0, ReadTotalTimeoutConstant=500, WriteTotalTimeoutMultiplier=0, WriteTotalTimeoutConstant=17
Baud rate 19200
DTR on
Data bits=8, Stop bits=1, Parity=None
Set chars: Eof=0x00, Error=0x00, Break=0x00, Event=0x00, Xon=0x11, Xoff=0x13
Handflow: ControlHandShake=(DTR_CONTROL, CTS_HANDSHAKE), FlowReplace=(TRANSMIT_TOGGLE, RTS_HANDSHAKE), XonLimit=1000, XoffLimit=1000
COM port is closed
COM port is opened
Set timeouts: ReadInterval=0, ReadTotalTimeoutMultiplier=0, ReadTotalTimeoutConstant=500, WriteTotalTimeoutMultiplier=0, WriteTotalTimeoutConstant=500
Baud rate 19200
DTR on
Data bits=8, Stop bits=1, Parity=None
Set chars: Eof=0x00, Error=0x00, Break=0x00, Event=0x00, Xon=0x11, Xoff=0x13
Handflow: ControlHandShake=(DTR_CONTROL, CTS_HANDSHAKE), FlowReplace=(TRANSMIT_TOGGLE, RTS_HANDSHAKE), XonLimit=1000, XoffLimit=1000
DTR off
DTR on
Set timeouts: ReadInterval=0, ReadTotalTimeoutMultiplier=0, ReadTotalTimeoutConstant=500, WriteTotalTimeoutMultiplier=0, WriteTotalTimeoutConstant=2000
Baud rate 19200
DTR on
Data bits=8, Stop bits=1, Parity=None
Set chars: Eof=0x00, Error=0x00, Break=0x00, Event=0x00, Xon=0x11, Xoff=0x13
Handflow: ControlHandShake=(DTR_CONTROL, CTS_HANDSHAKE), FlowReplace=(TRANSMIT_TOGGLE, RTS_HANDSHAKE), XonLimit=1000, XoffLimit=1000
DTR off
DTR on
Purge the serial port: RXCLEAR, TXCLEAR
Set timeouts: ReadInterval=0, ReadTotalTimeoutMultiplier=0, ReadTotalTimeoutConstant=500, WriteTotalTimeoutMultiplier=0, WriteTotalTimeoutConstant=17
Baud rate 19200
DTR on
Data bits=8, Stop bits=1, Parity=None
Set chars: Eof=0x00, Error=0x00, Break=0x00, Event=0x00, Xon=0x11, Xoff=0x13
Handflow: ControlHandShake=(DTR_CONTROL, CTS_HANDSHAKE), FlowReplace=(TRANSMIT_TOGGLE, RTS_HANDSHAKE), XonLimit=1000, XoffLimit=1000
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
Purge the serial port: RXCLEAR, TXCLEAR
thushy is offline  
Reply With Quote
Old 11th March 2007, 07:20 AM   (permalink)
Default

u r running "Advanced Serial Monitor" and MPLAB on same serial port???
Ayne is offline  
Reply With Quote
Old 11th March 2007, 07:25 AM   (permalink)
Default

yes, in COM1 (my computer has only one serial port)
thushy is offline  
Reply With Quote
Old 11th March 2007, 07:33 AM   (permalink)
Default

I think u should not use "Advanced Serial Monitor" and MPLAB at same time on one serial port....
Ayne is offline  
Reply With Quote
Old 11th March 2007, 07:37 AM   (permalink)
Default

As u said before... ur flow control
3) Flow control=Hardware

I am also using Inchworm and my Flowcontrol setting is
Flow control=None
Ayne is offline  
Reply With Quote
Old 11th March 2007, 08:58 AM   (permalink)
Default

Quote:
I tried the method you said. It never echoed back.
This is not some obscure test that can give a false indication.
You must get the loopback test working.
Till it does MPLAB can not talk to the Inchworm.

Do you have the right serial cable. Pin2 to Pin2 and Pin3 to Pin3. If your cable is not wired this way it will not work. To work the cable must have wires 2,3,4,7, and 8.

I agree with Ayne in that the monitor program may be causing problems. You do not need it to get the Inchworm working. We know the Inchworm code works you do not have to debug it.

I suggest you use hyperterm to run the loopback test because we know what it is, does and that it will work.

Hint: You may be able to plug the Inchworm directly into the com port on your computer.
Doing so eliminates any problem that a bad/wrong cable may be causing.

Last edited by 3v0; 11th March 2007 at 09:07 AM.
3v0 is offline  
Reply With Quote
Old 11th March 2007, 09:11 AM   (permalink)
Default

No answer is coming from thushy
Is ur ICD working or u r working on it???
Ayne is offline  
Reply With Quote
Old 11th March 2007, 01:13 PM   (permalink)
Default

Quote:
Originally Posted by Ayne
No answer is coming from thushy
Is ur ICD working or u r working on it???
While we wait on thrushy. Now that you have your inchworm working are you using it ? Project tutorials whatever ?
3v0 is offline  
Reply With Quote
Old 11th March 2007, 05:17 PM   (permalink)
Default

I just make a simple program LEDs Blinking with different pattern

Now I am making Modules for my Projects,
Making IR Transmitter and receiver Board,

If u have good link on Capture, Compare and PWM... I want to understand them, what they do, why we use them ???
Ayne is offline  
Reply With Quote
Old 11th March 2007, 06:05 PM   (permalink)
Default

In class I am using the tutorial
by Peter Anderson. It is not free (he has published the first 20 pages at the above link) and I do not know that you can find his header file.

The good news is that the header file def_877.h Is explained in the tutorial and you should be able write the bits of it as needed.

The tutorial uses the CCS C compiler. They have a code sized limited (2K) version that you can download for free. You can do quite a bit in 2K. After you install the CCS compiler download and run the file from the CCS download page that sets it up to work with MPLAB.

Even if you do not choose to run these you can learn a lot by reading the code.

If you choose to try I would be glad to help but can not give you the header file for the obvious reason.
3v0 is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Inchworm components gregmcc Micro Controllers 43 18th March 2007 01:37 PM
ICD2 operating system williB Micro Controllers 47 9th March 2007 10:32 PM
Some Question About Inchworm Ayne Micro Controllers 29 7th March 2007 03:07 AM
Unable to connect to Inchworm Hedos Micro Controllers 15 23rd December 2006 03:26 PM
Inchworm and MPLAB help please!! spondootre Micro Controllers 33 18th December 2006 12:01 PM



All times are GMT. The time now is 07:32 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.