Klemen Ozebek wrote:
> there is my hal file
> 
> # hostmot2 driver
> loadrt hostmot2 debug_idrom=1 debug_module_descriptors=1
> debug_pin_descriptors=1 debug_modules=1

You probably dont need all those debug flags enabled.  It wont hurt 
anything, but it will spew a bunch of stuff you dont care about to the 
logs at startup.


> # load low-level driver
> loadrt hm2_pci config="firmware=hm2/5i20/SVST8_4.BIT num_encoders=4
> num_pwmgens=4 num_stepgens=0"
> 
> #load threads
> loadrt threads name1=tt period1=10000 name2=tt2 period2=1000000000

10,000 ns is a *very* fast thread.  Below you add a lot of stuff to it, 
so i'm guessing your machine becomes pretty unresponsive when you run 
this hal file.  100,000 or 1,000,000 is more typical.


> #naložimo pyvcp ter počakamo da se le ta zažene
> 
> loadusr -Wn iotest pyvcp -c iotest iotest.xml
> 
> addf hm2_5i20.0.read tt
> addf hm2_5i20.0.write tt
> 
> addf hm2_5i20.0.read_gpio tt
> addf hm2_5i20.0.write_gpio tt
> addf hm2_5i20.0.pet_watchdog tt

Since you have the .read and .write functions in this thread, there is 
no need to have the .read_gpio and .write_gpio functions.  .read reads 
everything and .write writes everything, including gpios.  The 
.read_gpio and .write_gpio functions were added so that people who 
wanted to read *just* the gpios could do that (for example, for probing 
in a fast thread).


> setp hm2_5i20.0.watchdog.timeout_ns 10000000

The longest watchdog timeout is just over 4 seconds.  1 second should be 
plenty.


(snip the encoder stuff)
> # DACs
> 
> setp hm2_5i20.0.pwmgen.00.output-type 3
> setp hm2_5i20.0.pwmgen.01.output-type 3
> setp hm2_5i20.0.pwmgen.02.output-type 3
> setp hm2_5i20.0.pwmgen.03.output-type 3

Selecting PDM mode.


> setp hm2_5i20.0.pwmgen.00.scale 1
> setp hm2_5i20.0.pwmgen.01.scale 1
> setp hm2_5i20.0.pwmgen.02.scale 1
> setp hm2_5i20.0.pwmgen.03.scale 1

The .scale parameter determines how the .value pin is converted into a 
PWM/PDM duty cycle:  dc = value / scale.  The effective range of duty 
cycle is from -1 to +1.

So with this configuration, any value on the .value pin greater than 1.0 
will result in 10V output from the 7i33.  A value of 0.5 should result 
in 5V being output, etc.

Is that not what you're seeing?


-- 
Sebastian Kuzminsky
any sufficiently analyzed magic is indistinguishable from science

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to