Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Triple Axis Accelerometer Breakout - LIS3LV02DQ help plz!

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
11 postsPage 1 of 1
11 postsPage 1 of 1

Triple Axis Accelerometer Breakout - LIS3LV02DQ help plz!

Post by Sazabi » Wed Oct 01, 2008 9:18 pm

Post by Sazabi
Wed Oct 01, 2008 9:18 pm

I need you help, please!
I got this board,Logic Level Converter from Sparkfun, i put 3.3V on CS pin on board, soldered 2kOm resistors in SDA and SCL line(before level converter), put signal thrught level converter,i'm using I-Bot's code for this from I2CC patch for c-3024. But all i receive is 1 on all axis. Why this could happen?
I need you help, please!
I got this board,Logic Level Converter from Sparkfun, i put 3.3V on CS pin on board, soldered 2kOm resistors in SDA and SCL line(before level converter), put signal thrught level converter,i'm using I-Bot's code for this from I2CC patch for c-3024. But all i receive is 1 on all axis. Why this could happen?
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am

Post by i-Bot » Wed Oct 01, 2008 9:39 pm

Post by i-Bot
Wed Oct 01, 2008 9:39 pm

I am travelling and not back home till Friday, so I can't post my circuit or access the source.

Though SCL is normally bidirectional and would best have a FET for level conversion, you could use the voltage divider from the SCL output from the 5V C3024 to the 3.3V LISL. I you do that ,then don't add a pullup to the LISL side else you will never pull the LISL low. I never look at SCL in my code, if the LISL does pull the clock low to stretch it, this is slow compared to the timing of the C3024. I can't remember if I tristate SCL, so if a pullup is required it should be on the 5V side of the voltage divider, or use one FET channel as that has pullups already.

SDA is bidirectional and must go through a FET converter. HV side to C3024 and LV side to LISL.


Is that how you have it configured ?

Sorry, but travel has stopped me looking at HMI too.
I am travelling and not back home till Friday, so I can't post my circuit or access the source.

Though SCL is normally bidirectional and would best have a FET for level conversion, you could use the voltage divider from the SCL output from the 5V C3024 to the 3.3V LISL. I you do that ,then don't add a pullup to the LISL side else you will never pull the LISL low. I never look at SCL in my code, if the LISL does pull the clock low to stretch it, this is slow compared to the timing of the C3024. I can't remember if I tristate SCL, so if a pullup is required it should be on the 5V side of the voltage divider, or use one FET channel as that has pullups already.

SDA is bidirectional and must go through a FET converter. HV side to C3024 and LV side to LISL.


Is that how you have it configured ?

Sorry, but travel has stopped me looking at HMI too.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Sazabi » Wed Oct 01, 2008 9:59 pm

Post by Sazabi
Wed Oct 01, 2008 9:59 pm

Actually, i didn't know where to put pullups after c3024 or after lvl converter. There are some resistors in sparkfun lvl converter scheme,but those don't look like pullups to me(about 10kOm each). As in application notes for accel, pullups needed to connect device. i use channel 1 tx on lvl conv for SDA (to accel) and rx for SCL (from Accel).
So yes, i guess i got scheme as you wrote, I-Bot.
I'll try pullup after lvl converter before controller and see what will happen.
Actually, i didn't know where to put pullups after c3024 or after lvl converter. There are some resistors in sparkfun lvl converter scheme,but those don't look like pullups to me(about 10kOm each). As in application notes for accel, pullups needed to connect device. i use channel 1 tx on lvl conv for SDA (to accel) and rx for SCL (from Accel).
So yes, i guess i got scheme as you wrote, I-Bot.
I'll try pullup after lvl converter before controller and see what will happen.
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am

Post by i-Bot » Thu Oct 02, 2008 8:09 am

Post by i-Bot
Thu Oct 02, 2008 8:09 am

SCL is output clock from the C3024 to LISL. SDA is bidirectional in/out for data.
SCL is output clock from the C3024 to LISL. SDA is bidirectional in/out for data.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Sazabi » Thu Oct 02, 2008 2:14 pm

Post by Sazabi
Thu Oct 02, 2008 2:14 pm

