Show Posts
Pages: 1 [2] 3 4
16  Products / Arduino Due / wrong readings from ADXL345 on: November 18, 2012, 11:54:05 am
When I am reading accelerometer data (with my settings) from MEGA it returns just zeroes and sometimes '-1'.
This is normal, because I set it up with lowest sensitivity (16g) and accelerometer just sits on the desk.

But when I run the same code on DUE instead of '-1' I see 65535.

I wonder, does it have anything to do with different int type for DUE?
I believe this is all about that line

Code:
x = (((int)byte_buff[1]) << 8) | byte_buff[0];

Probably there is something wrong with signed integer representation. As I understand, when INT is stored in 2 bytes, then '-1' in binary would be just 16 '1'-s, but  when this number is interpreted as 4 bytes, it is equal to 65535. I am not quite good in understanding details of signed integers representation, so I might be wrong.

Any ideas?


17  Products / Arduino Due / Re: How to use second I2C? on: November 18, 2012, 05:43:42 am
Thanks a bunch, this works!

18  Products / Arduino Due / How to use second I2C? on: November 18, 2012, 05:01:59 am
I tried using accelerometer on pins 20 & 21 but it seems like there is something wrong with the board (no, I did not use +5V anywhere).
Somewhere it is mentioned DUE has two I2C interfaces, and there are pins SCL1 and SDA1 next to AREF pin.
How I can switch to using them?
19  Products / Arduino Due / Re: Arduino Due - Serial speed? on: November 17, 2012, 05:22:54 am
very simple code:
Code:
int x;
void setup()
 {

Serial.begin(250000);

randomSeed(analogRead(0));
  }
void loop()                 
{
     x=random(300);
     Serial.println(x);     
 }

IDE 1.5
The board is connected through the programming port.
Putty shows correct list of numbers coming from virtual COM.

If you increase speed to, say, 252000 or even 251000, Putty shows garbadge.
I played for couple hours trying to find any combination of Arduino/terminal program speed settings >250000 which does not produce garbage, and I failed.
With Arduino MEGA same code generates correct transmission up to 2048000 May be even with bigger numbers, but I feel it does not make sense to go further, because it is not the actual transmission speed. It is just some correct handling of parameters, like, if speed>2500000 then speed=250000.
20  Products / Arduino Due / Re: Native port driver BSoD on: November 17, 2012, 01:50:08 am
I am having the same issue on WinXP;
so should I change
Code:
#ifdef CDC_ENABLED
#define DEVICE_CLASS 0x02
#else
#define DEVICE_CLASS 0x00
#endif

to

Code:
#ifdef CDC_ENABLED
#define DEVICE_CLASS 0x00
#else
#define DEVICE_CLASS 0x00
#endif

in arduino-1.5.1r2\hardware\arduino\sam\cores\arduino\USB\USBCore.cpp?
21  Products / Arduino Due / Re: Arduino Due - Serial speed? on: November 17, 2012, 01:14:35 am
As I said above, MEGA accepts 2M, but it does not affect communication speed. Speed stopes raising ~ after 250000.
DUE with speed>250000 transmits garbage.
22  Products / Arduino Due / Re: Arduino Due - Serial speed? on: November 17, 2012, 01:11:26 am
Programming.
23  Products / Arduino Due / Re: Arduino Due - Serial speed? on: November 17, 2012, 12:20:04 am
yes, to host PC via USB.
after some experimenting it seems like I can transmit with Serial.begin(250000);
I tried increasing it to 251000 but failed to receive any data.
MEGA can accept practically any number ( I tried up to 2048000), but real transmission speed is like 40% less then maximum speed of DUE

24  Products / Arduino Due / Re: USB Serial Baud Rates? ... or other faster USB communication methods? on: November 17, 2012, 12:11:26 am
Hello-
 I am using a Due connected to a processing program and I'm using 1843200 baud which is working nicely. I am pretty sure this limitation is in Processing. (Java). If I try to go faster I get a Java error.  But, it's working fine at this speed.

=Rich
I somehow doubt this incredible number unless there is a typo with some extra '0' digit.
It seems there is no confirmed specification on this subject, so maximum stable speed is sort of 'gray area'.
I can get transmit rate of 250000 (Putty)
25  Products / Arduino Due / Arduino Due - Serial speed? on: November 16, 2012, 10:00:16 pm
What are next serial speed after 115200?
I tried 230400 and 250000 - does not work;
though, 131250 works fine but not 262500.
Any ideas?
26  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 10, 2012, 01:51:59 pm
Friend, I'm not sure about what do you want. But when I need to check if PC and Arduino is connected I use this.


String serialnumber;
void setup() {
  Serial.begin(9600);
  Serial.println ("Data between Arduino and PC ok!");
   int sensorValue = analogRead(A0);
  pinMode (8, OUTPUT);
  pinMode (9, OUTPUT);
  be continue........
Are you  saying that if Serial.begin does not fail this along proves it is connected?
Certainly not.
The have such a functionality for Ard Leonardo, though, as I stated in my initial post, that is  a clause 'if(serial)'
27  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 08, 2012, 10:22:55 pm
Perhaps try to think outside of the box.. dont detect it.
You might write to both usb and to the SD you do it in a circular logging way. (FILO)
Well, first of all it was just "nice to have", and as I can see now, there are no simple ways, so heck with it.

PS for medical data it might not be wise to use an arduino, see its license its not to be used in environments that could change the dead or alive situation of a carbon based life form..or something like that.
Ask yourself what is the cost if your solution would fail, its not foolproof hardware it will brakedown someday
it costs nothing at all because there is also a "science". And even more to this, it is about mostly exercising... like, 'your zone' of Polar which actually has purchased the idea for cash from "unnamed" (Eastern European) source.
This is just my hobby... connect Arduino board to the living being, collect some data and tell when exactly that "living being" is  gonna bust away smiley
28  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 07, 2012, 02:38:58 am
Wow!
Don't be so important please.
Where is an insult? The mere fact I pointed out you are giving replies without reading original question?
Ban me, it will make you happy.
29  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 07, 2012, 02:31:01 am
Nick, if you could bother yourself with reading the original post, you could have noticed I was asking for solutions _other_ then two most obvious ones. And with obvious reason as well: first one  - I cannot modify program code, second one - hardly reliable.
30  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 07, 2012, 02:18:03 am
I think there was a thread a while back about detecting if you are connected to USB or not. Something to do with checking the voltage level of Vin. That may help.
and that was exactly the post I was referring to in my first reply ... in this thread. I can refer to it again:
http://arduino.cc/forum/index.php?topic=107860.0


Moderator edit: Insult deleted.
Pages: 1 [2] 3 4