# 18F programmer without zener diode?

Status
Not open for further replies.

#### cardine

##### New Member
I want to program a PIC18F1320, in order to do this I need to build a programmer and can't find a programmer that doesn't use zener diodes.
At my local shop they don't have 5.1v and 6.2v zener diodes only 3.5v and 12v.

Can some one help my find a programmer?

#### millwood

##### Banned
a red LED (the regular type) usually have a 1.7-1.9v forward drop. so that will get you close to 5.1 (3.5+1.7=5.2v).

other color LEDs have slightly higher voltage and you can always use a signal diode (1n4148 or 1n4001 type) to drop another 0.7v to help you get to 6.2v.

#### blueroomelectronics

##### Well-Known Member
Those JDM style programmers are notoriously unreliable. Search the forums here.

#### be80be

##### Well-Known Member
That's funny looks like they would have a 5.1volt and the 12 volts 3.5 whats hard to find
here you can use a 5 volt regulator to for the five volt done that before.
I've never tried it but I have seen where they use a 12 volt wall wart and a 5volt regulator
used the 12 for vpp 5 for vdd

Last edited:

#### Chippie

##### Member
That's funny looks like they would have a 5.1volt and the 12 volts 3.5 whats hard to find
here you can use a 5 volt regulator to for the five volt done that before.

It would need to be a very lo dropout to work....Hence the zener...

Built many a JDM prgrammer...never had one fail.

Having a pc with a real serial port helps

#### be80be

##### Well-Known Member
Chippie He ask I told with out a zener and it can be done. I can program a 18f1320 with a cut off piece old modem cable and three resistor.But I Like my Junebug and pickit2 better.

#### Chippie

##### Member
Chippie He ask I told with out a zener and it can be done. I can program a 18f1320 with a cut off piece old modem cable and three resistor.But I Like my Junebug and pickit2 better.

So mebbe you should explain how it can be done then we can all learn!

Some one remind me why I like this place....

Last edited:

#### blueroomelectronics

##### Well-Known Member
The 3 resistor LVP parallel port based programmer can be found on Eric Stolz site.

#### be80be

##### Well-Known Member
Bill you beat me to it It's LVP but i don't use the parallel port I used the serial port. It works just have to remember to keep pgm pulled low. This is a 16f628a programed that way
[embed]http://www.youtube.com/v/_4Rtj1x6kGM&hl=en&fs=1&[/embed]

#### cardine

##### New Member
be80be how do you program pic18f1320 with only three resistors?

#### blueroomelectronics

##### Well-Known Member
Oops I meant Lothar Stolz.

**broken link removed**

Last edited:

#### be80be

##### Well-Known Member
I used icprog. It really takes 4 but one stays after programming you can read about it here the site Bill linked **broken link removed**
You don't get to use all the pins after programming. But what's one pins you got a programed pic chip. And don't turn off LVP in your config or you'll not reprogram it agin with this programmer and fix it LOL and hold pgm to gnd.
Since you use Low Voltage Programming-mode, pin PGM is not usable for I/O. If you programm a PIC in this manner, always ensure PGM is pulled low in the application (e.g. by adding 10K to ground) even if the schematics look different - otherwise the PIC might enter programming mode instead of normal working mode.

#### be80be

##### Well-Known Member
If your really wanting to learn how to code for a pick I try this till you get a good programmer Like the junebug That Bill made It's a good tool to use to learn with. It has the tutor some leds a pot and IR module to play with. The only thing that would of made it better is if it had 8 led on PortB. But that just me I like to output the binary to a port just to see whats going on some thimes.

#### cardine

##### New Member
I have build the programmer but I don't know what to do next icprog is full o FF and 00 and my code is in plain text, should I save the code in a file and open it with icprog?

Code:
'Manual control of two servomotors using 2 SPDT switches

'Use B1 to hold pulsewidth variable for servo 1
'Use B2 to hold pulsewidth variable for servo 2

'Initialize Variables

B1 = 150
B2 = 150

'start servo 1 at center position
'start servo 2 at center position

start:
IF pin1 = 0 Then left1
IF pin2 = 0 Then right1
IF pin4 = 0 Then left2
IF pin5 = 0 Then right2
PulsOut 0, B1
PulsOut 3, B2
Pause 18
GoTo start

'check for switch closures
'is sw1 left active?
'is sw1 right active?
'is sw2 left active?
'is sw2 right active?
'send current servo 1 position out
'send current servo 2 position out

'Routines for Servomotor 1
left1:
B1 = B1 + 1
PulsOut 0, B1
PulsOut 3, B2
Pause 18
IF B1 > 225 Then max1
GoTo start
right1:
B1 = B1 - 1
PulsOut 0, B1
PulsOut 3, B2
Pause 18
IF B1 < 75 Then min1
GoTo start
max1:
B1 = 225
GoTo start
min1:
B1 = 75
GoTo start

'increase the pulse width
'send current B1
'send current B2
'set frequency update about 50 hz
'maximum 2.25 millisecond

'decrease the pulse width
'send current B1
'send current B2
'set frequency update about 50 hz
'minimum .75 millisecond

'cap max B1 at 2.25 milliseconds

'cap min B1 at .75 millisecond

'Routines for Servomotor 2
left2:
B2 = B2 + 1
PulsOut 0, B1
PulsOut 3, B2
Pause 18
IF B2 > 225 Then max2
GoTo start
right2:
B2 = B2 - 1
PulsOut 0, B1
PulsOut 3, B2
Pause 18
IF B2 < 75 Then min2
GoTo start
max2:
B2 = 225
GoTo start
min2:
B2 = 75
GoTo start

#### blueroomelectronics

##### Well-Known Member
Your compiler should "compile" or "make" a .hex file for you.

#### be80be

##### Well-Known Member
That's picbasic pro you have to build it like Bill said. "compiler" makes your hex and load that Post your circuit and I'll write you a sample code to try

Last edited:

#### cardine

##### New Member
So in order to program the pic i need to

1) Write the code into MPLAB
2) compile MPLAB to get hex file
3) use icprog to write the code on the pic
?

#### be80be

##### Well-Known Member
That it you go to the folder that you built in and load the hex with icprog

Status
Not open for further replies.

Replies
11
Views
8K
Replies
5
Views
4K
Replies
12
Views
1K
Replies
31
Views
4K
Replies
5
Views
1K