PDA

View Full Version : Help with IsoPodX timers


Serac
11-15-05, 04:55 AM
I want to get 3 SRF04 sensors working with IsoPodX(IsoMax V0.82).

The problem is that i have also other sensors that need timers so i would like to use GPIO pins for the triggers to save timers for the other sensors..

The trigger pulse needs to be at least 10us, so it will need some delay since just making the PA7 pin to go ON and OFF takes 2us or at least it did when it was the only thing running on the IsoPodX.

The other sensors i need timers for are at the moment two magnetic quadrature pulse generators, one memsic 2125 dual-axis accelerometer and three SRF08 sensors.

Quadrature decoders take 4 timerpins, accelerometer 2 and I2C for SRF08 takes 2 timers so if i can use home and index pin when i have quardrature decoders in use i have 5 pins left since TMRD3 is used by isomax..


Code example for more than 1 SRF04 sensor would be great, i tried to undestand RMDumse's example code in the "SRF04 connections" thread http://www.newmicros.com/discussion/showthread.php?t=1059&highlight=SRF04 but didnt quite get it, doesn't seem to be the whole program...

btw. The comments in the code might cause someone a bit confusion if they dont know where the HEX addresses come from.


Thanks for all the help =),

Serac

nmitech
11-15-05, 09:49 AM
Start from V0.76, TMRD3 is available for user application.

Try these routines on your SRF04,

: PING1
PA1 OFF PA1 ON PA1 OFF ( output a single pulse, low-->high-->low from PA1
TD1 SET-PWM-IN ( set up TD1 as input to measure the pulse
BEGIN
CHK-PWM-IN ?DUP UNTIL
127 / . ." in " ( take the raw number divide by 127
; ( to get the unit in inches

: PING2
PA2 OFF PA2 ON PA2 OFF ( output a single pulse, low-->high-->low from PA2
TD2 SET-PWM-IN ( set up TD2 as input to measure the pulse
BEGIN
CHK-PWM-IN ?DUP UNTIL
127 / . ." in " ( take the raw number divide by 127
; ( to get the unit in inches

Note: Other port pin & timer pin can be used for more SRF04 if needed.

Serac
11-16-05, 02:19 AM
Start from V0.76, TMRD3 is available for user application.

oh, cant believe that when i read the manuals i found only the two plases it was sayd to be used by isomax, when there is clearly much more plases it is sayd to be available for user applications.


Seems to be working fine even if the trigger pulse is faster(2,4us) than 10us that was sayd to be the minimum length of the trigger pulse on the SRF04 manual.

Thanks for the code example!,

Serac