Mike already answered it anyway but here was my 2c's..


Im also not sure where the 12 bytes comes from, Last time I used EMG with 
BioMOBIUS, the packet size was 14 bytes (10 framing, 4 payload-"2 unused"), 
there were other packet formats with a 12 byte payload but that was Accel+Gyro 
data





Either way

MSP430 CPU is little endian so to get the data from channel 1 (EMG), do 
something like this in your Android app (where buffer[] is the full 
packet/frame of data)

int emg_channel = (int) ((buffer[8] << 8) | ( buffer[7] & 0xFF));



that BioMOBIUS packet format is suboptimal in terms of sending just one sample 
over the air at a time, I would suggest you move to a better packet 
transmission format.

Something like the tinyos-2.x-contrib "BoilerPlate" firmware would be best, 
Mike/Steve?





Regards,

Adrian


From: [email protected] 
[mailto:[email protected]] On Behalf Of mike healy
Sent: Tuesday, April 26, 2011 9:50 AM
To: David Bauschlicher
Cc: [email protected]
Subject: Re: [Shimmer-users] BioMobius EMG Data

Hi David,

I'm afraid that I'm a bit confused by your question.

You say that you can interpret all the bytes within the packet other than the 
EMG data. By this do you mean the BOF, sequence no., timestamp, etc? If so 
interpreting the raw emg data is no different than interpreting the timestamp.

Also are you mixing up bytes and bits in your question? The EMG data is 12 bits 
(as the msp430 has a 12 bit ADC), but it is sent as 2 bytes (16 bits), so the 
upper 4 bits will always be zero. I don't know where you are getting 12 bytes 
from. And yes, this is also sent in little endian format.

So assuming the raw EMG data are bytes 7 and 8 of the packet (indexed from 0), 
then to get the raw ADC value just left shift byte byte8 by 8 places and add it 
to byte 7. I.e.
   rawADC = ((byte8 << 8)  & 0xFF00) + byte7

Take a look at the faq page on the 
shimmer-research.com<http://shimmer-research.com> website for details on how to 
convert the raw ADC values to volts 
(http://www.shimmer-research.com/links/faqs#S9).

Mike

On Tue, Apr 26, 2011 at 12:29 AM, David Bauschlicher 
<[email protected]<mailto:[email protected]>> wrote:
Hello, I am connecting a Shimmer with EMG attachment to an Android phone over 
Bluetooth. I am using the BIOMOBIUS EMG Firmware on the Shimmer. I have 
successfully connected via Bluetooth and I am receiving data. I am able to 
interpret all of the bytes within each packet within each packet except for the 
EMG data itself. It seems like the raw EMG data has a length of 12 bytes, and I 
am confused as to how this can be read. Is it also sent little endian? How can 
I separate the 12 bytes into a numerical value? Thanks.
_______________________________________________
Shimmer-users mailing list
[email protected]<mailto:[email protected]>
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users

-------------------------------------------------------------
Intel Ireland Limited (Branch)
Collinstown Industrial Park, Leixlip, County Kildare, Ireland
Registered Number: E902934

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users

Reply via email to