Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 11:45 09 May 2024 Privacy Policy
Jump to

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 States
Posts: 761
Posted: 04:12pm 27 May 2013
Copy link to clipboard 
Print this post

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 Zealand
Posts: 711
Posted: 09:25pm 27 May 2013
Copy link to clipboard 
Print this post

Hi

Take a look here Page 6 has what you require
RTC

Regards

John
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 01:01pm 28 May 2013
Copy link to clipboard 
Print this post

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 Edited by Zonker 2013-05-29
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 01:39pm 28 May 2013
Copy link to clipboard 
Print this post

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 Zealand
Posts: 711
Posted: 01:44pm 28 May 2013
Copy link to clipboard 
Print this post

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 States
Posts: 761
Posted: 01:58pm 28 May 2013
Copy link to clipboard 
Print this post

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 States
Posts: 761
Posted: 02:27pm 28 May 2013
Copy link to clipboard 
Print this post

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: Australia
Posts: 239
Posted: 02:42pm 28 May 2013
Copy link to clipboard 
Print this post

This looks helpfull

http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.htm

AndrewEdited by vk4tec 2013-05-30
Andrew Rich VK4TEC
www.tech-software.net
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 02:57pm 28 May 2013
Copy link to clipboard 
Print this post

Use Hex address 6B as the I2C address
Maximite will take care of the read write bit

JohnEdited by jman 2013-05-30
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3674
Posted: 09:11pm 28 May 2013
Copy link to clipboard 
Print this post

  vk4tec said   This looks helpfull

http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.htm

Andrew


Missing a final l I think, so
www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html

JohnEdited by JohnS 2013-05-30
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 09:15pm 28 May 2013
Copy link to clipboard 
Print this post

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]Edited by djuqa 2013-05-30
VK4MU MicroController Units

 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 09:21pm 28 May 2013
Copy link to clipboard 
Print this post

  djuqa said   Clickable link

Jeez, you guys need to learn how to post clickable links

[code]
Replace the Braces with square brackets
{URL=Insert the link address}Text for the link{/URL}
[/code]

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: Australia
Posts: 447
Posted: 09:25pm 28 May 2013
Copy link to clipboard 
Print this post

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 .


Edited by djuqa 2013-05-30
VK4MU MicroController Units

 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 09:29pm 28 May 2013
Copy link to clipboard 
Print this post

  djuqa said   Not critising , instructing
Manually adding the url will prevent the forum software adding randomly placed spaces if you use the add hyperlink icon

(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: Australia
Posts: 239
Posted: 11:38pm 28 May 2013
Copy link to clipboard 
Print this post

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

Edited by vk4tec 2013-05-30
Andrew Rich VK4TEC
www.tech-software.net
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3674
Posted: 03:28am 29 May 2013
Copy link to clipboard 
Print this post

  djuqa said   Clickable link

Jeez, you guys need to learn how to post clickable links

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.

JohnEdited by JohnS 2013-05-30
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 11:44am 29 May 2013
Copy link to clipboard 
Print this post

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: Australia
Posts: 2870
Posted: 02:17pm 29 May 2013
Copy link to clipboard 
Print this post

  djuqa said   Yes it SHOULD work but the forum software has this "Feature/BUG" that inserts a random space


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: Australia
Posts: 189
Posted: 02:43pm 29 May 2013
Copy link to clipboard 
Print this post

  bigmik said  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.


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: Australia
Posts: 819
Posted: 03:36pm 29 May 2013
Copy link to clipboard 
Print this post

  zonker said  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..!!!


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
© JAQ Software 2024