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

I2C and IO Ports...

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

I2C and IO Ports...

Post by KurtE » Wed May 24, 2006 5:17 am

Post by KurtE
Wed May 24, 2006 5:17 am

I tried again today to connect a Deventech SRF10 Range Finder to my RN-1. This requires I2C, so I have been attempting to convert some C code that I had running on a robot that is based on an AVR16 microcontroller. However since I can not use the native support for I2C that is on this chip through RoboBasic, I ended up trying to do it bit by bit.

So far I am not having much luck :( . Has had any success using any I2C devices on their RN-1?

Does anyone know if the SDL/SCL lines that are labeled on the board already have pull-up resistors installed on them or not? Also does anyone know what their IO port numbers are? Also does anyone know if HiTec is using I2C for anything else on the board?

I know there is some sample code in the RN-1 user’s manual on page 93, however looking closely at it, I have my doubts if this code fragment would work. In this fragment it says that SCL=22 and SDA=23. With a couple of iterations of my code, I started to have some Servos jitter. That made me wonder if the IO Ports were wrong. The documentation mentioned that there 40 IO ports, so my assumption that 24 of them or the servos, 8 were the ATOD ports and the other 8 would probably be the 8 lines upper left including SCL and SDA, does this make sense? Something like:
IO PORTS
Servos 0-23 0-23
SCL 24
SDA 25
PWM0 26
Pwm1 27
Pwm2 28
LCD 29
ERX 30
ETX 31
ATOD0-7 32-39

I wonder what their code fragment is trying to do. It looks like it is outputting a 4 bit address over SDA, probably the last bit is an R/W bit and then it reads in a byte from the slave from least significant bit to most significant bit. But this does not look like any standard I2C communication. Has anyone else made any better sense of this?

Sorry for just rambling on here :oops: .
I tried again today to connect a Deventech SRF10 Range Finder to my RN-1. This requires I2C, so I have been attempting to convert some C code that I had running on a robot that is based on an AVR16 microcontroller. However since I can not use the native support for I2C that is on this chip through RoboBasic, I ended up trying to do it bit by bit.

So far I am not having much luck :( . Has had any success using any I2C devices on their RN-1?

Does anyone know if the SDL/SCL lines that are labeled on the board already have pull-up resistors installed on them or not? Also does anyone know what their IO port numbers are? Also does anyone know if HiTec is using I2C for anything else on the board?

I know there is some sample code in the RN-1 user’s manual on page 93, however looking closely at it, I have my doubts if this code fragment would work. In this fragment it says that SCL=22 and SDA=23. With a couple of iterations of my code, I started to have some Servos jitter. That made me wonder if the IO Ports were wrong. The documentation mentioned that there 40 IO ports, so my assumption that 24 of them or the servos, 8 were the ATOD ports and the other 8 would probably be the 8 lines upper left including SCL and SDA, does this make sense? Something like:
IO PORTS
Servos 0-23 0-23
SCL 24
SDA 25
PWM0 26
Pwm1 27
Pwm2 28
LCD 29
ERX 30
ETX 31
ATOD0-7 32-39

I wonder what their code fragment is trying to do. It looks like it is outputting a 4 bit address over SDA, probably the last bit is an R/W bit and then it reads in a byte from the slave from least significant bit to most significant bit. But this does not look like any standard I2C communication. Has anyone else made any better sense of this?

Sorry for just rambling on here :oops: .
KurtE
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Apr 13, 2006 1:00 am
Location: Washington State

Post by RubikCube » Thu May 25, 2006 1:17 am

Post by RubikCube
Thu May 25, 2006 1:17 am

Did you try going to Robonova's website and downloading the MR-C3024 Specification ? The link is http://www.hitecrobotics.com/info/downloads.htm.

I have used SRF04 and it worked. It does not use I2C, it uses the sonar command and digital i/o ( any two not used servo ports).
Did you try going to Robonova's website and downloading the MR-C3024 Specification ? The link is http://www.hitecrobotics.com/info/downloads.htm.

I have used SRF04 and it worked. It does not use I2C, it uses the sonar command and digital i/o ( any two not used servo ports).
RubikCube
Robot Builder
Robot Builder
User avatar
Posts: 23
Joined: Mon Mar 06, 2006 1:00 am

Post by KurtE » Thu May 25, 2006 2:46 am

Post by KurtE
Thu May 25, 2006 2:46 am

RubikCube wrote:Did you try going to Robonova's website and downloading the MR-C3024 Specification ? The link is http://www.hitecrobotics.com/info/downloads.htm.



Yes thanks!

I am now pretty sure the SDA and SCL lines shown in their I2C example is wrong. I tried changing it over to 24 and 25 and I am seeing some differences with my logic probe. Tomorrow I will pick up my cheap PC based SCOPE and will watch the outputs to help me debug this.

One thing I have noticed through the logic probe is that the system software appears to also manipulate these logic lines. I wonder if they use the I2C for some other purpose?

I will probably take this offline... However I will post something if or when I get it working
RubikCube wrote:Did you try going to Robonova's website and downloading the MR-C3024 Specification ? The link is http://www.hitecrobotics.com/info/downloads.htm.



Yes thanks!

I am now pretty sure the SDA and SCL lines shown in their I2C example is wrong. I tried changing it over to 24 and 25 and I am seeing some differences with my logic probe. Tomorrow I will pick up my cheap PC based SCOPE and will watch the outputs to help me debug this.

One thing I have noticed through the logic probe is that the system software appears to also manipulate these logic lines. I wonder if they use the I2C for some other purpose?

I will probably take this offline... However I will post something if or when I get it working
KurtE
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Apr 13, 2006 1:00 am
Location: Washington State

Post by subpilot » Thu May 25, 2006 9:00 am

Post by subpilot
Thu May 25, 2006 9:00 am

The I2C is used for the on board EEPROM so I believe the pull-ups exist. Bit Banging via Robobasic is going to be a serious pain.
The I2C is used for the on board EEPROM so I believe the pull-ups exist. Bit Banging via Robobasic is going to be a serious pain.
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 » Sat May 27, 2006 4:47 pm

Post by KurtE
Sat May 27, 2006 4:47 pm

subpilot wrote:The I2C is used for the on board EEPROM so I believe the pull-ups exist. Bit Banging via Robobasic is going to be a serious pain.


You are right, The I2c is used by the boards EEPROM, which I believe is the chip marked with ATMEL504. This chip is not mentioned at all in the MR-C3024 spec.

I did some experimenting and I still not sure what RoboBasic input ports (if any) are assigned to the SCL/SDA pins on the board. :idea: So I finally decided to use two unused input ports to try to Bit Bang an I2C interface.

:D So Today I finally had some sucess and I know have RoboBasic code that can do a ping on my Devantech SRF10 (or SRF08) Range Finder :)
subpilot wrote:The I2C is used for the on board EEPROM so I believe the pull-ups exist. Bit Banging via Robobasic is going to be a serious pain.


You are right, The I2c is used by the boards EEPROM, which I believe is the chip marked with ATMEL504. This chip is not mentioned at all in the MR-C3024 spec.

I did some experimenting and I still not sure what RoboBasic input ports (if any) are assigned to the SCL/SDA pins on the board. :idea: So I finally decided to use two unused input ports to try to Bit Bang an I2C interface.

:D So Today I finally had some sucess and I know have RoboBasic code that can do a ping on my Devantech SRF10 (or SRF08) Range Finder :)
KurtE
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Apr 13, 2006 1:00 am
Location: Washington State

