zeke 693 Posted August 17, 2011 Share Posted August 17, 2011 I don't think you want to turn this place into PICList. That would just be :crazy: Quote Link to post Share on other sites
bluehash 1,581 Posted August 17, 2011 Share Posted August 17, 2011 I apologize guys but oPossum knows I was just kidding, feel free to post code from other architectures. Quote Link to post Share on other sites
gordon 229 Posted August 17, 2011 Share Posted August 17, 2011 Not that I mind, but maybe the Other Microcontrollers section would be a better fit. Quote Link to post Share on other sites
nuetron 64 Posted August 17, 2011 Share Posted August 17, 2011 Pardon my ignorance, but what is "Dallas/Maxim One Wire"? Is it an asynchronous single-line protocol? Quote Link to post Share on other sites
zeke 693 Posted August 18, 2011 Share Posted August 18, 2011 Pardon my ignorance, but what is "Dallas/Maxim One Wire"? Is it an asynchronous single-line protocol? Yes. It's a two wire bus that has a time based protocol. Maxim/Dallas is the only manufacturer in the world. Here's an excellent summary of it. Most people use their temperature sensors in their HVAC projects. But, it's also used in a serious manner. I have a client who has based their entire business on these temperature sensors. They are one of the largest users of one wire technology in the world. nuetron 1 Quote Link to post Share on other sites
nuetron 64 Posted August 22, 2011 Share Posted August 22, 2011 How difficult would it be to modify One Wire for iRed, as in this schematic? Quote Link to post Share on other sites
oPossum 1,083 Posted August 23, 2011 Author Share Posted August 23, 2011 MSP430s with USCI support IRDA. That would be a much better way than trying to adapt one wire to IR. nuetron 1 Quote Link to post Share on other sites
krzyk2 11 Posted January 11, 2012 Share Posted January 11, 2012 Thanks to pointers from Rickta59 here's code tuned to work in msp430-gcc. I've used it in my project to read temperature from DS sensor and it works correctly. dow.zip lvagasi, oPossum and Rickta59 3 Quote Link to post Share on other sites
Skunky Lee 0 Posted January 31, 2012 Share Posted January 31, 2012 Hi! So I'm having a bit of a problem trying to figure out this code, and I'm wondering if anyone could help me out a bit. Basically, I'm trying to use G2231 to read a DS18B20. I'm using pin 1.6 and 1 MHz factory calibrated clock. The thing is, when I send down the initial check owex(0,0), I get correct behaviour (tested on 2 different sensors). 0xFFFF if the sensor is plugged in and 0 if it's not. Then, I try to send down the Skip Rom command (0xCC) in order to verify the communication. It fails, for it always returns a 0. Curious enough, though, if I send down the ReadRom command (0x33), I do get the echo back (0x33). I'm using the sensor in the pull-up resistor configuration. I get the feeling I'm missing something basic here. It says in the OP that if I don't get an echo when using 0xCC command, there's a problem on my bus, but I dont actually get what that would mean. I don't have access to an oscilloscope and the voltages check out fine. I'd be grateful for any help. Here's my main code: void main(void) { volatile int p; volatile int test; WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer DCOCTL = 0; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; LCD_init(); one_wire_setup(&P1DIR, &P1IN, BIT6, 1); LCD_gotoXY(0,0); p = owex(0,0); if(p == 0xFFFF){ LCD_writeString("D found."); LCD_gotoXY(0,1); test = owex(0xCC, 8); LCD_writeString(convertADC(test,0)); }else{ LCD_writeString("D not found."); } } So basically, if there's a sensor plugged in, I get this on the lcd: Device found. 0 If there isn't, I get: Device not found Quote Link to post Share on other sites
oPossum 1,083 Posted January 31, 2012 Author Share Posted January 31, 2012 Make sure the jumper for the P1.6 LED has been removed - that can cause problems. A bus error would typically be when the bus is not pulled up when is should be - something is erroneously keeping it low. Does my sample code work properly? Quote Link to post Share on other sites
Skunky Lee 0 Posted February 4, 2012 Share Posted February 4, 2012 Hi! Thanks for the help. Sorry I didn't answer sooner but something unexpected came up. Yeah, the jumper on 1.6 was removed, I forgot to mention that. Anyway, I'll try running your sample code tomorrow and try to see what comes up. Thank you very much for your help so far [EDIT] Hah! Found the problem. I had a "lightbulb" moment and checked to see if I didn't accidentally mistake my DS18B20 for a transistor or something else in TO-92 casing. Funny enough, it seems that my DS18B20 isn't DS18B20 at all, but DS18B20P, which is a Parasite-mode only chip. It'll be a while before I can get my hands on a normal one. Will report back then. Quote Link to post Share on other sites
DecebaL 0 Posted February 28, 2012 Share Posted February 28, 2012 I have a problem. Please help, how can I use multiple DS1820 s on same 1-wire bus? Regards: Imre Huba Quote Link to post Share on other sites
cubeberg 540 Posted October 5, 2012 Share Posted October 5, 2012 I'm working on implementing this for the IV-18 Clock booster and I'm not sure if I've got things running correctly or if I'm misinterpreting the output Before the print_temp function executes, the values for TF and TC are around 3304 and 6459. This is what I'm seeing in the console: One Wire Test FF 33 28 53 92 BF 03 00 00 B2 206.5000 403.6875 I'm seeing numbers increase when I touch the sensor and back down when I take my finger off and the serial is always consistent. Any suggestions? Quote Link to post Share on other sites
oPossum 1,083 Posted October 5, 2012 Author Share Posted October 5, 2012 What is the full part # of the sensor you are using? Quote Link to post Share on other sites
cubeberg 540 Posted October 5, 2012 Share Posted October 5, 2012 DS18B20+. It was a sample from Maxim. I double-checked what's on the case against what I have in stock - it's definitely not the parasitic model. Using 3.6v supply and a 4.7k pull-up resistor. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.