Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 10
16  Using Arduino / Sensors / AD654 Voltage-to-Frequency Converter ? on: November 03, 2012, 12:10:17 am
Hello,

I'm searching for code example to run Voltage-to-Frequency Converter
"AD654" on Arduino.

thx
wally
17  Using Arduino / Networking, Protocols, and Devices / Re: Interfacing ADS1244 on: October 26, 2012, 09:47:48 am
some fine tuning to make it human readable:
thanks a smart solution from "dhenry"

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\n");    // 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(300);
  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
   
  // process as int24_t (two's compliment 24bit) 
  value = ((signed long) (value << 8)) >> 8;   
   
   
  Serial.println(value, DEC);
  Serial.flush();

}


18  Using Arduino / Programming Questions / Re: 3Byte Two's Compliment on: October 26, 2012, 09:04:36 am
dhenry,


this is exactly what i meant by "smart"  :)

Thank you very much
wally
19  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
 



20  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
21  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();

}

22  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


23  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
24  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
25  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
 
26  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
27  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
28  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.



29  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   
30  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 
Pages: 1 [2] 3 4 ... 10