def init_hardware(): watchList = [] # load low-level drivers rt.loadrt('hal_bb_gpio', output_pins='816,822,823,824,825,826,914,923,925', input_pins='807,808,809,810,817,911,913') prubin = '%s/%s' % (c.Config().EMC2_RTLIB_DIR, c.find('PRUCONF', 'PRUBIN')) rt.loadrt(c.find('PRUCONF', 'DRIVER'), pru=0, num_stepgens=6, num_pwmgens=6, prucode=prubin, halname='hpg') # Python user-mode HAL module to read ADC value and generate a thermostat output for PWM defaultThermistor = 'semitec_103GT_2' hal.loadusr('hal_temp_bbb', name='temp', interval=0.05, filter_size=1, cape_board='CRAMPS', channels='04:%s,05:%s,02:%s,03:%s' % (c.find('HBP', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_0', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_1', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_2', 'THERMISTOR', defaultThermistor)), wait_name='temp') watchList.append(['temp', 0.1]) base.usrcomp_status('temp', 'temp-hw', thread='servo-thread') base.usrcomp_watchdog(watchList, 'estop-reset', thread='servo-thread', errorSignal='watchdog-error')
def init_hardware(): watchList = [] # load low-level drivers rt.loadrt('hal_bb_gpio', output_pins='807,808,810,819,828,840,841', input_pins='809,831,832,833,835,837,838') prubin = '%s/%s' % (c.Config().EMC2_RTLIB_DIR, c.find('PRUCONF', 'PRUBIN')) rt.loadrt(c.find('PRUCONF', 'DRIVER'), pru=1, num_stepgens=4, num_pwmgens=3, prucode=prubin, halname='hpg') # Python user-mode HAL module to read ADC value and generate a thermostat output for PWM defaultThermistor = 'semitec_103GT_2' hal.loadusr( 'hal_temp_bbb', name='temp', interval=0.10, filter_size=5, cape_board='CRAMPS', r_pu=2185, # measured value of my 2.2k pullup resistor channels='04:%s,05:%s' % (c.find('HBP', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_0', 'THERMISTOR', defaultThermistor)), wait_name='temp') watchList.append(['temp', 0.2]) base.usrcomp_status('temp', 'temp-hw', thread='servo-thread') base.usrcomp_watchdog(watchList, 'estop-reset', thread='servo-thread', errorSignal='watchdog-error')
def init_hardware(): watchList = [] # Python user-mode HAL module to read ADC value and generate a thermostat output for PWM defaultThermistor = 'semitec_103GT_2' hal.loadusr('hal_temp_atlas', name='temp', filter_size=20, channels='00:%s,01:%s,02:%s,03:%s' % (c.find('HBP', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_0', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_1', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_2', 'THERMISTOR', defaultThermistor)), wait_name='temp') watchList.append(['temp', 0.1]) base.usrcomp_status('temp', 'temp-hw', thread='servo-thread') base.usrcomp_watchdog(watchList, 'estop-reset', thread='servo-thread', errorSignal='watchdog-error')
def init_hardware(): watchList = [] # load low-level drivers rt.loadrt('hal_bb_gpio', output_pins='807,819,826,926', input_pins='941') prubin = '%s/%s' % (c.Config().EMC2_RTLIB_DIR, c.find('PRUCONF', 'PRUBIN')) rt.loadrt(c.find('PRUCONF', 'DRIVER'), pru=0, num_stepgens=5, num_pwmgens=0, prucode=prubin, halname='hpg') # Python user-mode HAL module to interface with an I2C gpio extender hal.loadusr('hal_gpio_mcp23017', name='i2c-gpio', bus_id=2, address=32, interval=0.05, delay=2.5, input_pins='A00,A01,A02,A03,A04,A05,A06,A07,B06,B07', output_pins='B00,B01,B02,B03,B04,B05', wait_name='i2c-gpio') watchList.append(['i2c-gpio', 0.1]) # Python user-mode HAL module to interface with an I2C PWM generator hal.loadusr('hal_pwm_pca9685', name='i2c-pwm', bus_id=2, address=67, interval=0.1, delay=2.6, wait_name='i2c-pwm') watchList.append(['i2c-pwm', 0.2]) # Python user-mode HAL module to interface with an I2C ADC and convert it to temperature defaultThermistor = 'semitec_103GT_2' hal.loadusr( 'hal_temp_ads7828', name='i2c-temp', bus_id=2, address=72, interval=0.05, delay=2.7, filter_size=1, channels='00:%s,01:%s,02:%s,03:%s,04:%s,05:none,06:none,07:none' % (c.find('HBP', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_0', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_1', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_2', 'THERMISTOR', defaultThermistor), c.find('EXTRUDER_3', 'THERMISTOR', defaultThermistor)), wait_name='i2c-temp') watchList.append(['i2c-temp', 0.1]) base.usrcomp_status('i2c-gpio', 'gpio-hw', thread='servo-thread') base.usrcomp_status('i2c-pwm', 'pwm-hw', thread='servo-thread') base.usrcomp_status('i2c-temp', 'temp-hw', thread='servo-thread') base.usrcomp_watchdog(watchList, 'estop-reset', thread='servo-thread', errorSignal='watchdog-error')