Hi Sandip, I am not sure that this is the same SPI line as the one used by the raido. Did you check the datasheet / schematics of the mica2?
Miklos On Fri, Oct 15, 2010 at 5:28 PM, Sandip Bapat <[email protected]> wrote: > Hi > > I'm trying to interface an external slave device to an IRIS mote using the > MOSI and SCK lines on the 51-pin connector and a GPIO pin (PortC5) > configured as the slave select (my external device has only 1 data line for > input so MISO is unused). > > I used an oscilloscope to look at the SCK and the MOSI lines and I see the > clock signals being generated (3 8-clock waveforms for the 3 bytes that I'm > trying to write). However, at the same time, the MOSI line stays flat. Just > FYI, the MOSI line is always low while the MISO line is always high. Also, > the pattern stays the same whether or not I actually connect the external > device. Also, the radio stack is not used in my program so there should be > no conflicts (other than the physical wires routed from the SPI lines to the > radio chip) > > I am using the Resource and SpiByte interfaces from the Atm128SpiC component > as follows. > > > event void Timer.fired(){ > > call SpiResource.request(); > > } > > > > event void SpiResource.granted(){ > > post writeSlave(); > > } > > > > void task writeSlave(){ > > > > uint8_t discard; > > > > call SlaveSelect.clr(); //this is portC5 > > > > discard = call SpiByte.write(0xff); > > discard = call SpiByte.write(counter); > > discard = call SpiByte.write(0); > > > > call SlaveSelect.set(); > > call SpiResource.release(); > > > > counter = counter + 32; > > } > > > > Does anyone have any insights on why this does not work? > > > > Thanks > Sandip > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
