Skip to main content
Topic: Programming the PIC24FJ64 on the BC Webserver (Read 28864 times) previous topic - next topic

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #15
Damn I have no luck what so ever with my flashers.. I try to flash the 18F2550 with my "40 ZIF USB Interface Microchip PIC Programmer Kit" from ebay, all seems to go well, but when I put the chip on my self made "Brenner9" and then connect it through USB to my computer Nothing happens!! damn.. It is possible I made a mistake in the build of the PCB, but I guess the flash process of the PIC18F didn't go well.

Damn I guess I have to wait until my IDC2 arrives.. :(

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #16
There should be a button with the software for the 40 Pin flasher to verify the flash. If you can do this and your sure the code your flashing is correct then Id suggest you have a hardware fault...

Have you done the basices like checking the supplies, if there an external crystal/oscillator then is it running? Is the MCLR pin being pulled up sufficiently? Since your trying to use USB are D+ and D- the right way around? Have you made sure the capacitor on Vusb is there and of correct value? Cant think of anything else at the moment but I think those are the basics...

Other than that the only thing I can think that may be wrong is that you programmer isn't setting the right config bits... which is quite a common issues when using 3rd party pic flashing software.

It sounds like your not far off, I'd keep at it until your ICD2 clone arrives.

Chris

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #17
Thanks Chris for your great reply, I checked and veryfied the flash again and saw there was something going wrong near the end. It turns out the "MicroPro" flash tool that came with the flasher has a bug! I used another version and now the flashing process was ok!

I tried the 18F2550 in the brenner9 I hear a sound in Windows now, but no it says "Unknown Device" and it says windows has disabled the device because of a problem.
I guess I'm a bit further now, but It still doesn't work. I guess it has something todo with the transistor I used instead of the BF959 one. I guess I have to look for a place to buyt that one.

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #18
[quote author="rvbcrs"]
Thanks Chris for your great reply, I checked and veryfied the flash again and saw there was something going wrong near the end. It turns out the "MicroPro" flash tool that came with the flasher has a bug! I used another version and now the flashing process was ok!

I tried the 18F2550 in the brenner9 I hear a sound in Windows now, but no it says "Unknown Device" and it says windows has disabled the device because of a problem.
I guess I'm a bit further now, but It still doesn't work. I guess it has something todo with the transistor I used instead of the BF959 one. I guess I have to look for a place to buyt that one.
[/quote]
The BF959 shouldn't make any difference at this stage, that's only used to control Vpp during programming.

Providing the code is correct you should only need minimal components to make an 18F2550 talk to windows... more than half the components in that circuit are irrelevent at this stage. Have you got a scope? Have you checked that the oscillator is running? I had a programmer that used MicroPro and I had these very same problems (hence why I dumped it for an ICD2). Im still quite sure that you problem is that the programmer is not flashing the correct config bits. Usually if windows detects the pic but cant recognise it its usually because the clock isn't running fast enough. The verify function on the version of MicroPro that I had didn't verify the config bits. Check whether MicroPro is overriding the settings for the config bits in the hex file.

Let us know how you get on.

Chris

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #19
I unfortunatly do not have a scope..

I will try some other config bits when I'm home again, I must say I really have no clue how to set the fuses.. Well I know how to set them but not to what. The OSC says 40Mhz now, I have no idea if thats correct. The project uses a 20Mhz crystal.

I made a screenshot of the fuses screen, I don't know if you know if this is correct:


Thanks

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #20
I think you config bits are wrong. Attached is the page from the datasheet regarding clock scalers.

Notice how the 96MHz PLL required for the USB requires a 4MHz input. If you have a 20MHz crystal then you need PLLDIV to be 5 to give the correct 4MHz input. With the settings you have at the moment your only giving it 2MHz.

Now because your using the 96MHz PLL (becuase your using a 20Mhz crystal) then you need to enable the USBPLL too.

It looks like you have the correct settings for the oscillator, just to make sure though, it should be the HSPLL. ie high speed with PLL.

Ok, so thats the USB stuff set, CPUDIV is then used to set the oscillator frequency for the rest of the CPU. Notice on the diagram theres two bits labled as CPUDIV. Now because you using the HSPLL your onluy interested in the right hand scaler. So the frequency going into the postscaler is 96MHz and we're after 48MHz so CPUDIV should be set to divide by 2 (assuming your wanting the core to run at full speed, if you have a circuit where low power is critical then you can select a higher value to reduce power consumption).

Turn off the watchdog timer becuse unless your program actually makes use of it then the PIC just keep resetting itself. I also turn off the brownout detect becuase if the voltage drops too low then you have bigger problems anyway.

So to clarify set:
USBPLL to "on" or "/2" wichever it calls it
PLLDIV to "/5"
Oscillator to "HSPLL"
CPUDIV to "/2"
Brownout to "disabled"
Watchdog to "disabled"

I think that should do the trick...

Chris

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #21
I posted Scorpia's PICkit2 teardown pictures here.
Got a question? Please ask in the forum for the fastest answers.

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #22
Wow Chris! That was spot on! I set the config bits like you set and Windows is now really happy with it! I'm getting closer! :)
But the next problem occurs, Windows recognisez the flasher and after installing the drivers it says it is a "Sprut brenner8" so I guess everything is fine now! I start the usb-burn software and what do you know, the program recognised the flasher and even the firmware inside the PIC18F2550.

Next thing I pull out the BC WebServer and plug a 5 pins cable to it and the other end to my newly made programmer! I click the "Identify Chip in Programmer" button and then the program says: "## this PIC-ID 0x0000 is not in database" So I guess the connection between the programmer and the Webserver board is not ok?

I meassured the voltages at the ICSP pins and:

Pin 1 (Vpp) = 3,1v
Pin 2 (Vdd) = 3,1v
Pin 3 (Vss) = 0v (gnd)
Pin 4 (Data) = 3,1v
Pin 5 (Clk) = 0,01v

Are these values making any sense? and maybe the noobest question ever, but the PIC that will be programmed is powered by the ICSP port? or do I have to power the Webserver itself also?

Thanks again so much for helping me out guys!

Ramon

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #23
Hmm I'm looking through the documentation again and see this part:

Tabel 1 Signale on ICSP

Signal:     Vdd (3V) | Vpp (3V) | SCLK (3V) | SDATA (3V) | Vss (0V)
ICSP-Pin:       2             1              5               4                3

All signals (except Vss) must be between 2,5 V and 3,6V.

My Pin 5 (Clk) = 0,01v so I guess there is something wrong there can that be the transistor or?
Damn.. problems, problems :)

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #24
Sweet! Glad to see your getting somewhere now! :D

