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

I2C

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

I2C

Post by subpilot » Thu Mar 09, 2006 7:09 am

Post by subpilot
Thu Mar 09, 2006 7:09 am

I see that the 3024 I2C clock and data lines are available on a header. Does anybody have clue if it's going to be supported in Robobasic?
I see that the 3024 I2C clock and data lines are available on a header. Does anybody have clue if it's going to be supported in Robobasic?
subpilot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 146
Joined: Sat Feb 25, 2006 1:00 am
Location: Lake Arrowhead, Ca,USA

Post by subpilot » Wed Mar 15, 2006 11:44 pm

Post by subpilot
Wed Mar 15, 2006 11:44 pm

Just found out that page 47 of the Users manual has a little code sample of I2C. Not great but will see how it works. You have to bit bang the port.
Just found out that page 47 of the Users manual has a little code sample of I2C. Not great but will see how it works. You have to bit bang the port.
subpilot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 146
Joined: Sat Feb 25, 2006 1:00 am
Location: Lake Arrowhead, Ca,USA

Post by Pev » Thu Mar 16, 2006 9:55 am

Post by Pev
Thu Mar 16, 2006 9:55 am

subpilot wrote:Just found out that page 47 of the Users manual has a little code sample of I2C. Not great but will see how it works. You have to bit bang the port.


Hmm think my reading ability is failing me lol. If you have any luck could you post a code snippet. Cheers

Pev
subpilot wrote:Just found out that page 47 of the Users manual has a little code sample of I2C. Not great but will see how it works. You have to bit bang the port.


Hmm think my reading ability is failing me lol. If you have any luck could you post a code snippet. Cheers

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by subpilot » Thu Mar 16, 2006 6:38 pm

Post by subpilot
Thu Mar 16, 2006 6:38 pm

Sorry, I must be dyslexic, the code snippet is on page 93 of the Instruction manual. (Second to the last page) It's in red and in with the Gyrosense example code.
Sorry, I must be dyslexic, the code snippet is on page 93 of the Instruction manual. (Second to the last page) It's in red and in with the Gyrosense example code.
subpilot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 146
Joined: Sat Feb 25, 2006 1:00 am
Location: Lake Arrowhead, Ca,USA

Post by Pev » Thu Mar 16, 2006 7:00 pm

Post by Pev
Thu Mar 16, 2006 7:00 pm

Got it - thanks

Pev
Got it - thanks

Pev
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by bauermech » Sun Apr 02, 2006 7:33 am

Post by bauermech
Sun Apr 02, 2006 7:33 am

:?: What are the benefits of the i2c? I'm not to clear with the concept. Used to daisy-chain 3024's? Video? Data transmit similar to RX/TX? I've only read bits and pieces about it, and any help would be appreciated :)
:?: What are the benefits of the i2c? I'm not to clear with the concept. Used to daisy-chain 3024's? Video? Data transmit similar to RX/TX? I've only read bits and pieces about it, and any help would be appreciated :)
bauermech
Site Admin
Site Admin
User avatar
Posts: 318
Joined: Sat Feb 04, 2006 1:00 am
Location: Defiance, Ohio, USA

Post by subpilot » Sun Apr 02, 2006 8:09 am

Post by subpilot
Sun Apr 02, 2006 8:09 am

I2C is a serial data protocol using two lines (clock and data). Many devices can share the same lines and each will have a destinct address.
There are quite a few sensors that use the interface like the SRF10 ranger. http://www.acroname.com/robotics/parts/R241-SRF10.html
The benefits are less wires and output of actual data without having to use an A2D port or measure pulse width. That frees up the main processor to do other tasks. The downside is that Robobasic doesn't easily support it.
For serious Robotics you really want to be performing all your tasks in parralel. Since that's not really practical with an embedded controller you just want to be sure to keep all functions as short as possible. You don't want to do as Robobasic does and be stuck in a routine waiting for servos to move without checking your sensor inputs.
I'm done trying to make Robobasic do what I want and am devoting my attention to fabing a new controller circuit board based on a Rabbit 3400 Micro. I'm incorporating 3 axis gyro,accelerometer and mag sensors. It's going to be similar to this http://www.procerusuav.com/images/large ... de_lrg.jpg
I2C is a serial data protocol using two lines (clock and data). Many devices can share the same lines and each will have a destinct address.
There are quite a few sensors that use the interface like the SRF10 ranger. http://www.acroname.com/robotics/parts/R241-SRF10.html
The benefits are less wires and output of actual data without having to use an A2D port or measure pulse width. That frees up the main processor to do other tasks. The downside is that Robobasic doesn't easily support it.
For serious Robotics you really want to be performing all your tasks in parralel. Since that's not really practical with an embedded controller you just want to be sure to keep all functions as short as possible. You don't want to do as Robobasic does and be stuck in a routine waiting for servos to move without checking your sensor inputs.
I'm done trying to make Robobasic do what I want and am devoting my attention to fabing a new controller circuit board based on a Rabbit 3400 Micro. I'm incorporating 3 axis gyro,accelerometer and mag sensors. It's going to be similar to this http://www.procerusuav.com/images/large ... de_lrg.jpg
subpilot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 146
Joined: Sat Feb 25, 2006 1:00 am
Location: Lake Arrowhead, Ca,USA

