Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

MyRio I2C Hitechnic DC Motor Controller for Tetrix - Read Problem

Hi,

 

We are working with Tetrix and the MyRio for the WRO college level competion.  I have tried just about everything I could think of but I can't explain why I'm getting random garbage when trying to read registers on the DC motor controller through I2C.

 

I have followed the Datasheet provided by HiTechnic and I don't understand why I can write to the motors to get them to move, but I can't read anything useful from the Registers?

 

Even constants in addresses 08~0F which is supposed to list the manufacturer "HiTechnc" or "48 69 54 65 63 68 6E 63" and addresses 10~17 which is supposed to list the Sensor Type "MotorCon" or " 4D 6F 74 6F 72 43 6F 6E" is returning a random sequence of bytes each time any of those addressed are read.

 

I2C Read Encoder.png

 

I hope someone has encountered this before, because I'm running out of time to fix this.

 

Thanks,

 

Marco

0 Kudos
Message 1 of 4
(6,606 Views)

I'm more familiar with the 845x driver than the myRIO Express VIs but do you get a constant return if you just read one byte starting at 0x00 when the Express VI is just configured as Read (not Read/Write)?

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 4
(6,583 Views)

Hi Matt,

 

If I just read without writing I get a random number, without writing I can't specify which register to read from. 

 

I contacted the people who made the unit and they told me to slow down the fcl down to 10Khz.  I don't know if or how that can be done as the CNTR register only supports u8 and the value needed I calculated to be 2013.

 

Thanks,

 

Marco

0 Kudos
Message 3 of 4
(6,567 Views)

@MarcoVan wrote:

 

 

I contacted the people who made the unit and they told me to slow down the fcl down to 10Khz.  I don't know if or how that can be done as the CNTR register only supports u8 and the value needed I calculated to be 2013.

 


I didn't quite understand this, was this a mistype of "slow down the scl down to 100khz"?  Can you also explain your concern about CNTR register.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 4
(6,553 Views)