MMA7455 Accelerometer Assembly I2C Driver - Guidance Needed
bradharper
Posts: 64
I'm working to piece together an assembly based MMA7455 I2C driver and I've hit a standstill. This code is a rehash of Ray's SPIN version of the driver, and an assembly version of the Basic I2C driver from OBEX.
I've structured the routines according to the MMA datasheet and in mimicry of the SPIN variant, but I've yet to get any successful sensor readings.
I've attached code that contains both the SPIN (working) and assembly (non-working) variants for anyone who has the time/motivation to glance over it for any obvious issue that may stand out. For those who actually care to run the code, just edit scl_bit, and sda_bit in the DAT section to your preferred SCL/SDA pins respectively. The SPIN interaction can be enabled by un-commenting the two lines indicated, and commenting out the cognew invocation.
For my usage, I just wanted the driver to constantly poll XYZ in 8-bit (2G) mode as fast as possible, and update three hub variables on each read. The code seems to fail on the first attempt to read from the IC, although, as best I can tell, the writes return 0-ACK as expected.
I'm inexperienced in debugging assembly, and would also appreciate any guidance, suggestions, or insights for effectively doing so.
Any insights most appreciated.
I've structured the routines according to the MMA datasheet and in mimicry of the SPIN variant, but I've yet to get any successful sensor readings.
I've attached code that contains both the SPIN (working) and assembly (non-working) variants for anyone who has the time/motivation to glance over it for any obvious issue that may stand out. For those who actually care to run the code, just edit scl_bit, and sda_bit in the DAT section to your preferred SCL/SDA pins respectively. The SPIN interaction can be enabled by un-commenting the two lines indicated, and commenting out the cognew invocation.
For my usage, I just wanted the driver to constantly poll XYZ in 8-bit (2G) mode as fast as possible, and update three hub variables on each read. The code seems to fail on the first attempt to read from the IC, although, as best I can tell, the writes return 0-ACK as expected.
I'm inexperienced in debugging assembly, and would also appreciate any guidance, suggestions, or insights for effectively doing so.
Any insights most appreciated.
Comments
Anyone who has an MMA7455 available for paid consulting to get this code up and running? I'd guess it's very close to working, but just needs someone more experienced in assembly and debugging than myself to have the insight to complete it.
You ought to post this in the Propeller Forum, "PASM & MMA7455 Accelerometer".
It'll just get buried over here.
-- PJA --