Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : I2C Interface Question
Page 1 of 2 | |||||
Author | Message | ||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
I am trying to use the C-max board to interface to a DS1682 "Time Meter" IC. While looking through to PDF manual, it was explained in order to read back data from the chip, you have to send it a single "bit" in order to define the transfer as a read or write transfer. I don't think the receive command in MM-Basic will allow this kind of thing. As this is my first attempt at getting an I2C interface circuit going, I thought it might be useful to ask for possible guidance here... 2013-05-28_015650_Time_Meter_IC_DS1682.pdf Thanks in advance for any help on this..! Zonker |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Take a look here Page 6 has what you require RTC Regards John |
||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
I just started reading the page 6 Data you were talking about... Sorry for the interim post earlier.. I thought you were talking about the RTC chip itself... It looks like maybe I can pull this off yet...! Thanks for I2C guru help Guy's..!!! Zonk |
||||
BobD Guru Joined: 07/12/2011 Location: AustraliaPosts: 935 |
Zonk You don't just send 1 bit. That read / write bit is appended to the 7 address bits to make the first significant byte sent to the I2C device. The address of your device is 6B hex (107 decimal) so you have to include that and then you use the appropriate command to read or write the device. That command sets that 1 bit you are asking about. See if that helps. Come back if needed and I (or someone else) may have a bit more time for more details. |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
The Maximite can do this for sure See below quote from thread above "The first 7 bits are the address and the last bit is read/write The maximite adds the read/write bit as required so we need the 7 bits as the address &HA2 divided by two gives &H51 which is the address that MMbasic needs 10100010 or 10100011 right shift gives 1010001 (&H51) Some datasheets give the 7bit address rather than 8bits just to confuse the issue. " Regards John |
||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
Ahhh... I think I finally get it now... You are saying the base "7bit" address is decimal 107. and would be used for the "write" function. And, (the part I didn't get) is that you would use 108 for the "read" function... Man... totally missed that one.. Hell, I was trying to transmit the whole "8bit" number, and (of course) getting NO where... Thanks for all the help on this one Guy's..! (brain fart) Zonk |
||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
Humm... I tried 108 for the read and still are getting an array full of "0"'s Also tried just the 7bit" address (107) using the read function (thinking as you tried to say) the function will add the last bit on to the read.... Still no help... I keep getting a 1 (nak) as the MM.I2C value... I will recheck the hardware and try again... I can try using the I2C sniffer on the X-Protolab micro O-scope and see if it is sending the correct bit pattern... I'll get this sooner or later..!!! Thanks everyone..! |
||||
vk4tec Senior Member Joined: 24/03/2012 Location: AustraliaPosts: 239 |
This looks helpfull http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.htm Andrew Andrew Rich VK4TEC www.tech-software.net |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Use Hex address 6B as the I2C address Maximite will take care of the read write bit John |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3802 |
Missing a final l I think, so www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html John |
||||
djuqa Guru Joined: 23/11/2011 Location: AustraliaPosts: 447 |
Clickable link Jeez, you guys need to learn how to post clickable links [code] Replace the Curly Braces with square brackets {URL=www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html} Clickable link{/URL} [/code] VK4MU MicroController Units |
||||
BobD Guru Joined: 07/12/2011 Location: AustraliaPosts: 935 |
Slow down David. You are not allowed to criticise people like that. It's fairly difficult to click on the 4th icon from the left in the edit toolbar and follow the instructions. |
||||
djuqa Guru Joined: 23/11/2011 Location: AustraliaPosts: 447 |
Not critising , instructing Manually adding the url will prevent the forum software adding randomly placed spaces which is what happens if you use the add hyperlink icon . VK4MU MicroController Units |
||||
BobD Guru Joined: 07/12/2011 Location: AustraliaPosts: 935 |
(sarcasm) I should have included the sarcasm control in my previous post (/sarcasm) and I didn't use square brackets in case the forum software went loopy. |
||||
vk4tec Senior Member Joined: 24/03/2012 Location: AustraliaPosts: 239 |
Is that where the extra character went I looked all day, I thought it had fallen in the top of my shoe. Sorry - [mood]lazzines[/mood] Besides - it says I am a "senior" member and I am only 40 ! Hee Hee Andrew Rich VK4TEC www.tech-software.net |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3802 |
I just pasted it in. That SHOULD WORK. Frankly the forum software is broken otherwise. I don't care if it's broken but still it's broken. It's not 2003 any more, when maybe copy & paste of a URL was novel for some software. John |
||||
djuqa Guru Joined: 23/11/2011 Location: AustraliaPosts: 447 |
Yes it SHOULD work but the forum software has this "Feature/BUG" that inserts a random space VK4MU MicroController Units |
||||
bigmik Guru Joined: 20/06/2011 Location: AustraliaPosts: 2914 |
I agree, I cant see what benefit stopping a LONG string of characters from being posted without a space does to TBS. On another side has anyone noticed a distinct slow down of TBS recently? Maybe they have changed servers recently but its often (say 95% of the time) woefully slow to load pages. Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
shoebuckle Senior Member Joined: 21/01/2012 Location: AustraliaPosts: 189 |
TBS has been woefully slow for me too. At times I give up and return later (much later). I wonder if some unfortunate is getting a denial-of-service attack, which will affect the speed of the Internet for everyone. Cheers, Hugh |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
The thread drifted a bit - what was the final outcome with the i2c interface? Or did I miss something? I use i2c with the MM and other MCUs quite often with no problems. It does get confusing when picaxe uses 8 bit address (including the R/W bit 0) and MM uses 7 bit address (bits 1 to 7 of the address byte excluding R/W) David M. |
||||
Page 1 of 2 |
Print this page |