All pastes #2071754 Raw Edit

parport.hal-jcizek

public text v1 · immutable
#2071754 ·published 2011-05-29 22:56 UTC
rendered paste body
############################# Parallel Ports ##############################################

# Load Driver for Two Parallel Ports, one for Breakout Board, other for Plasma Torch Height Control
#loadrt hal_parport cfg="0xa400 0xac00 in"
loadrt hal_parport cfg="0x378 0xccc8 in"
loadrt debounce cfg=5

# Connect both Paralell Ports to Threads for Read / Write
addf parport.0.read base-thread 1
addf parport.0.write base-thread -1
addf parport.1.read base-thread 1
addf parport.1.write base-thread -1
addf debounce.0 base-thread

# Invert pins to make motors move in right direction
setp parport.0.pin-06-out-invert 1
setp parport.0.pin-07-out-invert 1
setp parport.1.pin-01-out-invert 1
setp debounce.0.delay 30

# Hook up the step and dir signals to the parport pins
# Axis A and Y are the same axis but different motors 
net StepX stepgen.0.step => parport.0.pin-02-out
net StepY stepgen.1.step => parport.0.pin-04-out
net StepZ stepgen.2.step => parport.0.pin-06-out
#net StepA stepgen.3.step => parport.0.pin-05-out
net DirX stepgen.0.dir => parport.0.pin-03-out
net DirY stepgen.1.dir => parport.0.pin-05-out
net DirZ stepgen.2.dir => parport.0.pin-07-out
#net DirA stepgen.3.dir => parport.0.pin-09-out

# Hook up limit and home switches, each axis shares a common pin for homing, limit min and limit max
net deb-LimitX debounce.0.0.in <= parport.0.pin-15-in-not
net LimitX <= debounce.0.0.out
net LimitX => axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in
net deb-LimitY debounce.0.1.in <= parport.0.pin-10-in-not
net LimitY <= debounce.0.1.out
net LimitY => axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
# Z axis Limit switch handled by THC, see thc.hal
#net LimitZ parport.0.pin-13-in => axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
#net LimitA parport.0.pin-15-in-not => axis.3.neg-lim-sw-in axis.3.pos-lim-sw-in axis.3.home-sw-in