Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Project to replace CY7C64613 in the ICD2

Status
Not open for further replies.

albert22

Full Member level 6
Full Member level 6
Joined
Jul 20, 2004
Messages
332
Helped
68
Reputation
136
Reaction score
65
Trophy points
1,308
Activity points
5,005
mcdrv48f.dll

I am evaluating the posibitity to replace the Cypress USB on the ICD2 with a PIC18f2550 or similar
Reasons for this are:
-CY7C64613 seems to be dificult to obtain.
-Lower price ($20 vs $10).
-SMD package requires a pcb and more or less skilled soldering. The pic is available in DIL.
-Solutions around FTDI alike ICs are just COM port emulations which seem to be limited to 57600 by MPLAB.
-PIC16fxx50 is cheaper, simple circuit and no need for the serial eeprom.
-I Just finished my RS232 ICD and like the idea of using it for developing this project.
-I Dont know when are going to be available the details for the new version of the ICD2 based on the PIC18F4550

As this is not a direct replacement. Emulation of the functions performed by the CY are needed.

On a first look I realized the following(w98):
-The driver supporting the ICD2 seems to be "ICD2w98.sys"
-The CY should be recognized as VID/PID 04d8/8001 (The CY takes this from its external eeprom)
-At startup, CY boots its firmware RAM from the PC. This should be bypassed. I didnt find which file contains this firmware. Ap. this download is handled by the 2nd driver "ICD2w98L.sys".
-The interface to the ICD2 cpu needs a full 8 bits port plus 4 lines.
-One more signal generates MCLR for a 2nd connector named PROG which ap is not used.
-The CY speaks, at least, with the BL on the ICD2 CPU which is small.
-It is not probable that the firmware of the CY might change very much with different versions of mplab.
-No patching of the win drivers should be needed.

The functions of the CY could be determined by a combination of:
-studying the CY firmware
-studying the BL or dexxxxxx.hex files
-studying the win driver
-analyzing the USB traffic
-LA on the ICD CPU interface

Any help or comments?
 

icd0019

For your information,

I bought an ICD2 clone made by a brazilian company. This ICD2 has the 18F4550 as the USB interface and a 16F877 as a main controller. It works great with MPLAB and is cheaper than the original (around USD 100). Of course I don´t have the code. But to encourage you, i say it is possible.
 

icd2.5

The Bootloaders should remain the same if the emulation is right.
I was thinking that there is a great chance that all the interface from the CY signals is done just in the Bootloader. Being the only file that changes to support the 877A . Implies that the different operating systems loaded by the MPLAB dont handle the writes to the program memory. There is a good chance that they only rely on the BL for IO to the RS232 and USB.
I have been trying to disassemble it with IDA, MPLAB and ICPROG with poor results.

I am on the CY side now. But I will take a look, thanks for the link Kripton2035.

At the datasheets I found that the firmware for the CY sould be embeded in the win driver that handles the load: "ICD2w98L.sys".

rkodaira. This are bad and good news. The bad news is that I didnt had an original idea. :) The good ones is that it can be done (as you said)
Is your ICD2 configured really as USB or as a COM port on MPLAB.?
This is important because if they are doing a COM emulation there is no need to use a PIC , it is easier to use a USB/RS232 converter.
 

pic16f4550

can you give us the link to this brazilian company ?

albert, I think they really use the usb port because they wouldnt have used a 18fxx50... they would have used a cheaper pic.. but what warns me is why didnt they use a simple 18f2550 ? they dont need so many io ports the 18f4550 has ?!?!?
 

icd2 clone pic32

I've disassembled ICD2.dll, it searches for the file ICD2_4550_BOOT_*.BIN and ICD2_4550_OS_*.BIN in the ICD2 directory and depending on MPLABCommOpen function's return infos it calls CCommDriver::Send18F4550Image routine.

I think MPLAB uses USB just for speed, and uses it as a simple but faster com port.
Cypress has a parallel output to the 16F877(a) portD and portE both connected to it, and it even drives the MCLR of the 877 (but it can be only for reset purposes since the bootloader in 877 does the fw upgrade).

Unfortunatelly I don't have a Logic analyzer nor a storing scope (just a normal one), but it would help a lot to see what cypress is doing with 877.

Zed
 

icd2_usb_4550

The link is:

**broken link removed**

The ICD2 clone works with USB port and does not emulate teh COM port, so the speed is faster than the COM port.
[/img]
 

resistencia reset icd2

The files that Zedman found on the icd2.dll are indeed included with mplab 7.30 which I have just installed.
ICD2_4550_BOOT_0180.BIN
ICD2_4550_OS_0100.BIN
the later contains this text:
M.i.c.r.o.c.h.i.p. .T.e.c.h.n.o.l.o.g.y. .I.C.D.2. .U.S.B. .D.e.v.i.c.e...i.c.d.2. .u.s.b

Undoubtedly they are the firmware for the new 18f4550 based ICD2. We only need the new schematics and this project will have no sense.

The interface with the CY is based on the Parallel Slave port of the 877. The CY writes the latch using the WR CS and RD on port E and the PIC uses RB0 to signal PC2/INT0 and write into the CY. The PIC is using the PSPMODE.Described in the 877 datasheet.

One reason for using a 4550 instead of a 2550 could be the size of the internal RAM for buffering purposes. Other could be a Parallel Slave port. Although I didnt check the datasheet to see its differences.
 

