hi hristijan,

you're looking at the application. what you want to do will require you do dig deeper to understand what's really happening when the app makes those calls.

i suggest that you look in the code that implements physical media part of the filesystem calls, which is in the platform code under shimmer/chips/sd. if you look at the sd driver, you'll see that it manipulates the usart to run in spi mode.

if you look at the magnetometer driver -- in shimmer2/chips/hmc5843 -- you'll see that it configures the usart to run in i2c mode.

what you have to do is figure out how to do both in the same app, so you will probably need an understanding of how each works. yes, you will disable and enable each of the two buses; you don't need to unmount the filesystem, which sits on top of the sd. you're operating a couple of layers beneath the filesystem.

it will probably help to look at both the usart (spi) and i2c implementations, which are spread between tos/chips/msp430/usart and tos/platforms/shimmer/chips/msp430. look at what happens when you call initspi and the i2c enablebus.

-steve

On 01/09/2012 06:44 AM, Hristijan Gjoreski wrote:
Hi Steve,

About calling the full init routines...
I tried to look into the code in similar applications, but I have
problems understanding it.
For example in JustFatLogging application... The only thing that is done
for the initialization of the SD card is FatFs.mount () routine.

According to that, I tried by calling the routines written bellow
(appropriately), but it is not working.
FatFs.mount ()
FatFs.unmount ()
enableBus ()
disableBus ()

If this isn't the correct way of doing it, what is it?
Is it by calling /initspi()/?

Regards,
Hristijan

On 06-Jan-12 17:02, steve ayer wrote:
hi Hristijan,

you'll have to reset the bus for each target device transition. so,
run the full spi init routine when you go to the sd card, and run the
full i2c initialization when you use the magnetometer.

if you dig down into the msp430 usart bus driver layers, you'll see
that each mode completely clears the bus in preparation for its use.

-steve

On 01/06/2012 10:24 AM, Hristijan Gjoreski wrote:
Hello,

I have additional sensor attached on the inside connector of the
Shimmer. The simple application that reads the data from this sensor and
sends through Bluetooth works perfectly.

Now I would like to combine this application with JustFatLogging
application.
I know that the SD card and this additional sensor use the same bus. I
tried to do something like it is done for the Magnetometer data.

Thus, I tried with enabling and disabling this bus before each reading
from the additional sensor.

HplMsp430I2C.setModeI2C(&msp430_i2c_my_config);

HplMsp430I2C.disableI2C();


But this doesn't work. After the first reading from the additional
sensor, the sensor gets stuck.

How can I make the additional sensor and the SD module work together?

Regards,
Hristijan Gjoreski



_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users



--
Hristijan Gjoreski
Department of Intelligent Systems
Jozef Stefan Institute
Jamova cesta 39, SI-1000 Ljubljana, Slovenia

Email:[email protected]
Web page:http://dis.ijs.si/hristijan
Phone: +386 1 477 3812



_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users

Reply via email to