View Full Version : Programming the PIC

08-27-2007, 06:21 PM
Help needed programming 18F4525.

After several failed attempts at programming the 18F4525 IC on a breadboard, I bought a JDM programmer off E-Bay.
I need help with settings in WinPic800 for the hardware and software. Here is a link to a one like the one I bought.
http://cgi.ebay.com/Enhance-JDM-PIC-programmer-Microchip-w-40pin-ZIF-12F629_W0QQitemZ110163961412QQihZ001QQcategoryZ466 1QQtcZphotoQQcmdZViewItem

08-27-2007, 08:52 PM
First, the serial port MUST be hardwired. A USB to RS232 will not work.

Check your shunts on the programmer. There is a file on the CD you got with the programmer that contains the shunt positions (see below). Pin 1 should be beside the little lever on the programmer.

Check to see if the PIC 18F is selected in the upper right corner of the screen. Also 18F4525 should be selected.

Load the HEX file. Be sure to get the right file (sink or source) depending on the SSR's you are using and how the LEDs were installed. The window should look like the one below (see below).

Select "DEVICE>HARDWARE TEST" and it should be OK.
Select "DEVICE>DETECT DEVICE" and it should find the 18F4525.
Select "DEVICE>PROGRAM ALL" and it should be successful.

Tonight, I hooked up my JDM programmer, set up the shunts, loaded my .HEX file, programmed a blank 18F4525, and tested it in a field module. It worked perfectly.

There is no special software setting needed.

Let me know if I can help further.

08-27-2007, 09:43 PM
I have the same programmer as you. I did not program this chip but I successfully programmed the 16f688. Here are the notes I compiled on PIC programming; I think some of it will apply to you.


08-27-2007, 10:45 PM
Don't worry about compiling the code again, just use the .HEX files I have provided.

08-28-2007, 09:44 AM
Thanks for the reply FireGod. When I did a hardware test with the chip in, it comes back with hardware not responding. If I take the chip out it is ok. I put the chip in and did a “detect device”, and it found the I.C. I went ahead and programmed the chip and it did complete and was able to verify the flash. I flashed it with the +5vdc turn on file. I connected the controller and 1 field module, and I don’t get any of the LED’s on the field module to light. I don’t understand what you are saying about installing the LED installation? I am planning on using the SSR’s that I used last year from my Olson 595 setup. I currently have both dimming and non-dimming triac/SSR’s.
From what I can figure out, on the field module, the RJ45 jack by pin 1 of the 18F is channels 1-4; Also will the LED’s on the field mod light with no SSR’s connected? Is there any special COM port settings that need to be addressed, or is default ok. Thanks in advanced

08-28-2007, 10:22 AM
With respect to your SSR's, do you ground a channel circuit to turn it on (sinking) or do you apply a +5VDC signal to the channel circuit to turn it on (sourcing)? If you installed the optinal LEDs on the field module, the polarity MUST be correct for your SSR configuration. LEDs for sinking would be the LED + to the SSR and the - to the 18F4525. Sourcing would be LED + to the 18F4525 and the - to the SSR.

The LED's will not light unless a SSR is connected. The SSR completes the circuit.

With the sinking type of SSR, the module address is selected by NOT INSTALLING a shunt on the desired address. Install shunts on the other three selections.

With the sourcing type of SSR, the module address is selected by INSTALLING a shunt on the desired address. Do not install shunts on the other three selections.

Channels 1-4 are the RJ-45 near pin 1 of the 18F4525.

The default port settings should be fine, the com port number setting is up to you. You will need to identify it in the Windows Control Panel>System>Hardawe>Device Manager>LPT and Com ports.

08-28-2007, 11:12 AM
Thanks for the quick reply. The way everything ran last year was ground was applied to turn on a channel for both my SSR’s I’ll have to double check my Triac/Opto modules. So far I only soldered in 8 LED’s to the field module. I placed them in the direction of the silkscreen; - to the 18f4525, so I should be ok there.
I flashed the chip last night with the wrong flash(sourcing). I did another one this morning with the sinking flash, I’ll try that one later tonight. Thanks again for the help.

08-28-2007, 12:31 PM
Be sure to follow the below instruction:

With the sinking type of SSR, the module address is selected by NOT INSTALLING a shunt on the desired address. Install shunts on the other three selections.

08-28-2007, 01:09 PM
OK, a quick initial test of the system and it appears to be working :)(sort of). I terminated one channel with an LED (just happened to be third one for the RJ45, I.E. channel 3 or channel 7 or 11 Etc.) I ran one of last year’s sequences and I was seeing activity; the only problem is it is flashing/pulsing instead of being solid :? . Any suggestions? I can selectively test the individual channel with the test channels feature and it is working, pulsing, but working. One more step forward :D .
I used the controller, one field module with NO shunt in place. 1 hacked patch cable with 1 LED :)

08-28-2007, 02:07 PM
50hZ or 60Hz?

Without shunt(s) the module address might be any module address.

Check to see that the Zener diode is installed correctly.

I assume your 12 volt power supply is AC, not DC.

Be sure to put a limiting restistor in series with your LED. I use a hacked patch cables with only 510 ohm resistors, no LEDs other than the ones on the field module. Without a limiting resistor, it may be drawing too much amperage causing a low voltage at the I/C. This is the most likely problem.

Check the +5VDC voltage at the field module while the sequence is running. It should be a consistant 5VDC or close to it (4.8 or 4.9).

08-28-2007, 08:09 PM
The final outcome.
The system is up and running and it looks friggin awesome. I switched out the power supply and no more pulsing. One problem I have is my own fault, I should not have used 10,000mcd LED’s :shock: . There is not enough current to drive the triacs. I either have to short them out, or replace them. The new issue I think may be Vixen related. When doing a ramp up or down, there is a pause half way. I’ll check the Vixen forum.

Thanks for the all the help FireGod, looks like I may make Halloween with the new system. :D

08-28-2007, 08:38 PM
The pause half way up is a tuning problem on my end. The middle of the sine wave does not ramp as fast as the middle of the peak/valley. On DC it will be perfect but I need a little tuning on AC. I am working on it and I'll let you know when I get a solution.

Glad to hear it is working!

09-11-2007, 01:23 PM
Can the PIC18F4525 be flashed more than once, or is it a one time deal?
If not, do they make an equivalent erasable one?

P. Short
09-11-2007, 01:37 PM
That part is erasable and reprogrammable many times (the spec says 100,000 times).



10-09-2007, 12:59 PM
Just getting back to the pause issue. I am running the latest version of Vixen (; I am noticing that I get the same pause when doing a fade up/down in the preview as I do with my SSR’s. Is this related to the code in the PIC, or the plug-in?

10-09-2007, 01:31 PM
Code in the PIC, I am still working on it. I was hoping to get a curve for the plugin to help adjust this.

12-14-2007, 02:41 AM
ok, now that i am up and running i have noticed this pause during the fading, has there been any progress in this area? Is there anything i can do to help? is this a coding issue? or hardware limitation?

Greg in Canby
11-23-2009, 07:51 PM
Lights pulsing issue:

My AC adapter is putting out ~13 volts, no load. I have a 6V regulator on the PC interface. When I measure voltage at the regulator pins I get 5.98V.

Over at the FM, I get 4.07 Volts but other than the pulsing, it seems to work OK.

1. Where exactly should I be measuring the voltage on the Field Module? At the TP of course - my bad

2. Any other ideas other than go buy a second 12Volt PS?

Thanks in advance for the help.


Edit - David has been helping me a whole bunch and I'll report when the problem is resolved.