Difference between revisions of "DsPic-Raspberry programmer interface"

From wwwelab
Jump to navigation Jump to search
Line 23: Line 23:
 
   | 37
 
   | 37
 
   | GPIO26
 
   | GPIO26
   | TBD - Function
+
   | PGD1//470
 
   | Brown
 
   | Brown
 
|-
 
|-
 
   | 35
 
   | 35
 
   | GPIO19
 
   | GPIO19
   | TBD
+
   | PGD2//470
 
   | Blue
 
   | Blue
 
|-
 
|-
 
   | 33
 
   | 33
 
   | GPIO13
 
   | GPIO13
   | TBD
+
   | PGC
 
   | Green
 
   | Green
 
|-
 
|-
 
   | 29
 
   | 29
 
   | GPIO05
 
   | GPIO05
   | TBD
+
   | RST (when high)
 
   | Brown/Wh
 
   | Brown/Wh
 
|-
 
|-
 
   | 03
 
   | 03
 
   | GPIO02
 
   | GPIO02
   | TBD
+
   | PGMmode (high)
 
   | Orange
 
   | Orange
 
|}
 
|}
 +
 +
If RST low and PGMmode high the pic enter program mode (12V @ MCLR).
 +
If RST high (PGMmode any but should be low) the pic reset and hold.
 +
If PGMmode low and RST low the pic run with MCLR at high impedance (or pulled up from dsPicnode side.
 +
 +
PGD1 and PDG2 are summed with two 470 ohm resistors to the pic PGD
 +
PGC is connected to the pic PGC with one series resistor of 470 ohm.
 +
 +
The 12V pull-up is wired with a 100 Ohm resistor (version 1) and 470 ohm (original version). This is a non-essential situation as it was devised to create 4.3V  if PGMmode and RST were independent.
  
 
==Software use==
 
==Software use==

Revision as of 17:31, 13 May 2020

dsPic-Raspberry programmer interface

A general purpose interface consisting in two opto-couplers have been developed to program the dsPic micro-controllers directly from the Raspberry, allowing remote maintenance and reprogramming of each de-localized unit.

It as to be powered by 12 V (minimum voltage 10.5V - maximum voltage 13.5V) dsPic node unregulated Vcc and feed by the Raspberry GP_I/O, with a common digital ground.

Pin-out and connections

The following table describes the pin-out assembly of the opt-programmer developed to be used with picpgm software.

Programmer pin-out
Rasp I/O Label Programmer I/O Cable
39 GND GND Blue/Wh
37 GPIO26 PGD1//470 Brown
35 GPIO19 PGD2//470 Blue
33 GPIO13 PGC Green
29 GPIO05 RST (when high) Brown/Wh
03 GPIO02 PGMmode (high) Orange

If RST low and PGMmode high the pic enter program mode (12V @ MCLR). If RST high (PGMmode any but should be low) the pic reset and hold. If PGMmode low and RST low the pic run with MCLR at high impedance (or pulled up from dsPicnode side.

PGD1 and PDG2 are summed with two 470 ohm resistors to the pic PGD PGC is connected to the pic PGC with one series resistor of 470 ohm.

The 12V pull-up is wired with a 100 Ohm resistor (version 1) and 470 ohm (original version). This is a non-essential situation as it was devised to create 4.3V if PGMmode and RST were independent.

Software use

The picpgm software is hosted here and should be used with the following script:


Bash file @ /etc/rc.local

CODE



Phyton script

CODE

A backup is also founded at elab1/...