Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 1166
61  Using Arduino / Microcontrollers / Re: Atmega1284p Bootloader Problems on: July 02, 2014, 12:35:36 pm
Sounds like it could be that the 'Full Swing Crystal Oscillator' fuse byte option might help you. Change the  low byte fuse value to D6 and see if that helps. It was/is a noise problem with lots of standalone 1284P boards coupling noise between clock and serial input pin. Many found their serial com problems with 1284P completely cured when going with the 'full swing' option.

62  Using Arduino / Project Guidance / Re: AtMega328p to board.. on: July 02, 2014, 12:21:48 pm
Yes
63  Using Arduino / LEDs and Multiplexing / Re: LEDs in Reverse Bias on: July 02, 2014, 12:20:51 pm
Be very careful with an reverse bias experiments, common 20 mA leds tend to have a maximum +5vdc reverse bias voltage before breaking down and unless current limited can be destroyed.

64  Using Arduino / Programming Questions / Re: 1023 value in reading analog voltage on: July 02, 2014, 09:18:28 am
No question that the analogRead() returns ADC count values ranging from 0 to 1023, so 1024 possible values. Now if one should use 1023 or 1024 as the scaling value in any remapping of the value is a topic that always seems to keep coming up, with proponents for both values that claim it's a no brainer as to the correct value. I have no clue as to which is correct, but am surprised that it doesn't have a definitive mathematical provable answer.

 Come on software gurus, put this topic to bed once and for all.  smiley-wink

Coming at it from a hardware guy I have a more practical 'answer', it doesn't really matter at all because as far as it effecting the accuracy of the remapping calculation as the 0.1% difference probably pails in comparison of the raw accuracy specification of the ADC and basing the calculation assumption that the Avcc reference voltage being exactly +5.000000 vdc, which is probably never the case.






65  Using Arduino / Audio / Re: DTMF 2 tones, no Library on: July 01, 2014, 07:23:53 pm
In my opinion this is an example of the wrong tool for the job. Filtering the square wave DTMF frequencies to remove all the odd harmonics is going to require a lot of external components, which add costs, board space, and even then may not meet the DTMF rather strict electrical standards. A much better solution is to use a special purpose DTMF chip that the arduino controls.
Here is one example of a small 8 pin DIP IC and it's datasheet.

http://www.ebay.com/itm/HT9200A-DTMF-Generator-pic-micro-robot-control-/191211974617?pt=LH_DefaultDomain_0&hash=item2c851f2fd9

http://www.holtek.com.tw/english/tech/appnote/comm/pdf/ha0037e.pdf

66  Using Arduino / Programming Questions / Re: Discerning Arduino type from within Arduino program on: July 01, 2014, 07:06:14 pm
Sorry you're right, retrolefty. It should read:

Code:
const byte Leonardo = 1;
const byte Mega = 2;
#ifdef __AVR_ATmega32U4__
  const byte ArduinoType = Leonardo;
#elif __AVR_ATmega2560__
  const byte ArduinoType = Mega;
#endif

And obviously the Mega will have to be a Mega2560. But you get the idea.

Unless of course the mega board is the original mega 1280 board as I own.  smiley-wink
67  Community / Bar Sport / Re: Question about FAQ and Open Hardware. on: July 01, 2014, 04:00:50 pm
When I was young... the only "Solid State devices were lead sulphide or Galena "Cat whisker" detectors for AM broadcast band "Crystal Radio's", Some selenium and copper oxide rectifiers were just coming in vogue as replacements for Tungar or mercury vapor rectifiers..
 This was in 1956 I was 10 years old then... How old were You?

Doc

I'm just a year younger then you and I recall the CK-722 transistor being available around '57-'58, for $8 as I recall. Ordered one from Allied Electronics.

68  Using Arduino / Programming Questions / Re: The Software serial multple serial test example does not compile on: July 01, 2014, 03:44:06 pm
I see. I thought that the Software serial is what is used with GSM library.

Not sure what the GSM library is using but using (even if having to modify) it with hardware serial would be better in my opinion.

69  Using Arduino / Sensors / Re: OMEGA low flow meter wiring on: July 01, 2014, 03:41:56 pm
great, thanks for the reply. I am using http://www.omega.com/Manuals/manualpdf/M4172.pdf flowmeter. I am using an external 12V power supply for the flowmeter. So i think i can connect arduino gnd to flowmeter gnd and pwr supply gnd, flowmeter signal to arduino digital pin with internal pullup R enabled, and flowmeter power to external power.

 That should work fine. You could do without the 12vdc supply as that document says the flowmeter will work with down to +5vdc to the supply terminal which is available on the arduino 5V pin.

