Show Posts
Pages: [1] 2 3 ... 42
1  Products / Arduino Due / Re: MMA8452Q 3 axis accelerometer on: November 24, 2013, 08:20:54 am
It probably won't work because the MMA8452Q requires the use of a repeated start.  From what I can tell in the library, they did not implement (even though they set up the argument passed to endTransmission) it.

Code:
//
// Originally, 'endTransmission' was an f(void) function.
// It has been modified to take one parameter indicating
// whether or not a STOP should be performed on the bus.
// Calling endTransmission(false) allows a sketch to
// perform a repeated start.
//
// WARNING: Nothing in the library keeps track of whether
// the bus tenure has been properly ended with a STOP. It
// is very possible to leave the bus in a hung state if
// no call to endTransmission(true) is made. Some I2C
// devices will behave oddly if they do not see a STOP.
//
uint8_t TwoWire::endTransmission(uint8_t sendStop) {
// transmit buffer (blocking)
TWI_StartWrite(twi, txAddress, 0, 0, txBuffer[0]);
TWI_WaitByteSent(twi, XMIT_TIMEOUT);
int sent = 1;
while (sent < txBufferLength) {
TWI_WriteByte(twi, txBuffer[sent++]);
TWI_WaitByteSent(twi, XMIT_TIMEOUT);
}
TWI_Stop( twi);
TWI_WaitTransferComplete(twi, XMIT_TIMEOUT);

// empty buffer
txBufferLength = 0;

status = MASTER_IDLE;
return sent;
}
2  Using Arduino / Networking, Protocols, and Devices / Re: Problem with HTTP GET request on: July 14, 2013, 12:41:52 pm
Quote
I have a 9V battery attached as well as the USB-cable.
If the device is switching off it's not a software problem, it's a power supply problem.  Your 9v battery can not keep up with the necessary 2 amp pulses of current that are required to maintain the GPRS connection.  GSM modules are very sensitive to voltage fluctuations on the power supply and will shut down if the voltage level fluctuates too much (I believe it's something like 300mV drop will make it power down).  Either use a power supply that can supply 2amps or place some very large capacitors across the power terminals to compensate.
3  Using Arduino / General Electronics / Re: Wiring GPS module not working on: July 09, 2013, 12:04:25 pm
So I am trying to get this GPS module(http://www.adafruit.com/products/790) to run with an Arduino Duemilanove. I got it to work briefly but now the Arduino won't turn on when I have both the power and ground plugged in. The GPS module says it runs with 3.3V-5V and I have tried each however it seems as if the arduino just shut off because even the computer cant detect it. I have tried other sensors and they work so I'm not really sure what the problem is.
I appreciate any input!
Thank you!
That GPS module alone is not 5 volt compatible, that must be a misprint on the site.  Max voltage on Vcc or VBackup is 4.3 volts.
4  Using Arduino / Networking, Protocols, and Devices / Re: Arduino as I2C Slave returns sometimes 0 bytes instead of 4. on: July 03, 2013, 10:07:48 pm
Quote
UPDATE 1: I completely rewrote this post, since I was able to replicate it with normal Arduino boards.
Notified this as a bug, http://forum.arduino.cc/index.php?topic=172831.0
It's not a bug per se but an aspect of the hardware for the Atmega 328.  Per the datasheet on page 326, there is a parameter called tBUF which is the Bus free time between a STOP and START condition and is spec'd at 4.7us for 100kHz bus speed and 1.3us for bus speeds above 100kHz.  It works very well using the repeated start instead, but you need to modify the Wire library on the slave device to handle the repeated starts.
5  Using Arduino / Networking, Protocols, and Devices / Re: Sending SMS using SIM900 GPRS Shield on: May 07, 2013, 12:59:58 pm


Only the final step of sending the msg text followed by Ctrl+Z doesn't work.
When I give AT command for reading SMS (AT+CMGR=1), it displays the top SMS successfully. Many other AT commands from the SIM900 datasheet are also working fine. Dont know what happens while sending SMS.  I've also tried feeding the SMS center number but that didn't help.
The problem is your error reporting is only giving you basic information (ie ERROR).  You need to enable a more advanced error reporting scheme.  Send the command AT+CMEE=1 in your setup before trying to send a message.  Now when you have an error, you will get a more detailed explaination of what is causing the error by way of an error code which you can look up.

6  Using Arduino / Networking, Protocols, and Devices / Re: I2C use 2 libraries on the same I2C bus ? on: April 04, 2013, 03:37:56 pm
There shouldn't be a problem using both. Did you get an error when compiling?  Can u post your code.
7  Community / Bar Sport / Re: USPS out to kill hobby shipping on: January 30, 2013, 09:32:02 pm
I'm not sure how you were able to do a trace on an Small Flat Rate (the only way possible is if you fill out the wrong customs form).  Basically if your tracking number starts with LJ or LC (SFR and First Class International use the same customs form) then it's not an actual tracking number but instead a Customs form number which is not scanned anymore once it leaves US soil.  If your tracking number starts with CP or CJ then you're using a different customs form designed for Medium Flat and up (along with weight based flat rate) and these numbers will continue to track through to the destination country and also provide a trace option.  Not trying to argue or anything but I've been burned by this a couple of times already and I don't want to see anyone else fall into the same trap.  I wish the PO did a better job advertising the restrictions with SFR but you have to really look at the fine print on their website to see it.
8  Community / Bar Sport / Re: USPS out to kill hobby shipping on: January 30, 2013, 09:05:13 pm
You're partially correct.  The USPS only offers trace and insurance options on Medium Flat Rate and up boxes.  Neither is offered on the Small Flat Rate Box/Envelope (I found this out the hard way after one went missing and I called the main PO and went to my local).  Plus when you use Stamps.com (Endicia also I'm sure) you'll get free delivery confirmation tracking on the package while it's in the US just as you would with the Small Flat Rate box.
9  Community / Bar Sport / Re: USPS out to kill hobby shipping on: January 30, 2013, 07:44:21 pm
@CrossRoads
If you're shipping a lot of items Internationally I recommend dumping the International Priority option.  International Priority has been nothing but a head ache to me as the package is not insured, the tracking information is not valid once the package leaves the US and it's not really any faster than First Class International.  I would switch to something like Stamps.com and send everything International First Class Mail and insure the package.  Through the Post Office, you can't insure International First Class but through Stamps.com you can.  The cost is based off item price and is usually only a few bucks.  So you can now ship something overseas, insured for usually around 7 bucks. 
10  Using Arduino / Networking, Protocols, and Devices / Re: Help communication I2C PCF on: December 17, 2012, 08:07:19 am
You're using the 8 bit address (0x70) and should be using the 7 bit address of the I2C device (0x38) instead.  Bit 0 of the slave address determines direction of data flow (read or write) and is automatically inserted by the Wire library.
11  Using Arduino / General Electronics / Re: Keeping GPS alive on: October 15, 2012, 07:04:22 pm
According to the datasheet, that device already has an internal battery. The datasheet doesn't specify what type of battery and it could simply be a supercap but it is fairly easy to determine if the battery is working.  Wait for the device to get a signal lock and then remove the power for a couple of minutes.  As soon as you reapply the power, look at the date reported in the first few NMEA sentences and see if the date reverted back to 1980.  If it did, then your battery is not working.  If the date and time are correct then your battery is working.  If it's a type of supercap then it may only hold a charge for a few hours.  You can experiment using different lengths of time with the power off to see just how long the battery stays charged in case you need to know that for your application.
12  Using Arduino / Networking, Protocols, and Devices / Re: I2C Slave Data Request Issue on: October 05, 2012, 11:22:32 am
The reason it's not working is because the Wire library does not support repeated starts.  A repeated start is when you basically skip sending the stop bit after a transaction has completed and just send an additional start bit to start the next transaction. It has the benefit of decreasing total data transfer time and not freeing up the bus in case another master is on the system and wants to use the bus.

I believe they issued a patch to fix the master side of the Wire library to generate repeated starts but I don't recall reading anything about patching the slave side to handle repeated starts.  It is possible to modify the Wire library to make it work, as I did it some time ago, but unfortunately I lost that bit of code.
13  Using Arduino / Programming Questions / Re: Question about different ways to declare objects and their effects on RAM usuage on: August 31, 2012, 10:01:58 am
Quote
Well, obviously the second example won't work
It should?  I thought I declared an instance of each of the classes before the calls.

Regardless, as usual...thanks for the help... you are wealth of knowledge!
14  Using Arduino / Programming Questions / Re: Question about different ways to declare objects and their effects on RAM usuage on: August 31, 2012, 09:44:32 am
Here you are creating a different instance called c1, and calling that instance's doSomething() method. This is not the same instance that was init()ed in setup().
Thanks PaulS.  I actually don't mind if the new instance is different from the first instance (as long as they're not duplicated in memory that is).  Let's say one of the library's is for a device like an accelerometer (which it is) and the .init() call configures the data registers in the accelerometer only.  I don't care if the instance of the object is destroyed at the end of Setup() as it's only function is to configure the accelerometer.  Now later on I create another instance to access features of the accelerometer (grab X,Y,Z crunch some numbers, etc..) and once again don't care that it gets destroyed when it goes out of scope. 

