Problem with PIC18F2550 ICSP

Discussions related to MegaDrum Hardware

Problem with PIC18F2550 ICSP

Postby jonga » Thu Feb 14, 2008 5:06 am

Hey guys,

I have (almost) successfully built my Megadrum. I'm having a really hard time to programm the PIC18F2550. Programming the Atmega 32 was really easy. But I just couldn't do the same with the USB CI. I read a topic where estregan was facing a similar problem. I tried all the suggestions that dimitri sent and still couldn't get the WinPic to recognize properly the IC.

I know that it may sound like a really dumb question, but should I connect the terminals 1 and 2 of the ICSP somewhere? In the diagram they are shown not connected to anything so I assumed that they had no use. But after watching more carefully the PIC18F2550 connections, I have the feeling that they should be connected to something. And that may be the reason of all my problems.

With WinPic, I'm getting the following readings for pins 26, 26 and 28 of the PIC18F2550:

Vpp checked -> pin 26 = +5.79
Vpp unchecked -> pin 26 = -0.59V

Clock checked -> pin 27 = +5.86
Clock unchecked -> pin 27 = -0.61v

Data (to PC) checked -> pin 28 = +3.83V
Data (to PC) unchecked -> pin 28 = -0.60V

which is pretty close to dimitri's readings.

So, if anyone could help, I'd appreciate it! :D
jonga
 
Posts: 31
Joined: Thu Feb 14, 2008 4:40 am

Re: Problem with PIC18F2550 ICSP

Postby ignotus » Thu Feb 14, 2008 10:40 am

Hi

I also had problems with the pic; it wasn't recognised properly and winpic kept saying write had failed... but my computer suddenly detected Megadrum and since then everything went fine. Oh, and I was a bit confused too with those cables with no connection - I didn't use them and it worked.
I think estregan too ended up programming is pic with the same experience.

Good luck!
If it ain't broken... fix it until it is.
ignotus
 
Posts: 882
Joined: Sat Nov 24, 2007 11:36 am

Re: Problem with PIC18F2550 ICSP

Postby dmitri » Thu Feb 14, 2008 11:17 am

jonga wrote:Hey guys,
So, if anyone could help, I'd appreciate it! :D


Since it is brought up not for the first time and every time there were different mistakes made while trying to program PIC18F2550, it is hard to guess what is wrong in your case. Post here what you did step by step, including all the little details like "Connected the ICSP cable to a PC. Connected the ICSP cable to the board. Powered up board...." and so on. Include as many screenshots as possible.
dmitri
Site Admin
 
Posts: 8709
Joined: Fri Aug 03, 2007 8:05 pm

Re: Problem with PIC18F2550 ICSP

Postby jonga » Thu Feb 14, 2008 12:21 pm

Hey dimitri and ignotus, thanks for your reply!

Well, what I usually do is:

1 - Connect the ICSP cable to the computer
2 - Connect the ICSP cable to the board
3 - Connect the usb cable to the computer
4 - Connect the usb cable to the board

When I open WinPic, the log of the first attempt to connect to the board says:

Info: Loading definitions for "PIC18F2550" from C:\WinPic\devices.ini .
Info: Support for some newer PIC18F devices added by Martin v.d. Werff 2005
Couldn't find "devices\PIC18F2550.dev", please borrow/copy from MPLAB !
PIC18F: family='21'=4550, WriteLatch=32 bytes, EraseLatch=64 bytes .
Failed read back of DATA line (LOW) !
WARNING: Could not initialize programmer !
Testing: delay(500ms) took 0.50 seconds, timer_freq=1.1932 MHz ... ok
Unknown algorithm name : "16F716 ; ex: ERASE_16F87xA" !


And then, when I try to initialize the connection, it says:

Failed read back of DATA line (LOW) !
WARNING: Could not initialize programmer !


Which is weird because I can clearly remember that yesterday it was saying:

Failed read back of DATA line (HIGH) !
WARNING: Could not initialize programmer !


The error that I get when trying to programm the PIC is