70  Using Arduino / Programming Questions / Re: The Software serial multple serial test example does not compile on: July 01, 2014, 02:23:56 pm
Just one question. If your using a mega board which has four internal hardware serial ports why are you fooling around with software serial? It will never perform as well as just using the hardware serial ports.

71  Using Arduino / Sensors / Re: OMEGA low flow meter wiring on: July 01, 2014, 02:11:16 pm
Hello, do you know what the output voltage of this device is? Thank you.

Being open collector output, it's whatever voltage you wire it to. The easiest way to wire that to a arduino is to just wire it's output pin to a arduino digital input pin, then ground wire to arduino ground pin. Then just enable the internal pull-up resistor for the digital input pin you use.

72  Using Arduino / General Electronics / Re: Why am I burning through Peltiers? on: July 01, 2014, 01:02:52 pm
The first Peltier element I ever played with back in the 80s was a disaster. It was rated as 12vdc so that is what I applied and I watched that in less then 1 min it completely unsolder itself into goo. Lesson learned is that peltier usage requires you know and understand the heat management needed for a specific application.

73  Using Arduino / Project Guidance / Re: AD9850 with mega on: July 01, 2014, 12:48:32 pm
I know its off topic for this thread but (sorry) its this thread in programming questions http://forum.arduino.cc/index.php?topic=252281.0 I don't  believe the op when he says his mega2560 is on com 3. So for upload what com port did the system give to your 2560?

As I under stood it the com port was arduino type dependant and not just picked at "random"by the OS.

So yes I am looking for the upload com port number.

Mark

Not dependent on the board type, but rather the USBserial converter used on a board. The PC will just assign the next unused com port number that it has assigned to a specific USB driver. Most of my boards utilize FTDI USB serial converters and I'm probably up to com 12 or higher. The lowest com port number I've seen assigned to one of my arduino boards is com 3 so that can certainly be a valid assignment for a specific board. Com 1 and 2 are usually reserved by the OS for support true hardware RS232 serial com ports even if a specific PC does not have such connectors.

74  Using Arduino / Project Guidance / Re: AD9850 with mega on: July 01, 2014, 12:01:57 pm
@hydrogen99, retrolefty. Which com port do you use for the mega2560? Its for another thread which has been driving us nuts for a day or 2.

Mark

 Strange question as my sketch does no serial communications. If you mean what com port was used to upload the sketch to it that is PC specific and when you first plugged in a specific board as that is when your PC assigns a com port to that specific board. Also nothing in that sketch is mega2560 board specific, it runs on a Uno, a Nano and any other basic arduino board. I don't even own a mega2650 board.
 
Or am I missing something in your question?

75  Using Arduino / Project Guidance / Re: AD9850 with mega on: July 01, 2014, 09:19:55 am
I use this short sketch for all my apllications
for running on an 2560



Code:
//AD9850 DDS test

#define DDS_CLOCK 125000000

#define  CLOCK  8  //pin connections for DDS
#define  LOAD 9
#define  DATA  10
#define  RESET 11


void setup()
{
  pinMode (DATA,  OUTPUT);
  pinMode (CLOCK, OUTPUT);
  pinMode (LOAD,  OUTPUT);
  pinMode (RESET, OUTPUT);
 
  AD9850_init();
  AD9850_reset();
  SetFrequency(28000000);
}
void SetFrequency(unsigned long frequency)
{
  unsigned long tuning_word = (frequency * pow(2, 32)) / DDS_CLOCK;
  digitalWrite (LOAD, LOW);

  shiftOut(DATA, CLOCK, LSBFIRST, tuning_word);
  shiftOut(DATA, CLOCK, LSBFIRST, tuning_word >> 8);
  shiftOut(DATA, CLOCK, LSBFIRST, tuning_word >> 16);
  shiftOut(DATA, CLOCK, LSBFIRST, tuning_word >> 24);
  shiftOut(DATA, CLOCK, LSBFIRST, 0x0);
  digitalWrite (LOAD, HIGH);
}

void AD9850_init()
{

  digitalWrite(RESET, LOW);
  digitalWrite(CLOCK, LOW);
  digitalWrite(LOAD, LOW);
  digitalWrite(DATA, LOW);
}

