bananasiong said:
I've tried to program with my friend's programmer with simple LED flashing program. But I failed to read by using my programmer. When I read it back using my friend's programmer, i can see the code.
This indicates that your programmer hardware has problem or not properly setup or there is communication trouble between PC and programmer.
First, you need a setup file for WinPic to tell WinPic which signal(s) you are using to communicate with the programmer. The file that I use has the name "LChung_Parallel.INI" and its content is as follow:
If you need to know more about what each line means, clicks "HELP on LPT Interface" on the WinPic Menu.
Code:
[Info]
Purpose=Setup for the parallel port
[ProgrammerControlLines]
DataIn=bsy
OkButton=nc
VppOnOff=D2
VddOnOff=!D3
Connect=nc
ClockOut=D1
DataOut=D0
PullMclrDown=nc
DataOutWhileReading=1
ClkEnable=nc
OutEnable=nc
RedLed=nc
GreenLed=nc
You cannot use this setup file as is because you need to use the correct signal input/outputs of your programmer which is different from mine. Just copy/paste the code above and create a new text file with INI extension. Edit the file with proper signal bit names(e.g. D0 or D3 etc...) used in your own programmer and save it to the WinPic directory. Then select to use it in WinPic.
Connect up the programmer to PC parallel port and power up the programmer. Start WinPic software.
Inside WinPic, there is a menu Tab for "Interface", with several tick boxes under the "Interface Test" section on the left.
With no PIC in the socket, place a voltmeter between 0V and check each of the following pins(Vpp, Vdd, Clock and Data out) in turn, while ticking a box repeatedly, with a tick a voltage should be presented and gone when there is no tick. Check that the level is correct, Vpp=13V and others = +5V.
Now I need to say more about the "Data(to PIC)" tick box. You'll notice there is a "Data In = 0" under it which has no tick box associate with it. It don't. The level is suppose to change together when you clicks the "Data(to PIC)" box. You must get this right for the programmer to work. If it appears to be not changing or changes in reverse, then you have to edit the above setup up INI file to make it changes together with correct polarity.
If any of the above tests failed, try to find out the reason why. If it appears to be reversed, (ie. voltage without tick and voltage gone with a tick) then you have to add the "invert, ! symbol" before that signal name in the INI file.
If all else fails, you can select "SLOW mode" at the bottom right of the WinPic interface type menu to check out whether this is caused by the timing of your computer.
Good luck.