icd2_4550_boot_0182.bin

perhaps changing the 16f877(a) with a 18f4550, and connecting directly the usb pins to the 18f4550 should work ? :) :) :)
but as with the 16f877, we have the bootloader bl010101.hex available, we NEED the 18f4550 bootloader too !! I dont think microchip will change the whole design os the icd2.. they only want to get rid of the cypress chip as they now have also an usb chip...they havnt at the time the icd2 went out ?
 

18f4550_boot.hex

Remember guys, they wont change the 877 i think, because they wont recode all the included fw for the separate chips to 4550...

Good news :)
I managed to extract 2 HEX files from icd2w2kl.sys I think these files gets downloaded to the cypress as Albert mentoined.

But help me to decode them to assembly, Cypress has a 8051 core, but i have only rather old 8051 disassembler and we need the register names too.

Keep up the good work! :))
 

operation aborted (warning 51)

Guys
I'd just like to say thanks for putting your efforts into making a newer vesrion of ICD2 clone for all of

Keep up the good work and hopefuly you will it

I would not know where to start at all

best wishes

wizpic
 

icd0255

Something is wrong with those .bin files.
I tried to convert them to HEX and load it to MPLAB's sim, it loads OK but seems not really a working program...
Maybe it's scrambled to protect it from hackers like us...
I think I have to take a closer look to ICD2.dll where it loads these files...
 

why to replace cy7c64613

Zedman said:
Remember guys, they wont change the 877 i think, because they wont recode all the included fw for the separate chips to 4550...

that would say that the brazilian icd2 clone *IS* the new microchip icd2 ? with a 18f4550 replacing the cypress chip, and still the 877 with all the firmwares to program the pics ? and debug them ?
that would explain the use of the 18f4550 because of the need of a parallel slave port, not available on the 18f2550. the cypress chip is at the end "only" a usb-parallel bridge ?

is there a way to understand globally what the founded firmware for the 18f4550 does ? is it only a usb bridge - or a full icd2 chip ?
 

icd2 microchip not recognizing loader driver

The bootloader just choices between the data comming from the USART or from the PSP. Once the byte is received by either, the same routines are used to process the data.
That is, once the active interface is detected. the data coming from RDREG is threated in exactly the same way as data read from the PORTD.
This means that a RS232 monitor will reveal the protocol of both USB and RS232, at least with the bootloader.
I have tryied to see whats happening at the operating system that is loaded by the MPLAB to the ICD2. Which I thought were in the dexxxxxx.hex files. But DE16f77.hex and DE16f88.hex does not make sense yet.

Zedman, take care with the mplab disassembler function. When I loaded the BL into it, the jumps were incorrectly reported. However a stepping into worked well.
Example. at the first instructions
goto 0x561 really jumps to 0x1d61 (due to the remaing bits of the PCLAT)

I dint find the way to extract the CY code from the .sys file as you did Zedman, congratulations. I did found the .c source code for the cypress counterpart and the utilities to pack it to the sys driver. I was still trying to figure out.

If the new ICD2 retains the 877 and the old routines it would be easy to figure out how to connect the PSP and handshake signals.

I will not be at my home for some days. And will not have my PC with me. But Ill keep following the thread until my return.
 

mg411 chip

The new ICD2 4550 is support PIC24F, PIC33F.
But this link.
**broken link removed**

See in device support list is not show.
 

open hardware icd2

I'am embarassed :(,

hacked out the hexs from the .sys while the source was available... where did you found them?

Took a look on the .bin files and the loader routines, I think it's not get decrypted or descrambled while/after loaded into ICD2.dll. Just loaded and passed to the device. And the strings in it can be read too. But they look strange in mplab.

I wonder why do they gave the bootloader of 4550? (I know, they gave the BL of 877 too). It's preprogrammed with it in the factory. It cannot be loaded through USB to an empty chip.

Going to buy a 4550 and let the fun begin... :)

Added after 41 minutes:

rkodaira,

what speed the 4550 on your ICD2br running at?

Added after 50 minutes:

I found this according to bin files on Microchip forum:

"I don't know about these files, but when I connect an 18F4550 as a device, the MPLAB downloads a new OS into the ICD2, reverts back to some other OS when other 18F are connected."

I think they are not used to be a fw for ICD2's new USB adapter. We have to write our own.
 

cdwarn0034

Answering to Zedman:

There is no speed meter to know the speed, but i think that it works at USB 2.0 speed. In fact when transfering hex files to the board, it is very fast. I have not used the board as debugger yet, so i do not have any experience in this. And there is no specifications on the user manual informing the speed or any other valuable information (the manual is available for download at the same site, but it is written in portuguese - any doubt ask me to translate some parts)

I can check another details for you guys, as for example: the crystals frequencies for each PIC. I agree that the 18F4550 is just replacing the cypress chip. In advance I inform that there is no serial interface in the board and it does not need external supply for working (supplied by the USB port).
 

ic pin configurasi sn 0644

Sorry, i mean the crystal freq.

Added after 3 minutes:

Also can you please check which 4550 pins are connected to the 877?
 

    V

    Points: 2
    Helpful Answer Positive Rating
inchworm pic 3.3v

is possible send large foto of this clone ??
 

icd2_4550_boot_0182

hehe, I tought I'll ask rkodaira to extract the code from the 4550 but I was too shy :)
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top