void AD9850_reset()
{
  //reset sequence is:
  // CLOCK & LOAD = LOW
  //  Pulse RESET high for a few uS (use 5 uS here)
  //  Pulse CLOCK high for a few uS (use 5 uS here)
  //  Set DATA to ZERO and pulse LOAD for a few uS (use 5 uS here)

  // data sheet diagrams show only RESET and CLOCK being used to reset the device, but I see no output unless I also
  // toggle the LOAD line here.

  digitalWrite(CLOCK, LOW);
  digitalWrite(LOAD, LOW);

  digitalWrite(RESET, LOW);
  delay(5);
  digitalWrite(RESET, HIGH);  //pulse RESET
  delay(5);
  digitalWrite(RESET, LOW);
  delay(5);

  digitalWrite(CLOCK, LOW);
  delay(5);
  digitalWrite(CLOCK, HIGH);  //pulse CLOCK
  delay(5);
  digitalWrite(CLOCK, LOW);
  delay(5);
  digitalWrite(DATA, LOW);    //make sure DATA pin is LOW

    digitalWrite(LOAD, LOW);
  delay(5);
  digitalWrite(LOAD, HIGH);  //pulse LOAD
  delay(5);
  digitalWrite(LOAD, LOW);
  // Chip is RESET now
}


void loop()
{
// read the state of the pushbutton value:
  probeState = digitalRead(probePin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (probeState == HIGH) {     
    // turn LED on:
   SetFrequency(28001000);   
    digitalWrite(ledPin, HIGH); 
  }
  else {
    // turn LED off:
      SetFrequency(28000000);
    digitalWrite(ledPin, LOW);
  }
}


Nice and useful. However it doesn't compile as posted, missing a few pin assignments and one variable assignment.

 Try this one, compiles on my machine.

Code:
//AD9850 DDS test

#define DDS_CLOCK 125000000

#define  CLOCK  8  //pin connections for DDS
#define  LOAD 9
#define  DATA  10
#define  RESET 11
#define  probePin 12
#define  ledPin 13

void setup()
{
  pinMode (DATA,  OUTPUT);
  pinMode (CLOCK, OUTPUT);
  pinMode (LOAD,  OUTPUT);
  pinMode (RESET, OUTPUT);
  pinMode (probePin, INPUT);
  pinMode (ledPin, OUTPUT);
 
 
  AD9850_init();
  AD9850_reset();
  SetFrequency(28000000);
}
void SetFrequency(unsigned long frequency)
{
  unsigned long tuning_word = (frequency * pow(2, 32)) / DDS_CLOCK;
  digitalWrite (LOAD, LOW);

  shiftOut(DATA, CLOCK, LSBFIRST, tuning_word);
  shiftOut(DATA, CLOCK, LSBFIRST, tuning_word >> 8);
  shiftOut(DATA, CLOCK, LSBFIRST, tuning_word >> 16);
  shiftOut(DATA, CLOCK, LSBFIRST, tuning_word >> 24);
  shiftOut(DATA, CLOCK, LSBFIRST, 0x0);
  digitalWrite (LOAD, HIGH);
}

void AD9850_init()
{

  digitalWrite(RESET, LOW);
  digitalWrite(CLOCK, LOW);
  digitalWrite(LOAD, LOW);
  digitalWrite(DATA, LOW);
}

void AD9850_reset()
{
  //reset sequence is:
  // CLOCK & LOAD = LOW
  //  Pulse RESET high for a few uS (use 5 uS here)
  //  Pulse CLOCK high for a few uS (use 5 uS here)
  //  Set DATA to ZERO and pulse LOAD for a few uS (use 5 uS here)

  // data sheet diagrams show only RESET and CLOCK being used to reset the device, but I see no output unless I also
  // toggle the LOAD line here.

  digitalWrite(CLOCK, LOW);
  digitalWrite(LOAD, LOW);

  digitalWrite(RESET, LOW);
  delay(5);
  digitalWrite(RESET, HIGH);  //pulse RESET
  delay(5);
  digitalWrite(RESET, LOW);
  delay(5);

  digitalWrite(CLOCK, LOW);
  delay(5);
  digitalWrite(CLOCK, HIGH);  //pulse CLOCK
  delay(5);
  digitalWrite(CLOCK, LOW);
  delay(5);
  digitalWrite(DATA, LOW);    //make sure DATA pin is LOW

    digitalWrite(LOAD, LOW);
  delay(5);
  digitalWrite(LOAD, HIGH);  //pulse LOAD
  delay(5);
  digitalWrite(LOAD, LOW);
  // Chip is RESET now
}


void loop()
{
// read the state of the pushbutton value:
  int probeState = digitalRead(probePin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (probeState == HIGH) {     
    // turn LED on:
   SetFrequency(28001000);   
    digitalWrite(ledPin, HIGH); 
  }
  else {
    // turn LED off:
      SetFrequency(28000000);
    digitalWrite(ledPin, LOW);
  }
}

Pages: 1 ... 3 4 [5] 6 7 ... 1166