Hi,
I am using Micaz mote,MDA320 Data Acquisition board and Mib520
programming board of crossbow. For my application I have to set any three
Dio pins of MDA320 board to low. I used DioC component and Dio interface in
my program.
I set modes of Dio0,Dio1,Dio2 pins as DIG_OUTPUT in DioM.nc.
In StdControl.start() I gave the following lines:
command result_t StdControl.start() {
call DioControl.init();
call DioControl.start();
call Dio0.low();
call Dio1.high();
call Dio2.high();
return SUCCESS;
}
But my code is not working.All the pins are showing high only.If I set only
one pin to low its working. What modifications should I have to made to set
all 3 pins to low
--
Regards,
G.Dhivya
On Fri, Apr 18, 2008 at 11:06 PM, Brandon Arnold <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> There's been a recurring question in tinyos-help concerning the use of
> digital I/O ports on the MDA3x0 DAQ boards. At this time,
> set_digital_output() is a command that's referenced in Sample.nc, but is as
> of yet unimplemented in SamplerM.nc (the function is empty). One can get a
> good idea of how to bring a pin high or low by reading through the
> implementation of the Relay code, which uses the Dio interface. The only
> difference is that Dio.setparam(DIG_OUTPUT) must be called for digital
> output ports before they can be set using the Dio.low(), Dio.high(), or
> Dio.Toggle() functions (notice the caps on Toggle(), high(), and low().)
>
> However, there is an issue when calling the Toggle() function on the Dio
> interface. The use of Toggle() results in a short toggling and re-toggling
> on the chosen channel, which looks like a pulse. As it stands in DioM.nc,
> the global variables io_value and i2c_data are intended to hold,
> respectively, the latest data read from and written to the pins. I suspect
> there is a race occurring between the "i2c_data=io_value;" line in
> set_io_toggle() and the "io_value=i2c_data;" line in readPacketDone().
>
> Fleshing out the set_digital_output() command in Sample.nc would be simple
> enough by doing a switch statement on the enums defined as SET_HIGH,
> SET_LOW, and SET_TOGGLE, and calling the appropriate function. However, it
> seems the only way to set the mode of a digital port to DIG_OUTPUT is to
> call the Sample.getSample() command. Since the naming could cause some
> confusion, I request removing the set_digital_output command from the Sample
> interface altogether.
>
> Thank you,
> Brandon Arnold
>
--
G.Dhivya
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help