Results from LoadHex: LastProgAdr=0x001862 LastDataAdr=0xEFFFFF (C:\MegaDrum USB MIDI Firmware 18F2550 12MHz V2.hex)
Programming...
Erasing ("bulk" or "chip") ...
Erasing chip using algorithm "PIC18F" .
Programming CODE, 0x000000..0x001862
Verifying CODE, 0x000000..0x001862
Verifying 0x000000..0x001862
Verify Error: 000000: read 00FFE3, wanted 00EF43, mask 00FFFF ==> diff=0010A0
Verify Error: 000002: read 00FFFF, wanted 00F00A, mask 00FFFF ==> diff=000FF5
Verify Error: 000008: read 00FFFF, wanted 00EFAF, mask 00FFFF ==> diff=001050
Verify Error: 00000A: read 00FFFF, wanted 00F00B, mask 00FFFF ==> diff=000FF4
More Verify Errors, unable to list all (total=3120)
Programming CONFIG, 0x300000..0x30000C
Verifying CONFIG, 0x300000..0x30000C
Verifying 0x300000..0x30000C
Verify Error: 300000: read 00FFDA, wanted 000E32, mask 00FFFF ==> diff=00F1E8
Verify Error: 300002: read 00FFFF, wanted 001E3F, mask 00FFFF ==> diff=00E1C0
Verify Error: 300004: read 00FFFF, wanted 0080FF, mask 00FFFF ==> diff=007F00
Verify Error: 300006: read 00FFFF, wanted 00FF85, mask 00FFFF ==> diff=00007A
More Verify Errors, unable to list all (total=7)
ERROR: Programming FAILED !


One thing to be said is that the configuration of the COM port (and the port itself) is alright. I found a step-by-step guide to chek one ICSP, the ports, the hardware. It can be found at http://www.hamradioindia.org/forums/viewtopic.php?p=1441. One of the things that it suggests to check if the com port is ok is to connect pins 4 and 8. It could help so I tryed. I did that an the WinPic recognized the device. So I could only guess that my port and my configs are ok.

Another thing to be said is that sometimes the computer that I'm using to use WinPic recognizes the device properly as the Megadrum. But if I turn off the computer or try to connect it to another computer, it is recognized as an usb device, but is not correctly recognized (the windows displays an error flag of unrecognized USB device).
You do not have the required permissions to view the files attached to this post.
jonga
 
Posts: 31
Joined: Thu Feb 14, 2008 4:40 am

Re: Problem with PIC18F2550 ICSP

Postby dmitri » Thu Feb 14, 2008 12:41 pm

And you used V2 version of the firmware (http://www.megadrum.info/MegaDrum%20USB ... z%20V2.hex), didn't you?
dmitri
Site Admin
 
Posts: 8709
Joined: Fri Aug 03, 2007 8:05 pm

Re: Problem with PIC18F2550 ICSP

Postby jonga » Thu Feb 14, 2008 12:45 pm

Yes, I did...
jonga
 
Posts: 31
Joined: Thu Feb 14, 2008 4:40 am

Re: Problem with PIC18F2550 ICSP

Postby dmitri » Thu Feb 14, 2008 12:47 pm

Can you read flash back from your PIC and post it here?
dmitri
Site Admin
 
Posts: 8709
Joined: Fri Aug 03, 2007 8:05 pm

Re: Problem with PIC18F2550 ICSP

Postby jonga » Thu Feb 14, 2008 12:57 pm

I'm not sure if that is what you want, but I read the pic and then saved the buffers in the file attached. Please correct me if this is not what you meant.
You do not have the required permissions to view the files attached to this post.
jonga
 
Posts: 31
Joined: Thu Feb 14, 2008 4:40 am

Re: Problem with PIC18F2550 ICSP

Postby dmitri » Thu Feb 14, 2008 1:05 pm

Certainly with this flash content it should NOT be recognized as a USB device anywere - it is all, but 2 bytes, empty. Can you try programming on another PC?
dmitri
Site Admin
 
Posts: 8709
Joined: Fri Aug 03, 2007 8:05 pm

Re: Problem with PIC18F2550 ICSP

Postby jonga » Thu Feb 14, 2008 1:51 pm

I tryed on another computer. It was pretty much the same. The only difference was that in the first attempt, right after the programming, the computer recognized properly the device (as Megadrum). But then when I tryed to connect to another computers, it failed again. The same computer didn't recognized the device after that.

Now, if the IC is empty how come the computer recognized it as Megadrum?

Attached is the pictures of my baby hehehe :)
You do not have the required permissions to view the files attached to this post.
jonga
 
Posts: 31
Joined: Thu Feb 14, 2008 4:40 am

Next

Return to MegaDrum Hardware

Who is online

Users browsing this forum: Bing [Bot] and 53 guests