The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Day: April 6, 2021

  • Kicad-to-HAL: Charge Pump Driver

    Kicad-to-HAL: Charge Pump Driver

    Just to see if all the conversion machinery hung together, I added the PWM component for the Mesa 5I25 card to the Kicad-to-HAL library:

    PWM Charge Pump driver - schematic
    PWM Charge Pump driver – schematic

    The top symbol provides the reference stem for the per-group frequency controls and the second provides the stem for the per-PWM controls.

    It requires conjuring one PWM in the FPGA:

    PWM Charge Pump driver - LoadRT config
    PWM Charge Pump driver – LoadRT config

    The corresponding lines in the HAl file:

    setp hm2_5i25.0.pwmgen.00.output-type 1		# parameter.116
    setp hm2_5i25.0.pwmgen.00.value 0.5		# parameter.115
    setp hm2_5i25.0.pwmgen.pwm_frequency 10000		# parameter.114
    
    … snippage …
    
    net Machine-Is-On <= halui.machine.is-on => and2.13.in1 hm2_5i25.0.pwmgen.00.enable
    

    And then it just worked:

    Mesa 5I25 10 kHz PWM output waveform
    Mesa 5I25 10 kHz PWM output waveform

    It’s not useful with the Sherline driver box, but I find it much easier to contemplate simple schematics than to puzzle out HAL code.