Rei Vilo 695 Posted March 30, 2013 Share Posted March 30, 2013 Release 104 Distribution-104.zip energia, icserny and bluehash 3 Quote Link to post Share on other sites
Rickta59 589 Posted March 30, 2013 Share Posted March 30, 2013 Rei, your posts are great but of all the posters on this site, your titles give my android browser the most fits. You seem to use strange characters in your titles. When I click on your post links from the "New Content View" it sends my mobile browser and web server into a death spiral ending in me not being able to read the post because of excessive redirects. Not sure if this is a redirect issue. Obviously it is problem for the mobile only as I can read this fine on chrome versions running on a mac/linux or windows. This might have something to do with it, not sure http://www.webmasterworld.com/apache/4331495.htm So please keep up the posts but if you can, can you avoid funny characters in the title? Thanks, -rick Quote Link to post Share on other sites
Rei Vilo 695 Posted March 30, 2013 Author Share Posted March 30, 2013 Thanks for noticing me. That's really strange. It seems the square is a problem for some browsers. However, it comes from the standard Mac keyboard. I'll use the standard 2 and not the square. Quote Link to post Share on other sites
Rei Vilo 695 Posted April 1, 2013 Author Share Posted April 1, 2013 Rick: This is not the only bug: see the AT bug I reported at http://forum.43oh.com/topic/3620-bug/?p=32443 My browser crashes if I enter the at sign in the message, with Safari on OS X 10.8 and IE10 on Windows 8. Quote Link to post Share on other sites
icserny 9 Posted January 31, 2014 Share Posted January 31, 2014 On the MSP430G2553, the same pins P1_6 and P1_7 share I Rei Vilo 1 Quote Link to post Share on other sites
Rei Vilo 695 Posted January 31, 2014 Author Share Posted January 31, 2014 Thank you for reviewing my code and identifying the bugs. I hope to release a new version with the fixes you kindly suggested. If you want to save ~6KB of memory, get rid of the float and replace void loop() { delay(2000); float temp = tc75_read(); // Read temperature in 1/256 C degrees Serial.print("Temperature: "); Serial.print(temp/256,1); // Print result with 1 decimal Serial.println(" C"); } by void loop() { delay(2000); int32_t temp = tc75_read()*10/256; // Read temperature in 10x C degrees Serial.print("Temperature: "); Serial.print(temp/10, DEC); // Print integer part Serial.print("."); // Print decimal separator Serial.print(temp%10, DEC); // Print decimal part, 1 decimal } Now, one tricky question: how to handle sub-zero temperatures? Quote Link to post Share on other sites
icserny 9 Posted January 31, 2014 Share Posted January 31, 2014 If you want to save ~6KB of memory, get rid of the float and replace... You are right, the floating point arithmetic is a waste of memory and CPU time. On the other hand it makes Energy sketches a little more readable. Now, one tricky question: how to handle sub-zero temperatures? Good question, but I don't expect sub-zero temperature in my room. But merely changing the return type of function tc75_read(void) from uint16_t to int16_t should do the trick. Istvan Quote Link to post Share on other sites
roadrunner84 466 Posted January 31, 2014 Share Posted January 31, 2014 You are right, the floating point arithmetic is a waste of memory and CPU time. On the other hand it makes Energy sketches a little more readable. I think I will make a thing to solve this problem Quote Link to post Share on other sites
Rei Vilo 695 Posted February 10, 2014 Author Share Posted February 10, 2014 I've updated the library with the fedd-back from icserny. Thank you @@icserny! See Distribution-104.zip on the starting post of the thread. bluehash and FranRdrgz 2 Quote Link to post Share on other sites
Lgbeno 189 Posted August 18, 2014 Share Posted August 18, 2014 Rei, Thanks for sharing the library, I do have one question. I'm trying to use Soft I2C to read a Si7005 sensor because my normal USCI_B0 port is consumed by a RF boosterpack. Here is a function that I use to read a register: uint16_t i2cRead(unsigned char address,unsigned char reg){ int data = 0; Wire.beginTransmission(address); Wire.write(reg); Wire.endTransmission(); Wire.requestFrom(address, 1); while (Wire.available() < 1); data = Wire.read(); return data; } When I invoke: i2cRead(_address,0x00) I get this: I've found that this does not function properly when I compare to the communication on my Electric Imp that looks like this: I think that the difference is the Stop bit between the write and subsequent read. I did find this Arduino example: https://github.com/jjalling/Arduino-Si7005/blob/master/Si7005.cpp specifically they are using the following Wire command: Wire.endTransmission( false ); // We don't want to release the bus - this is important! This is not supported by your library so I tried to add it (and failed): uint8_t SoftwareWire::endTransmission(uint8_t sendStop) { uint8_t result = 0; startI2C(txAddress, I2C_WRITE); result += writeI2C(txBuffer, txBufferLength); //stopI2C(); txBufferIndex = 0; txBufferLength = 0; transmitting = 0; return result; } All I did was overload endTransmission and commented out the stopI2C call. After I run this, it gets really weird: So I'm just curious if you have any thoughts on the matter. The github author did note that it was really important not to release the bus. My next step will be to remove the RF booster pack and try with a standard Wire interface. Quote Link to post Share on other sites
Lgbeno 189 Posted August 19, 2014 Share Posted August 19, 2014 Similar experience with the standard Wire interface. see comments here: http://forum.43oh.com/topic/5738-state-of-i2c-in-msp430-based-devices-msp430f5529/ Quote Link to post Share on other sites
Lgbeno 189 Posted October 11, 2014 Share Posted October 11, 2014 After quite a bit of testing, I think that I have some improvements for the version of software i2c in this thread. The changes that I made are: Support for Wire.endTransmission(false); Also I added support clock stretching during i2c reads. SoftwareSerial.zip reaper7 1 Quote Link to post Share on other sites
veryalive 49 Posted October 12, 2014 Share Posted October 12, 2014 just curious - did you intend to post 'I2?C' ? i see 'software serial' posted .... cheers ! Quote Link to post Share on other sites
Lgbeno 189 Posted October 12, 2014 Share Posted October 12, 2014 just curious - did you intend to post 'I2?C' ? i see 'software serial' posted .... cheers ! Yes you are right, in my haste I uploaded the incorrect library. Here is the correct one... SoftwareI2C.zip Quote Link to post Share on other sites
ArcticSaturn 1 Posted November 14, 2014 Share Posted November 14, 2014 Hi, thanks for this library. I got one question regarding sending the address. When I try sending address 0x80 I see 0x00 on the logic analyzer. Sending 0x40 gives 0x80 Sending 0x20 gives 0x40 ... Has any one observed this behavior? What could be wrong? I'm using an FR5969 Launchpad to interface an SHT21 temp sensor (standard address is 0x80). Best regards, ArcticSaturn 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.