Show Posts
Pages: 1 2 [3] 4 5 ... 10
31  Using Arduino / Programming Questions / Re: 3Byte Two's Compliment on: October 26, 2012, 08:18:42 am
dhenry,

Quote
"Smart" is highly subjective.
agree smiley

Code:
void setup() {
 
  Serial.begin(115200);
 
  Serial.println("signed 24bit test\n");   
 
  int32_t value[]={0x800000, 0xFFFFFF, 0x0, 0x000001, 0x7FFFFF};
// exp result     -8.388.608,    -1   ,  0 ,    +1   , 8.388.607   
 
 
  for(int i=0; i<5; i++) {
    Serial.print(value[i], HEX);
    Serial.print("\t");
    Serial.println(value[i], DEC);   
  }
  Serial.print("___________________");
   

output:
  signed 24bit test

  800000   8388608         // expected -8.388.608
  FFFFFF   16777215        // expected  -1
  0           0
  1           1
  7FFFFF   8388607
   _________________



i', playing around with bit manipulation (shift, toggle, etc.) but
it always end up in requirement to use an IF condition.

"smart" would be without 'IF' but a straight conversion line ( or 2)

wally
 



32  Using Arduino / Programming Questions / 3Byte Two's Compliment on: October 26, 2012, 07:39:41 am
Hello,

is there a smart way to handle signed 24 bit integers ?
(without using "if" etc.)

Seems gcc > 4.7 supports a uint24_t nad int24_t datatype.

My ADC returns 3 Bytes conversion result as int24_t.

wally
33  Using Arduino / Networking, Protocols, and Devices / Re: Interfacing ADS1244 on: October 26, 2012, 03:58:09 am
better results with pos.Vref = +2.5V
 +5V     7FFFFF      8.388.607
 +2,5V  40ACA4  ~4.238.500
 +0,1V  5DC        ~1,500
 <+0,1  FFXXXX  16.xxx.xxx

Code:
/*
  ADS1244
 
*/

int DATA = 4;
int SCLK = 5;

void setup() {
 
  pinMode(DATA, INPUT);
  pinMode(SCLK, OUTPUT);
 
  Serial.begin(115200);
 
  // generate a 2.4MHz clock signal on pin 3
  pinMode(3, OUTPUT);      //CLK
 
  // 17.11 Register Description
  TCCR2A = 0x33;  // 0011 0011 
  TCCR2B = 0x09;  // 0000 1001
  OCR2A  = 0x06;  // 0000 0110
  OCR2B  = 0x03;  // 0000 0011
 
  Serial.print("ADS1244");    // output 'AADS1244' (?) additional 'A' in front
  delay(100);
}

void loop() {
 
  // Code for reading the data:
     
  int32_t value = 0;
 
  //digitalWrite(SCLK, HIGH);  //enter slleep mode
  delay(1000);
  digitalWrite(SCLK, LOW);  // wake up ADC
 
     
  // wait for data ready, stay in while-loop until LOW
  while (digitalRead(DATA) == HIGH);     

  value = shiftIn(DATA, SCLK, MSBFIRST);
  value <<= 8;
  value |= shiftIn(DATA, SCLK, MSBFIRST);
  value <<= 8;
  value |= shiftIn(DATA, SCLK, MSBFIRST);

  digitalWrite(SCLK, HIGH);  // enter sleep mode
  //digitalWrite(SCLK, LOW); // 25th pulse to keep DATA high till next data ready
   
  Serial.println(value, DEC);
  Serial.flush();

}

34  Using Arduino / Networking, Protocols, and Devices / Re: Interfacing ADS1244 on: October 25, 2012, 01:24:45 pm
Works !

i get :
16.772.xxx   on  0V
2.794.xxx  on   3.3V
700.xxx on 5V


35  Using Arduino / Networking, Protocols, and Devices / Re: Interfacing ADS1244 on: October 25, 2012, 01:28:23 am
Pylon,

thanks a lot !   smiley
I am  ashamed but i must say i see the 'shiftIn/ shiftOut' commands the first time.
I still get some errors when compiling, but i think i can fix it after some readings.
And i must solder the ADC on a adapter-PCB (MSOP) now to test during weekend.

regards
Wally
36  Using Arduino / Networking, Protocols, and Devices / Re: Interfacing ADS1244 on: October 24, 2012, 12:15:06 pm
Pylon,

already little simpler now, thank you.

 All kind of further help highly welcome

wally
37  Using Arduino / Networking, Protocols, and Devices / Re: Interfacing ADS1244 on: October 24, 2012, 11:01:10 am
Hi,

I'm preparing to try,
Yes, looks simple, but I'm not sure about the interface. Seems to be neither SPI nor I2C
It does not have a CS pin and usess 2 clocks, the system clock at 2,5 MHz.
I fear it's not entirely trivial.
I did not find anything useful on the web , e.g. example code

wally
 
38  Using Arduino / Networking, Protocols, and Devices / Interfacing ADS1244 on: October 24, 2012, 08:38:30 am
Hello,

does anybody know where to find an example code to drive
an ADS1244 ADC using its serial interface ?

http://www.bg-electronics.de/datenblaetter/Schaltkreise/ADS1244.pdf

thx wally
39  Using Arduino / Installation & Troubleshooting / Re: Arduino 1.0.1 Save as ... on: October 04, 2012, 01:34:48 pm
I can agree with everything you mentioned but this is not
an answer to any of my questions.

Maybe i do not recall correctly and Arduino IDE never uses
its own 'save as' dialog.

Does Arduino IDE never had its own 'save as' dialog ?

smiley
40  Using Arduino / Installation & Troubleshooting / Re: Arduino 1.0.1 Save as ... on: October 04, 2012, 12:59:08 pm
I'm nearly sure it was even in 1.0.1 an IDE-own 'save as'
dialog. Now it appears to be the save as dialog of the
underlying OS.

explaining what i wanted to say is:
let say actual project is 'MyProject_004'
and i want to save as 'MyProject_005'.
In the old method the dialog suggested the
actual project name and i just have to
increase the last number.
Now i must type the entire new project name

wally

btw. i tried with very old 0.19 and its the
same as 1.0.1, so i assume its defined in
preferences.txt and/or friends and should be
changeable so.



41  Using Arduino / Installation & Troubleshooting / Re: Arduino 1.0.1 Save as ... on: October 04, 2012, 12:34:54 pm
Yes, sorry, it saves the entire folder.
Is there a way to let 'save as' suggest the new folder name on
base of the actual projectname as it was in the former version ?
Is it possible to switch back to the old way ?
When it was changed ? i still have 1.0.1

wally   
42  Using Arduino / Installation & Troubleshooting / Arduino 1.0.1 Save as ... on: October 04, 2012, 06:16:39 am
Hi,

i did not use Arduino for a while and wanted to use it
now for editing some projects. When i do "Save as ..."
on a modified project, now an externeal (i think GTK)
save as appears and it stores only the actual single
project.ino. As far as i remember the Arduino IDE always
uses a new folder and saved all files from a project in
the preferred sketchbook.

Any ideas what i do wrong or whta i should check for ?

thx wally 
43  Using Arduino / Installation & Troubleshooting / Re: IDE Font Problem Arduino 1.0 on: March 14, 2012, 04:18:22 am
Yes, may be distro related. Kate and other editors are also distro related, if they rely on distro fonts.
Does Arduino IDE rely on distro fonts or use its own fonts ?
I think processing has a feature to create own fonts. But all this java stuff is beyound my  nderstanding.
So, for me it looks like Arduino has 3 files to set appearance:

~/.arduino/preferences.txt
~/IDE/arduino-1.0/lib/preferences.txt
~/IDE/arduino-1.0/lib/theme/theme.txt

very confusing all this stuff.
44  Using Arduino / Installation & Troubleshooting / Re: IDE Font Problem Arduino 1.0 on: March 14, 2012, 03:43:37 am
no smiley-sad
45  Using Arduino / Installation & Troubleshooting / IDE Font Problem Arduino 1.0 on: March 14, 2012, 01:40:28 am
 
I have problems to setup a clear readable monospaced font
for the editor.  I'm not sure but it looks as monospaced, plain
is substituted by some kind of sans serif on my system.
Antialiaing would be higkly welcome too.
This problem occurs with updating Arduino from 0.22 -> 1.0
and Opensuse 11.3 -> 12.1.
The attachment pic shows on the left  'kate' monospace
and on the right my Arduino IDE font.

Am working example preferences.txt is highly welcome.
thanks
wally     
Pages: 1 2 [3] 4 5 ... 10