Lego-Knex
Robbert Mattijs ![]() |
Mindstorms PIC programmer
(hardware version 2) Stef Mientki september 2001 |
Software |
Why
another PICprogrammer
The reason is simple, everything I tried
didn't work for 100% (specially programming the normal version of the PIC16F84
give rise to problems). For more background information and things I tried,
see hardware version 1.
Specifications
The programmer connects to a free RS232
port of the PC and doesn't need external power supply.
The programmer is tested under windows-98
on a PII-66 and a PIII-1000.
Everything, including sources, is available
(for free of course).
Tested PICs (ordened by family)
16x8x | 16F62x | 16F87x | |||
16F84
16F84A |
16F628 | 16F876 |
Operating
Instructions
It's important to
follow the steps described below in the right order, because applying a
voltage to the programmer pin of the PIC, without the PIC is supplied from
a +5Volt source, can damage the PIC.
Circuit
The circuit shown below is straight forward.
The major differences with other simple programmers is the feedback lines
for both clock and data signals (see for futher details, the current
design).
You can roughly test if your serial port
is capable of delivering enough current, by connecting a resistor between
DTR and GND and measuring the voltage.
Finding the optimal signal connections
Programming | Running | RCX | MindScope | |
DTR | program clock,
when 0 = +5V power |
0 = 5V power supply for PIC | not used, low | 1 = power generating for batteryless tower |
DSR | echo of DTR (clock) | - | - | - |
RTS | program data,
power for RS232 from PIC when 0 = +5V power |
1 = enable PIC,
power for RS232 |
1 = tower on
0 = tower off (after 3 seconds) |
1 = tower on
0 = tower off |
CTS | echo of RTS (data)
or Read data |
- | = RTS,
used to check if tower is present |
= RTS |
TxD | +5V power supply | RS232 data to PIC
when 0=+5V power supply |
TxD | TxD |
RxD | - | RS232 data from PIC,
gets positive power supply from RTS |
RxD | RxD |
Start the program, Tools / Settings / Commport / ...
Connect to right port, enable DTR and measure the voltage between DTR (pin 4) and GND (pin5)
The voltage should be >=5Volt, for the resistor value yields
1 kOhm --> 5 mA (will do for the new devices, i.e. 16F84A)
500 Ohm --> 10 mA (necessary for old devices, i.e. 16F84
DTR low, RTS low | DTR high, RTS low | DTR low, RTS high | DTR high, RTS high |
4 = 5.5 V
13 = 1.5 V 14 = 5.5 V all others 0 V |
4 = 5.5 V
13 = 4.5 V 14 = 5.5 V all others 0 V |
4 = 5.5 V
12 = 10 .. 14 V 13 = 1.5 V 14 = 5.5 V all others 0 V |
4 = 5.5 V
12 = 10 .. 14 V 13 = 4.5 V 14 = 5.5 V all others 0 V |
ideas for the future |
|
3-11-2001 |
|
October 2001 |
|
Septemnber 2001 |
|