Lis3lv02dq
James Long
Posts: 1,181
Ok.....so I have this new sensor.....Triple Axis....Spi interface. Accelerometer......But I can't seem to talk to it.
Mike or any other person who could help out would be appreciated.....I have attached the datasheet.
Man......I just don't know about this one. It looks like it takes full duplex to talk to this thing. But how do you clock full duplex...and set in and out bit width?
James L
Post Edited (James Long) : 10/24/2006 4:56:03 PM GMT
Mike or any other person who could help out would be appreciated.....I have attached the datasheet.
Man......I just don't know about this one. It looks like it takes full duplex to talk to this thing. But how do you clock full duplex...and set in and out bit width?
James L
Post Edited (James Long) : 10/24/2006 4:56:03 PM GMT
pdf
382K
Comments
I have the LIS3LV02DQ also, has anyone been able to·make it work·with the Propeller?
thanks!
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
The SPI is one of the many half-duplex variations with DO and DI on the same line (which is not worse than I2C, but AFAIK there is no driver for it).
This is not a simple device, so you have to master its features...
I tried (for a little while) then went to SPI and failed.
The I2CObject wants an address of the device. But I couldn't find the address in the doc.
·(or if·it's in the doc then I missed it.)
That and I am not sure how it should all work.
for i2c I tried:
thx
·-Joe
Post Edited (JoMo) : 12/31/2007 4:31:28 AM GMT
Rather it has a CS (Pin 13) which you have to honour.
ReadLocations should work with that address...
Thanks deSilva, (my eyes must be getting old) I will give that a try.
-Joe
I remember now·that, just before I gave up on the·[url=mailto:I2@C]I2C[/url]·approach,·I did try that address with readLocation and
didn't get far.
Here is my·hardware hook-up.
Here is my code.·I can't figure out what I am missing or doing wrong.
The displayed results are:
Any ideas what I am doing wrong?
Thanks a lot.
-Joe
Read data shet on this IC.
It say
I2C/SPI mode selection (1: I2C mode; 0: SPI enabled).
CS pin must be level 1 if you will have I2C mode.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
Sapieha
Aren't I doing that in the main method?
dira[noparse][[/noparse]A_CS]~~
outa[noparse][[/noparse]A_CS]:=1 ' SPI=0 , I2C=1
-Joe
http://www.invensense.com/support/library.html
Happy new year to all propeller heads!
Mike
(a) I did just copied the device address yesterday, but 0011_101b looks funny... It is in fact the device address: but the first left bits of the eight bit value only. Normally such a §device address is presented as 4 bit, as the last three bits are pin programmed.
So use 0011_1010 as address!!!
(b) You stated "non driving" as thrird parameter of the INIT. This is only possible when you have a pull uip at both SDA and SCL Have you?
(c) Start with a call of "devicePresent"
Much luck!
I have tried what you suggested.
a) using 00111010 address works!
Well, I get a 58 (3A) reply to a WHO_AM_I which is correct and a good sign.
But my calls to the out_x,y,z registers only reply 0s. Dang.
b) ok, just did that.
c) Don't know how to do this. Not sure what to send or what register to send to.
Thanks a ton, I'm getting there! I think.
Why do you think I would get a reply from a the whoami but only zeros from the outx,y,z registers?
It's like it's not active but by default I think each axis output is enabled.
Thanks
-Joe
Post Edited (JoMo) : 12/31/2007 8:30:10 PM GMT
But thats BTW.
Well, I think you now have to PROGRAM that beast
Try reading register $20
Then set it (and other registers), that's the fun of it! Still some hours this year...
I moved on to other projects, and never got back to it.
If anyone does get it talking, let me know......I could always try mine again.
Thanks
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother LLC (SMT Assembly Services)
oh.. THAT devicePresent [noparse]:)[/noparse]
sorry, tunnel vision I guess.
Good advice, I will just keep plugging away at it.
Thanks very much for everything.
Cheers
-Joe
James, sorry to hear about your misfortune.
I hope I didn't kill mine too. Can·(could) you get a whoami out of it?
Post Edited (JoMo) : 12/31/2007 8:53:01 PM GMT
Ah ha! The final thing·was that the powerUp bit was not being set! By default this thing is powered down.
Here is my code that works.
deSilva cheers to you·again.· The Forum at it's best.
Much thanks!
-Joe [noparse]:)[/noparse]
Post Edited (JoMo) : 1/11/2008 4:06:13 AM GMT
@James: I doubt that you killed your device. Try exactly what JoMo has done!
James, it's possible you overwrote a calibration parameter which would result in unpredictable behaviour, but upon each power up these are restored to thier original value, so you may not have harmed it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 1/1/2008 1:19:21 AM GMT
I'll try to duplicate your results when I get the chance.....I'm currently up to my neck with the New SMT service coming online the next few months.
deSilva ( and Paul )
The datasheet does state if you write into restricted areas it is possible to kill the chip. I think I had the address to write the power up sequence wrong when I first started. I figured out later this was a restricted area. I will however try JoMo's code to see if it infact still works, but I tried quite a few times and never could get any useful results from it.
Thanks all,
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother LLC (SMT Assembly Services)
I am a beginner for BASIC Stamp, and can you show me if and how I can modify your code for me to reading LIS3LV02DQ USING basic stamp, instead of propeller? Or can you modify and show me?
Thanks,
Caleb
I just noticed something when I was playing with my LIS3LV02DQ
You have your highs and lows mixed up in relation to the Bytes.
Just thought I would say something.
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother LLC (SMT Assembly Services)
1. I have propeller demo boards, and it seems the code from Jomo seems not matched with this. My demo boards only have p0~P7. can I just simply change p10, p11, p12 in the code to pin 1, 2, 3 in my demo board, then modify the code accordingly?
2. I don't have OLED, and try to use TV for seeing the output. It seems not easy as I am beginner. Does anyone can help to modify or give me comments how I can modify the Jomo's code for LED display to TV display code?
Thanks,
Caleb
I modified the code for Hyper terminal on the PC if you want the code. I do not have a TV or VGA convenient for use....so I use Hyper terminal a lot. I have thought of using the new Prop Terminal....but didn't ever get that far.
I used pins 5,6, and 7 on the demo board for the connection.
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother LLC (SMT Assembly Services)
Thanks for the help. I could compile, but I couldn't see any debug like terminal opened. Did I miss something to make Hyper terminal work? I don't have any idea how to use the hyper terminal, can you comment me?
Thanks,
Cheol
Hyper terminal is not an automatic opening device, because it is just a general communication terminal.· You will need to get the propeller programmed and then open hyper terminal (usually under accessories>communications)
You will need to configure a new connection with these settings.
When asking how to connect choose the com port that the Propeller tool was using to program with.
The following will work with the files I sent:
460800 Bits per second
8 Data bits
parity None
Stop Bits 1
flow control hardware.
After you do this......(if the propeller is running) it will start communicating with the propeller.
These are all basic things......if you are new and using the propeller.....you will have a very steep learning curve.
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother LLC (SMT Assembly Services)