Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:27 24 Nov 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 : Peripheral Communications Protocol Poll

     Page 2 of 2    
Author Message
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 01:18am 24 Oct 2011
Copy link to clipboard 
Print this post

  Keith @ said   Keith W & Ray

I'm of the opinion that 1-wire still needs to be included as it is another option for people to use ... once implemented in software/hardware it can be used and re-used forever more!

Open up more capability and you open up to larger audience.

Keith


BTW

I haven't removed 1-wire comms from any poll. It is still there.

Cheers Don...
https://www.dontronics.com
 
Keith W.
Senior Member

Joined: 09/10/2011
Location: Australia
Posts: 118
Posted: 11:13am 24 Oct 2011
Copy link to clipboard 
Print this post

For Ray and anyone else interested.

Reading the DS1721 chips mentioned above was easy. I thought that I might have fried the first chip as I had mounted it reversed and used a heat gun to remove it, then re-soldered. But it works OK. I found that I already had a program from “Crackerjack” to read DS1621 chips which must be similar. Here is a program which I have kept simple but with comments. My little boards have 3 jumpers to set the individual thermometer address pins high or low, then only a 0.1 uF cap across the supply plus provision for mounting pull up resistors on the two I2C bus pins if required. A 6 pin connector for 0 volts , + 5 volts, SDA and SCL plus a pin for the chips temperature comparator output pin, still to be tried. The individual address is sent to the chip embedded in the I2C address byte.

Note that the chip in 12 bit mode reads in sixteenths of a degree, not tenths.


I am not against adding 1Wire protocol to the Maximite but it is slipping down my list.

Keith W.

> list
10 ' Read DS1721 Thermometers
20 '
30 DIM TempBuff(16) ' room for 8 but just 1 thermometer to start
40 '
50 PRINT
60 INPUT "Enter Thermometer # (1 to 8) ? " , T$
70 '
80 i2caddr = &H48 + (VAL(T$) - 1) 'embed thermometer address
90 '
100 I2CEN 100,100 ' enable I2C @ 100 KHz and 100 mS timeout
110 I2CSEND i2caddr,1,2, &HAC, &H0C ' config reg = 12 bits and continuous conversion
120 I2CSEND i2caddr,0,1,&H51 ' Begin conversions command
130 '
140 PAUSE 1000 ' wait for conversion, 750 ms for 12 bit reso. --first time anyway
150 '
160 I2CSEND i2caddr, 1,1, &HAA 'read temperature command
170 I2CRCV i2caddr,0,2, TempBuff(1) ' get 2 bytes from chip
180 I2CDIS ' Disable I2C
190 '
200 temp = (TempBuff(1) * 256 + TempBuff(2)) 'convert 2 bytes into 1 number
210 '
220 temp = temp / 256 ' shift down for fraction of a degree
230 '
240 Qneg = TempBuff(1) AND &H80 ' test for most sig bit = negative temperature
250 IF Qneg = &H80 THEN temp = temp - 256
260 '
270 PRINT " Temperature for thermometer " T$ " is" temp " Degrees"
280 PRINT
290 END
>
> run

Enter Thermometer # (1 to 8) ? 2
Temperature for thermometer 2 is 26.125 Degrees
 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 12:30pm 24 Oct 2011
Copy link to clipboard 
Print this post

Thanks Keith for the example and the link to CrackerJack's original example post as follows: http://www.thebackshed.com/forum/forum_posts.asp?TID=4096
RayB from Perth WA
 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 01:19pm 24 Oct 2011
Copy link to clipboard 
Print this post

Further to Keith W and CrackerJack's posts here is a comparison between DS18B20 (1-Wire Device) and DS1721 and DS1621 (2-Wire/I2C devices)


Keith W (or anyone else) would it be correct to assume that the sample code above would not work with a 1-Wire Device like the DS18B20 which I just happen to have and not the other I2C components.
Regards
RayB from Perth WA
 
Keith @

Senior Member

Joined: 19/06/2011
Location: Australia
Posts: 167
Posted: 12:42am 25 Oct 2011
Copy link to clipboard 
Print this post

Hi Ray

I wasn't able to read the image you posted ... could you redo it as a URL.

I have included the following link which gives basic info on the alternatives to I2C.

http://www.i2c-bus.org/alternatives/

With the little that I know I would say that 1-Wire's software requirements are more demanding then I2C mainly due to the strict timing demands.

Horses for courses ... Clydesdales will never win the Melbourne Cup but will pull more weight then a spindly filly. Equally 1-Wire has advantages over I2C.

regards
Keith
The more we know, the more we know we don't know !
 
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 01:01am 25 Oct 2011
Copy link to clipboard 
Print this post

Keith @ I've reposted the comparison off the MAXIM web page below as it shows some differences. This is a filtered page which can't really be sent as a URL due to the filters not showing up but here goes....http://para.maxim-ic.com/en/results.mvp?fam=temp_sen s

My preference for the DS18B20 because I have those at hand from using them with PicAxe and the fact that I can buy 10 for A$14 from HongKong on ebay inc post (takes 2 weeks). Someone mentioned DS1621 on special at 50 cents each from Rockerby but their freight alone in Aussie is over $10.
Much a muchness I suppose...
2011-10-25_105919_Compare_DS18B20_-_DS1721_-_DS1621.pdf
RayB from Perth WA
 
boss

Senior Member

Joined: 19/08/2011
Location: Canada
Posts: 268
Posted: 03:24pm 26 Oct 2011
Copy link to clipboard 
Print this post

Good morning to all from rainy Vancouver,

what I'm looking for is the way to send data in to some chip(s) requiring less or more bits than 8 i.e. DAC7611 D/A converter (requires 12bit). Unfortunately SPI command doesn't allow to limit number of Tx bits or I missed something?
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024