MindBender: would you feel like documenting how you get from here to a finished working device? I think several of us would find it valuable and it would save us all learning separately.
Sure. I'm not going to write a full manual, but here's a step-by-step program:
1. Get the firmware.
You need to download the .hex file from GitHub:
https://github.com/mstegen/Open-Chargeport. Navigate to 'sourcecode' and select the file 'OpenChargeport_10F200.HEX'. It will open in viewing browser where you need to right-click the button 'RAW' and select 'Save file as', or something similar, depending on your browser. The file you receive will be the compiled binary machine code that will be programmed into the PIC microcontroller.
2. Get a circuit board.
You can order them here:
http://oshpark.com/shared_projects/l5PuyNyd. You need to order at least 3 pieces, but they're not that expensive; About $11 each.
3. Get the parts.
I will repeat the list from my earlier post, yet now I can confirm that these are the right components.
Switch
1 pcs.
http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1555983
They're available only in numbers larger than 25.
Battery
1 pcs.
http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1823482
I was unable to find a footprint compatible battery holder, so unfortunately it's a solder-on battery.
RF-module
1 pcs.
http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1699470
This is the 433.92MHz version, for Europe
Microcontroller
1 pcs.
http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1212714
Capacitors
2 pcs.
http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1457655
Capacitor
1 pcs.
http://nl.farnell.com/jsp/search/productdetail.jsp?sku=1907125
I would recommend you to multiply all numbers by three, so you can populate all three boards you will receive. You will have three devices at the price of three, isn't that a bargain?
4. Get the tools.
If you have an EPROM programmer supporting the PIC10F200 you can skip this step.Besides a soldering iron, some solder and a small wire cutter, you also need the following:
8-pin DIP socket
1 pcs.
http://nl.farnell.com/aries/08-3518-10/socket-dip-8way/dp/1674784
6-pin header row
1 pcs.
http://nl.farnell.com/fischer-elektronik/sl1-025-36z/header-pin-2-54mm-36way/dp/9729038
PICKit programmer
1 pcs.
http://nl.farnell.com/microchip/pg164130/debugger-pickit-3-icd-dspic-usb/dp/1771323
A PICit2 will work as well, so to the PM3, the RealICE, etc. But the PICKit is cheap and it is able to supply power to the device being programmed, which I think is a big plus because it saves the hassle of hooking up a power supply.
Some insulated wire
5 pcs. Around 10cm each, different colours are best.
5. Build the programming adapter.
If you have an EPROM programmer supporting the PIC10F200 you can skip this step. If you don't, you'll need to program the PIC using it's integrated ICSP interface.
Unfortunately the PCB isn't equipped with an ICSP port. And if you add one yourself, you won't be able to program the device because Vpp is grounded. So you will need to program the PIC before mounting it onto the board. You need the pin header, the DIP socket and the wire to construct the following adapter:
Close-ups:
Please note that the photos show the
bottom side of the socket, so the brown wire is attached to pin 8 (!MCLR/Vpp) on the side of the little notch in the socket. The header plugs into the PICKit programmer, with the brown wire at pic 1, marked by the little triangle.
6. Program the PIC.
- Install MPLab 8 on your PC (I'm sure it can be done with the much more recent MPLab-X, but I don't have instructions for that. You can download MPLab from Microchip for free).
- Attach your programmer to a USB port of your PC and let it install the drivers. It should find those, after installing MPLab.
- Put a PIC in the socket of the adapter made in step 5 and connect the adapter to the programmer.
- Launch MPLab 8 on your PC.
- Under the menu 'Configure' select 'configure device'.
- In the window that appears, select 'PIC10F200' under 'Device:' and click 'OK'.
- Under the menu 'Programmer' select 'Select Programmer' and select the type of programmer you have attached.
- Under the menu 'Programmer' select 'Connect'. The output window 'PICKit2' tab it should now report something like:
Found PICkit 2 - Operating System Version 2.32.0
Target power not detected - Powering from PICkit 2 ( 5.00V)
PICkit 2 Ready
- Under the menu 'File' select 'Import...'.
- In the window that appears, now select the file 'OpenChargeport_10F200.HEX' you have downloaded in step 1.
- In the Output window 'Build' tab it should now report something like:
Loaded C:\Users\Robert\Desktop\OpenChargeport_10F200.HEX.
- Under the menu 'Programmer' select 'Program'. It will now start programming and verifying your device. The output window 'PICKit2' tab it should now report something like:
Programming Target (31/01/2014 19:52:24)
Erasing Target
Programming Program Memory (0x0 - 0x55)
Verifying Program Memory (0x0 - 0x55)
Programming Configuration Memory
Verifying Configuration Memory
PICkit 2 Ready
Your device is now programmed. You can repeat the last part for the other two PICs, if you have them.
7. Populate your board(s).
When you receive your boards, they look like this:
- File/sand off the depaneling tabs.
- Populate the board with components and solder them into place: Low profile components first, higher later, but
the battery always last. Clip off the residual leads, but don't cut into the solder joint.
Completely finished, your board should look like this:
Tips:
- If you're building this board into a housing, you can mount the switch on the solder side, so the other components won't be in the way.
- Don't put the PIC in a socket as this will eventually lead to poor connections.
- Wash off the flux residue using a good PCB cleaner like this one:
http://nl.farnell.com/kontakt-chemie/kontakt-pcc-200ml/cleaner-kontakt-lr-200ml/dp/2142400.
It will give you a professional finish of the solder side:
Now go and test your device! Mine works ;-).