| 67 | |
| 68 | == version 2 == |
| 69 | The version 2 of the hardware got several improvements: |
| 70 | - as the USB part of the pic18 is not used, we switched to a pic18f27j13 |
| 71 | - There are now 8 GPIOs available |
| 72 | - a 4th current range (up to 5A) has been added |
| 73 | - The USB/serial part is electrically decoupled from the target board, to avoid |
| 74 | possible ground loop affecting current values. The USB/Serial bridge is |
| 75 | powered from USB, while the pic18 is powered from the load power supply. |
| 76 | - The pic18 can power on or off the load |
| 77 | - the pic18 controls two solid state relays, which can drive e.g. power or |
| 78 | reset switches for the target board. |
| 79 | - the pic18 has one optocoupled input, which can monitor e.g. a power led |
| 80 | from the target board. |
| 81 | - a second serial port is available from the pic18, which can be used to |
| 82 | connect to a TTL-level serial console on the target board, avoiding an |
| 83 | extra serial/USB converter. |
| 84 | |
| 85 | The software also got major reworks. To use the new features, a bidirectionnal |
| 86 | connection is now needed. We also used this opportunity to store calibration |
| 87 | value in the pic18's flash, so we don't need to match a board with its |
| 88 | calibration values on the host's side. |
| 89 | The USB/serial port of the board runs at 921600 bauds. The board accepts the |
| 90 | following commands from the host: |
| 91 | - '''B<n>''' connect to the target's serial port at speed ''n''. If ''n'' is |
| 92 | ommited, use the previously set speed. exit with ''#.'' |
| 93 | - '''C''' get calibration data. |
| 94 | - '''C<string>''' set calibration data string. It is just a string stored |
| 95 | in flash and echo'ed back on request; it's up to the host software to |
| 96 | interpret it. In order to keep the firmware simple, the string has to be |
| 97 | exactly 83 char longs, and can hold only digits, . or spaces. |
| 98 | - '''E''' causes the firmware to exit, resetting the pic18 |
| 99 | - '''Mn''' with ''n'' being 1 or 0: start or stop measures. |
| 100 | - '''Pn''' with ''n'' being 1 or 0: power on or off the load |
| 101 | - '''Rn''' with ''r'' being 1 or 2 and ''n'' being 1 or 0: turn on/off relay |
| 102 | ''r''. |
| 103 | - '''S''' get various input states |
| 104 | |
| 105 | Each command is replied with '''OK''', unless and error occured. |
| 106 | |
| 107 | Host software getting values from the board now has to start measures |
| 108 | with '''M1''' first; it should also send '''M0''' before exiting. |