Try the OBEX under the Protocol heading for a couple of I2C routines that may be helpful. Here's one to get you started: http://obex.parallax.com/objects/26/
The problem I am having is that in probasic the only variables are longs and the I2C calls require you to send bytes. So how do you send bytes? Bean or Jonny Mac are you watching?
Keep in mind that you don't have to TX all 32 bits in a long -- you can send only the eight required and that's what the I2C routines do. And when you WRBYTE to get a value to the hub, you're only writing the eight LSB bits.
[Edit] I just looked at the code generated by I2CWRITE and it does indeed send just the lower eight bits of your variable. If you look carefully you'll see that the value to write is moved into __temp3 and then shifted left by 24 bits. This moves the lower eight bits to the MSB bits position (31..24); this is required to send the bits MSB first.
Comments
Ben
[Edit] I just looked at the code generated by I2CWRITE and it does indeed send just the lower eight bits of your variable. If you look carefully you'll see that the value to write is moved into __temp3 and then shifted left by 24 bits. This moves the lower eight bits to the MSB bits position (31..24); this is required to send the bits MSB first.
Thanks again
Ben
I know this was a year ago, but what ya up to? Are you doing something with the propeller for model railroad?
G
Its too bad Parallax dosent have a Prrop1 chip in a smaller package with less I/O.
It would make a great DCC decoder with sound.