Targetting registers on slave using basic stamp
HaiTramNinDong
Posts: 2
Does anyone know how to send data specific to the register on a slave using a BS2?
I have this accelerometer that has embedded registers. Its user manual has clear instructions of the address to target to read these registers using a external microcontroller and write information on these registers. However, I am pretty much stuck programming this as I cannot target the specific registers. I know that there are ways to communicate with the accelerometer using the BS2, like shiftin, shiftout. But, I cannot seem to find a way to send information to registers specifically as these only target pins.
Better yet, does anyone know a way that I can not use these registers?
Pray tell me if you have the answer, I am doing a project using BS2 and I am really new to BASIC programming.
I have this accelerometer that has embedded registers. Its user manual has clear instructions of the address to target to read these registers using a external microcontroller and write information on these registers. However, I am pretty much stuck programming this as I cannot target the specific registers. I know that there are ways to communicate with the accelerometer using the BS2, like shiftin, shiftout. But, I cannot seem to find a way to send information to registers specifically as these only target pins.
Better yet, does anyone know a way that I can not use these registers?
Pray tell me if you have the answer, I am doing a project using BS2 and I am really new to BASIC programming.
Comments
Vaclav
·
I am not sure of what code I should post, but here's the part where I think it can send the instructions.
SHIFTOUT SDO,SCLK,MSBFIRST,[noparse][[/noparse]YOUT_L] YOUT_L bring the read address of the Y output
SHIFTIN Y,SCLK,MSBPRE,[noparse][[/noparse]ACCY]
I am just shifting out the address of the Y-axis output and hoping that it will give me a response. I think this is wrong though.
Thanks for the reply.