Post by KurtE » Thu Apr 13, 2006 10:22 pm

Post by KurtE
Thu Apr 13, 2006 10:22 pm

I am about to start experimenting with I2C on my RN-1. I thought I might try interfacing a Devantech SRF-10 sensor to this controller. Has any one successfully used the I2C on RN-1?

Are there pull-up resistors already connected to the SCL and SDA lines? I know they show some rudimentary example code on page 93 in the manual, however has any one found a way to use the native TWI support of the AVR?

Likewise has anyone found ways to ROBOBASIC, but still get access to other capabilities of the AVR chip? For example does ROBOBASIC use all of the timers and if not can we gain access, such that maybe we can measure how long some operations take or the like.

Thanks
I am about to start experimenting with I2C on my RN-1. I thought I might try interfacing a Devantech SRF-10 sensor to this controller. Has any one successfully used the I2C on RN-1?

Are there pull-up resistors already connected to the SCL and SDA lines? I know they show some rudimentary example code on page 93 in the manual, however has any one found a way to use the native TWI support of the AVR?

Likewise has anyone found ways to ROBOBASIC, but still get access to other capabilities of the AVR chip? For example does ROBOBASIC use all of the timers and if not can we gain access, such that maybe we can measure how long some operations take or the like.

Thanks
KurtE
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Apr 13, 2006 1:00 am
Location: Washington State

Post by KurtE » Fri May 12, 2006 4:19 am

Post by KurtE
Fri May 12, 2006 4:19 am

I finally attempted to convert my I2C code for the AVR32 from C into RoboBasic. I also converted some of the Devantech SRF08/10 code that used it to try to get an SRF08 Range Finder to work. I bread boarded in a SRF08 to the SCL and SDA lines and installed some pull-up resistors to these two lines. So far I am not having much luck, making it work.

I would like to thank PEV for posting some help on a different thread on how to make use of the LCD port to output debug information. I bread boarded an ADM232 chip with the appropriate 5 capacitors and some jumpers and I can now output debug information to a terminal window.

I think I am attempting the appropriate bytes over I2C. I am not sure yet if the bits are getting out properly to the SCL and SDA pins. I don’t have a SCOPE yet to see the actual data streams on these two pins. (I have a low level PC based one by Parallax on order that I hope my help). I do have a logic probe which I tried hooking up to SDA and SCL and did find that the there is some data going out on those two pins. Also these lines appeared to be outputting even when I was not asking for a ping. I then went back to the overall template, which does not have any of my I2C code and the output on these two pins still changed. So I wonder if there is some other internal code is accessing these two pins.

Has anyone else had any luck using the I2C pins yet?
I finally attempted to convert my I2C code for the AVR32 from C into RoboBasic. I also converted some of the Devantech SRF08/10 code that used it to try to get an SRF08 Range Finder to work. I bread boarded in a SRF08 to the SCL and SDA lines and installed some pull-up resistors to these two lines. So far I am not having much luck, making it work.

I would like to thank PEV for posting some help on a different thread on how to make use of the LCD port to output debug information. I bread boarded an ADM232 chip with the appropriate 5 capacitors and some jumpers and I can now output debug information to a terminal window.

I think I am attempting the appropriate bytes over I2C. I am not sure yet if the bits are getting out properly to the SCL and SDA pins. I don’t have a SCOPE yet to see the actual data streams on these two pins. (I have a low level PC based one by Parallax on order that I hope my help). I do have a logic probe which I tried hooking up to SDA and SCL and did find that the there is some data going out on those two pins. Also these lines appeared to be outputting even when I was not asking for a ping. I then went back to the overall template, which does not have any of my I2C code and the output on these two pins still changed. So I wonder if there is some other internal code is accessing these two pins.

Has anyone else had any luck using the I2C pins yet?
KurtE
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Apr 13, 2006 1:00 am
Location: Washington State


9 postsPage 1 of 1
9 postsPage 1 of 1