Post by subpilot » Sat May 27, 2006 6:50 pm

Post by subpilot
Sat May 27, 2006 6:50 pm

Nice work, You going to share?
Nice work, You going to share?
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 » Sun May 28, 2006 12:19 am

Post by KurtE
Sun May 28, 2006 12:19 am

subpilot wrote:Nice work, You going to share?


Sure :oops: . It is not pretty (or fast), but it appears to be at least somewhat working.

I put a copy of my test basic file up at:
http://robosavvy.com/Builders/KurtE/I2C_Test.bas

It has values assigned for which pins you are using for SDA and SCL.

Likewise it has two constants defined for the I2C address of the range finder. One for reads and one for writes. It is currently set to E4 and E5. This is not the defaults (E0), but happened to be what the sensor I pulled from a different robot was set to.

Later I will improve on this, but for now I wish to start integrating things. LIke mounting a servo to turn the head. Mount sensor on the head, add gyro and wait for new hands...

Good luck
subpilot wrote:Nice work, You going to share?


Sure :oops: . It is not pretty (or fast), but it appears to be at least somewhat working.

I put a copy of my test basic file up at:
http://robosavvy.com/Builders/KurtE/I2C_Test.bas

It has values assigned for which pins you are using for SDA and SCL.

Likewise it has two constants defined for the I2C address of the range finder. One for reads and one for writes. It is currently set to E4 and E5. This is not the defaults (E0), but happened to be what the sensor I pulled from a different robot was set to.

