miniHV programming, configuration & testing procedure ====================================================== version 1.0, 17 Aug 2011, Henk Boterenbrood 0. get a 'virgin' miniHV module from the production batch, not yet mounted in its box to enable access to its programming connector. Programming the Bootloader --------------------------- 1. Connect the miniHV to the miniHV powersupply module and the CAN bus to your PC; power the module. (CAN bus terminations are irrelevant at this point). 2. Connect the (Olimex) AVR programmer (STK500 compatible) to the miniHV programming connector via the custom-made cable (see the pictures in minihv-programmer-connection-1.jpg and minihv-programmer-connection-2.jpg). 3. Start up program AVRstudio (available from ATMEL) and click on the programmer button or select 'connect to the programmer' from the menus. 4. In the 'Main' tab select the AT90CAN128 device; optional: click on 'Read Signature' to check if there is contact with the micro, and whether the correct micro is installed (see the screenshot shown in miniHV-AT90CAN128.jpg). 5. In 'Fuses' tab set the fuses according to the screenshot shown in miniHV-AT90CAN128-fuses.jpg and click 'Program'. 6. In the 'Program' tab select the proper file, called ATCANBL-128.hex containing the 'Bootloader' executable, and click 'Program' (see screenshot miniHV-AT90CAN128-program.jpg); this programs the 'Bootloader' into the miniHV module, which enables us from now on to upload application code via the CAN-bus. 7. Unplug the programmer connector and terminate the miniHV CAN-bus properly (both branches). Programming the MiniHV application code ---------------------------------------- 8. Start up program ELMBloader-NI (for Nat.Instr. CAN interface) or ELMBloader-KVASER (for Kvaser CAN interface), open a CAN-port if not yet opened (port 1 is opened automatically, if available), and select 'NodeID' 31. (See the screenshot shown in miniHV-program-application.jpg). 9. Click 'Program' and select the hex-file (MiniHV232.hex), containing the MiniHV application executable, and confirm you want to program the 'ELMB' with NodeID 31; if all this goes well the Bootloader and miniHV CAN-bus interface work. 10. On the miniHV the green LED should come on, and the yellow LED periodically flashes briefly (indicating a 'problem' with the high-voltage, in this case because the module has not been calibrated yet). Configure serial number and CAN address ---------------------------------------- 11. Start up program BATtest-NI or BATtest-KVASER, and open a CAN-port. 12. Select the current NodeID (default 31). 13. In the 'BATCAN' box fill in a Serial Number (4 chars) that looks like "Mxxx", with "xxx" a number (to date 17 Aug 2011, we have produced modules up to serial number "M025"); the entered serial number automatically results in an automatically selected 'New NodeID'; this can be modified manually if necessary. 14. Click 'Configure'; this writes Serial Number and new NodeID to the miniHV module, and resets the module so that it uses the newly configured NodeID. (NB: ignore other stuff in this application window: it was made for another kind of CANopen module) (See the screenshot shown in miniHV-config-serialnr-nodeid.jpg). Acceptance test ---------------- 15. Disconnect from the miniHV the cable connected to the terminator, you should see the red LED on the miniHV flash once; this indicates that the interrupt connected to the 60V supply works; reconnect the cable. 16. Start up program MiniHVui-NI or MiniHVui-KVASER, set 'NodeID' to the address given to the module and open the CAN port connected to the module; it will automatically start reading out various items from the miniHV module and periodically its ADC inputs: - check if the "CW board ID" is there - check if the temperature (in millidegrees) looks okay and makes sense - check if the other ADC inputs provide reasonable readings - check if 'HV actual' (voltage) and 'Curr actual' (current) are 0 or close to 0 - connect a load to the miniHV and/or a voltmeter - set DAC or HV to some value, and see if ADC readings change in the expected way; voltage and current should increase (although the readings in V and A are of course not yet calibrated).