So, onto the next problem...
I see you've got a real thing for changing those transistor haven't you;) What transistors are you using? Have you checked the datasheet for the replacement device(s) to verify pinouts etc.

This might also be stating the obvious but since it's usually the obvious that we all often overlook... have you made sure that PGD and PGC are connected from the programmer to the targed board correctly. I notice your programmer appears to use the standard Microchip "pinout", whereas the WebServer board had the PGD and PGC pins swapped.

It's not really valid to just measure the voltage on Vpp, PGC or PGD as they're data lines so won't have a steady state when they're working... this is where a scope/logic analyser comes in handy.

Regarding what needs powering... I use and ICD2 and power the target board. It's the way I'd suggest you and others do it too. However, if you are going to do it this way then remove/cut/remove track for the Vdd line between the programmer and target board unless you have some protection circuit in there somewhere. I take it the programmer you've built is the one shown in schematic labeled "Brenner 9L", if so you can remove the jumper on JP2 and this will isolate the two Vdd.

Chris

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #25
Ok there is another project I was trying: http://www.instructables.com/id/Dot_Matrix_Business_Card/ It also has a ISCP header, I connected that one and also no chip recognition, the same message I got with the WebServer. The programmer software has a option to test the ISCP connector on the programmer, it puts power on all lines (except GND) that way you can test if the programmer is working correct.

I made the "Brenner9N" version that is a 5V programmer, but with a 3.3V transformation system so that eventually all the ISCP pins give 3.3V.
This is the schematic:

I don't know what to think about the transistor, but that is the only thing that I changed, it was a BF959 and I changed it to a BF840 (SMT) transistor. That's why I don't trust the thing ;)

About the swapped pins for the WebServer, when I look at the schema I see that pin 4 is PGD and pin 5 is PGC that is the same as on my programmer is it? so what is swapped than? or is the text ok on the pcb, but the physical lines incorrect?

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #26
Well I'm giving up for today I'm tiered ;) I have tried about everything, I swapped the PGD and PGC on the webserver, I detached the V+ from the webserver and powered it with its own power source...

Is it possible that there is still something wrong with the config bits?

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #27
well something that might help is i dont remember the pins on the webserver being swapped. infact it worked straight up for me on the pickit2.

so maybe your programmer is swapped. if you happen to have a buspirate does it see that?

Peter

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #28
Right, I've just realised what you mean about how the data lines should be 3.3v... I see the clock line is on RB4... one of the config bits sets RB0:4 as either analogue or digital on startup. So I think if you change PBADEN to digital instead of analog then that should sovle the issue.

Chris

Re: Programming the PIC24FJ64 on the BC Webserver

Reply #29
Oh, and I think you guys are right about the pins not being swapped, I thought I'd read somewhere that they were... it was late and I was tired... well, thats my excuse anyway :p

Chris