Later I will improve on this, but for now I wish to start integrating things. LIke mounting a servo to turn the head. Mount sensor on the head, add gyro and wait for new hands...

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

Can't get to the file?

Post by dshinsel » Wed May 31, 2006 9:12 pm

Post by dshinsel
Wed May 31, 2006 9:12 pm

RE: "I put a copy of my test basic file up at:
http://robosavvy.com/builders/kurte/i2c_test.bas "

Good timing, I am getting ready to try reading from an I2C I/O expander chip (hooking up a bumper sensors, etc.)

However, I can't see the .bas file. It looks like ALL the uploaded files have been deleted?

Maybe you can just paste the I2C code here?
if not, could you email it to me: dshinsel <at> verizon.net

Thanks!
I'll be posting my latest stuff soon...
RE: "I put a copy of my test basic file up at:
http://robosavvy.com/builders/kurte/i2c_test.bas "

Good timing, I am getting ready to try reading from an I2C I/O expander chip (hooking up a bumper sensors, etc.)

However, I can't see the .bas file. It looks like ALL the uploaded files have been deleted?

Maybe you can just paste the I2C code here?
if not, could you email it to me: dshinsel <at> verizon.net

Thanks!
I'll be posting my latest stuff soon...
Dave Shinsel
dshinsel <insert at sign> verizon.net
dshinsel
Robot Builder
Robot Builder
User avatar
Posts: 9
Joined: Tue Apr 25, 2006 1:00 am

Re: Can't get to the file?

Post by KurtE » Thu Jun 01, 2006 3:14 am

Post by KurtE
Thu Jun 01, 2006 3:14 am

dshinsel wrote:Good timing, I am getting ready to try reading from an I2C I/O expander chip (hooking up a bumper sensors, etc.)

However, I can't see the .bas file. It looks like ALL the uploaded files have been deleted?


I seam to be able to get to the file. If I type the following in my address line:

http://robosavvy.com/Builders/KurtE/I2C_Test.bas

It shows the file in my browser. Maybe there is some type of file protection in place?

Just in case you still could not get to it, I did send you an email with the contents.

Good Luck with the expander chip.
dshinsel wrote:Good timing, I am getting ready to try reading from an I2C I/O expander chip (hooking up a bumper sensors, etc.)

However, I can't see the .bas file. It looks like ALL the uploaded files have been deleted?


I seam to be able to get to the file. If I type the following in my address line:

http://robosavvy.com/Builders/KurtE/I2C_Test.bas

It shows the file in my browser. Maybe there is some type of file protection in place?

Just in case you still could not get to it, I did send you an email with the contents.

Good Luck with the expander chip.
KurtE
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 28
Joined: Thu Apr 13, 2006 1:00 am
Location: Washington State

I can get to the file now.

Post by dshinsel » Fri Jun 02, 2006 10:02 pm

Post by dshinsel
Fri Jun 02, 2006 10:02 pm

I think the robosavvy site must have had a temporary problem.

When (if?) I get this working, I'll post the code and schematic.
I think the robosavvy site must have had a temporary problem.

When (if?) I get this working, I'll post the code and schematic.
Dave Shinsel
dshinsel <insert at sign> verizon.net
dshinsel
Robot Builder
Robot Builder
User avatar
Posts: 9
Joined: Tue Apr 25, 2006 1:00 am


10 postsPage 1 of 1
10 postsPage 1 of 1