I guess what I'm ultimately asking is (and in retrospect should have phrased it this way):

Is dynamically creating instances of objects similar to using local variables in functions?  I know in a function when you declare a local variable, it is freed from memory once you return from the function call.  Does the same apply to an instance of an object when it goes out of scope? Are there any pro's or con's (related to RAM usage) with the three examples above?
15  Using Arduino / General Electronics / Re: "perfect" logic level shifting on: August 31, 2012, 09:19:56 am
For me, it came down to convenience. The TXB series is great if you have lots of of signal lines at one voltage being shifted to a different one - add a single TXB and you're done. Very clean board layouts can result and space savings are possible for any layout with more than 4 lines.

The BSS138 approach works great for single lines or when you don't mind the complexity that having three chips (BSS138 and two resistors) adds for each signal line. It's also great if you have lots of voltages to contend with - 1.8V, 3.3V, 4.2V, etc.

Where the TXB chips won't work is for I2C signal lines. They need a different translator, the TXS01xx series.
The other problem with the TXB series is the driving IC has to source at least 2mA on the drive signal for it work properly.  I ran into this issue trying to convert the signal from a GSM chip which couldn't source that high of a current.  The TXS series has the advantage of working both on I2C (open-drain) signals and push-pull configurations (as long as the speed is below 20MHz).
Pages: [1] 2 3 ... 42