MMA7455 Accelerometer/Basic Stamp 2 Troubles
Hi All,
I'm new to the Basic Stamp 2 module and the programming with it. To work around this, I am attempting to setup the accelerometer to read out the XYZ coordinates of my Board of Education as I change its spatial position. The demo code from the MMA7455 site is NOT working out too well for me: http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/mma7455/List/0/SortField/4/ProductID/585/Default.aspx.
I have followed the instructions at the top of the demo:
How I interpret this: I have probed VIN - it is getting 5.04V, VSS is getting 4 mV. P0 is connected to the CS pin, P1 is connected to the DATA pin, and P2 is connected to the CLK pin. Is there some other issue that I am not seeing here? Does something else need to be set up?
Thank you for all help in advance - most appreciated.
- ButterflyKittens97
I'm new to the Basic Stamp 2 module and the programming with it. To work around this, I am attempting to setup the accelerometer to read out the XYZ coordinates of my Board of Education as I change its spatial position. The demo code from the MMA7455 site is NOT working out too well for me: http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/mma7455/List/0/SortField/4/ProductID/585/Default.aspx.
I have followed the instructions at the top of the demo:
'How TO Use:
' o With power initially off, connect VIN TO 5VDC (the same voltage
' powering the sTAMP). Connect GND TO Vss.
'
' o Connect P0, P1, AND P2 ON the Stamp directly TO the CS, DATA, AND CLK
' pins ON the Digital 3-Axis Accelerometer module.
'
' o Power ON the Stamp. Download AND run this code ON the Stamp.
How I interpret this: I have probed VIN - it is getting 5.04V, VSS is getting 4 mV. P0 is connected to the CS pin, P1 is connected to the DATA pin, and P2 is connected to the CLK pin. Is there some other issue that I am not seeing here? Does something else need to be set up?
Thank you for all help in advance - most appreciated.
- ButterflyKittens97

Comments
' {$STAMP BS2} ' {$PBASIC 2.5} 'How TO Use: ' With power initially off, connect VIN TO 5VDC (the same voltage ' powering the sTAMP). Connect GND TO Vss. ' ' Connect P0, P1, AND P2 ON the Stamp directly TO the CS, DATA, AND CLK ' pins ON the Digital 3-Axis Accelerometer module. ' ' Power ON the Stamp. Download AND run this code ON the Stamp. ' ' Acceleration values will stream back TO the computer, AND can be viewed ' on the DEBUG terminal. ' ' The offset values FOR each axis can be calibrated by placing the device ' ON a flat horizontal surface AND adjusting the corresponding constants ' UNTIL the values FOR each axis READ (WHILE in 2g mode): ' X = 0 (0g) ' Y = 0 (0g) ' Z = 63 (+1g) ' The values already present are FOR demonstration purposes AND can ' be easily modified TO fine tune your own device. Keep in mind that ' the offset values are in 1/2 Bit increments, so FOR example, TO offset ' an axis by 5 counts, the corresponding offset would need TO be increased ' by a value of 10. See the MMA7455L device datasheet FOR more ' information. 'Offset values FOR each axis: XCal CON 25 'VAR Word YCal CON 50 'VAR word ZCal CON 0 'VAR Word CLKPin PIN 0 ' Clock Pin DATAPin PIN 1 ' Data Pin CSPin PIN 2 ' Chip Select PinDid switching the connections to P0 and P2 help fix the issue? I am trying to figure this one out - no luck...
Thanks,
- ButterflyKittens97
Edit: Backwards in the directions at the top of the BS2 demo programs for P0-P2 connections only.
Thanks for all help in advance - most appreciated!
- ButterflyKittens97
DEBUG CRSRXY,50,3, SDEC XAccel, " ", 'Display the RAW X, Y, and Z Accelerometer values CRSRXY,50,4, SDEC YAccel, " ", CRSRXY,50,5, SDEC ZAccel, " "]