Yes, it is. But on the lvl converter diagram there are 2 channels,each have rx and tx. i use channel 1(tx from 3.3V device-accel here, rx to 3.3V device), tx for SDA line and rx for SCL. Looks like i can't send commands to accel because of that TX, i guess it's not bidirectional (if so,they wouldn't mind to show the direction). Haven't tried to move pullups yet,so first ill do that,and than i'll try to use tx from channel 1(3.3V device to 5V device) and rx from channel 2(5V device to 3.3V device) for SDA line and see what's gonna happen.

So i connected all stuff,added pullups(2kOm) after controller,before lvl converter, but still no effect...sad

Removed pullups-no effect(

P.S. I-Bot, any plans on addint I2C port to new robonova firmware(goes with Robobasic v2.72)?
Yes, it is. But on the lvl converter diagram there are 2 channels,each have rx and tx. i use channel 1(tx from 3.3V device-accel here, rx to 3.3V device), tx for SDA line and rx for SCL. Looks like i can't send commands to accel because of that TX, i guess it's not bidirectional (if so,they wouldn't mind to show the direction). Haven't tried to move pullups yet,so first ill do that,and than i'll try to use tx from channel 1(3.3V device to 5V device) and rx from channel 2(5V device to 3.3V device) for SDA line and see what's gonna happen.

So i connected all stuff,added pullups(2kOm) after controller,before lvl converter, but still no effect...sad

Removed pullups-no effect(

P.S. I-Bot, any plans on addint I2C port to new robonova firmware(goes with Robobasic v2.72)?
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am

Post by i-Bot » Fri Oct 03, 2008 7:06 pm

Post by i-Bot
Fri Oct 03, 2008 7:06 pm

I just wired up a couple of BSS138 identical to the TX channels of the Sparkfun board with 10K resistors.

Also a 3.3V regulator from the PWM0 5V pin. The 3.3V regulator supplies the LSIL VDD, LISL CS and the converter LV supply. The converter HV is connected to the PWM0 5V supply. Gnd is common to C3024, regulator and LISL

PWM0 is connected to one channel TX_HV and TX_LV goes to LSIL SDA. The PWM1 is connected to the other channel TX_HV and this channel TX_LV goes to SCL.

Loaded I2CC flash and lsil test prog and this works fine. Suggest you try this. No other pullups used.

I didn't even know about 2.7 firmware. I downloaded it and the changes are fairly small. I should be able to do an I2C for it. Just need to understand what other changes and fixes they made first.
I just wired up a couple of BSS138 identical to the TX channels of the Sparkfun board with 10K resistors.

Also a 3.3V regulator from the PWM0 5V pin. The 3.3V regulator supplies the LSIL VDD, LISL CS and the converter LV supply. The converter HV is connected to the PWM0 5V supply. Gnd is common to C3024, regulator and LISL

PWM0 is connected to one channel TX_HV and TX_LV goes to LSIL SDA. The PWM1 is connected to the other channel TX_HV and this channel TX_LV goes to SCL.

Loaded I2CC flash and lsil test prog and this works fine. Suggest you try this. No other pullups used.

I didn't even know about 2.7 firmware. I downloaded it and the changes are fairly small. I should be able to do an I2C for it. Just need to understand what other changes and fixes they made first.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Sazabi » Fri Oct 03, 2008 8:09 pm

Post by Sazabi
Fri Oct 03, 2008 8:09 pm

Tada! It works, thanks I-Bot! SCL pin resoldered on TX pin from RX pin. I'm not quite clear with I2C protocol, keep learning it. And that lvl converter confused me a bit with that tx/rx directions. Still don't know what rx channel there for(without mosfet).
Tada! It works, thanks I-Bot! SCL pin resoldered on TX pin from RX pin. I'm not quite clear with I2C protocol, keep learning it. And that lvl converter confused me a bit with that tx/rx directions. Still don't know what rx channel there for(without mosfet).
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am

Post by i-Bot » Mon Oct 06, 2008 9:31 pm

Post by i-Bot
Mon Oct 06, 2008 9:31 pm

I just built a new patch of the i2cc for version 2.7 firmware. Works OK with accelerometer.

Will do some more tests, but don't expect problems. Robobasic 2.72 accepts it as a 2.7 build.
I just built a new patch of the i2cc for version 2.7 firmware. Works OK with accelerometer.

Will do some more tests, but don't expect problems. Robobasic 2.72 accepts it as a 2.7 build.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Sazabi » Tue Oct 07, 2008 4:22 am

Post by Sazabi
Tue Oct 07, 2008 4:22 am

Great! Thnx, i-Bot!
Great! Thnx, i-Bot!
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am

Post by i-Bot » Tue Oct 07, 2008 5:55 pm

Post by i-Bot
Tue Oct 07, 2008 5:55 pm

I put the I2C patched version for MR-C3024F Version 2.7 here.
http://robosavvy.com/Builders/i-Bot/c3024fi2c.zip
You will need to load it with Roboflash as before.

This is the version I am now using. It has the I2C code, 9600 LCD, POKE fix, and phase 3 of the servo disabled for speed increase.

I did make a change to one of my Robobasic programs, because running from Flash was too fast for my PS2 controller. It worked fine from EEPROM, so I added a 50mS delay in my program and it was fixed.
I put the I2C patched version for MR-C3024F Version 2.7 here.
http://robosavvy.com/Builders/i-Bot/c3024fi2c.zip
You will need to load it with Roboflash as before.

This is the version I am now using. It has the I2C code, 9600 LCD, POKE fix, and phase 3 of the servo disabled for speed increase.

I did make a change to one of my Robobasic programs, because running from Flash was too fast for my PS2 controller. It worked fine from EEPROM, so I added a 50mS delay in my program and it was fixed.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Sazabi » Tue Oct 07, 2008 7:35 pm

Post by Sazabi
Tue Oct 07, 2008 7:35 pm

Great! Thanks! Just flashed it, not yet tried
Great! Thanks! Just flashed it, not yet tried
Sazabi
Savvy Roboteer
Savvy Roboteer
Posts: 73
Joined: Mon Jan 07, 2008 8:57 am


11 postsPage 1 of 1
11 postsPage 1 of 1