Show Posts
Pages: 1 2 [3] 4
31  Using Arduino / Networking, Protocols, and Devices / DHCP *AND* DNS with Ethernet Shield Library on: February 07, 2013, 10:35:56 am
DHCP  *AND*  DNS with Ethernet Shield Library

Referring to the Repeating Web Client sketch example provided with the Arduino IDE 1.0.1

I've made this work using a static IP address and DNS Server, as in the example sketch.

Is it possible to use DHCP to get a DYNAMIC IP address, while still using a DNS server to resolve a web address ?

The synatax is Ethernet.begin(mac, ip, myDns) for static IP with DNS funtionality.
Just plain Ethernet.begin(mac) for dynamic IP with NO DNS functionality.
I tried Ethernet.begin(mac, , myDNS), but that didn't work.

What I'm trying to do is to get a DYNAMIC IP address yet retain DNS funtionality.

Thank you for helping me.

Bob W
32  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield SS pin 10 to Ground on: January 25, 2013, 02:10:59 pm
Reason for attempting this is that my "Arduino" is a "Bare Bones Board" (BBB) from moderndevice.com, and its form factor does not permit direct seating of the Shield onto the BBB.

I can happily connect the pins 10...
I just didn't understand why it was necessary.

Bob W.
33  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield SS pin 10 to Ground on: January 25, 2013, 02:05:46 pm
Quote
Not sure what you have done or why, but if you do not have an SD card in the SD slot on the w5100 ethernet shield, then the operation of the ethernet shield should be unaffected.

I removed the SD card that was in the slot - jumper between pins 10 still necessary for operation.
Must have to do with edge detection as suggested earlier.  I had not thought of this.

Bob W.
34  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield SS pin 10 to Ground on: January 25, 2013, 12:55:43 pm
But i wasn't grounding pin 10 of the Arduino !
I was grounding pin 10 of the Shield !
Which is NOT mounted on the Arduino.

How is my grounding pin 10 of the shield with a jumper any different than the Arduino grounding it programmatically ?

Bob W.
35  Using Arduino / Networking, Protocols, and Devices / Ethernet Shield SS pin 10 to Ground on: January 25, 2013, 11:40:29 am
Ethernet Shield SS pin 10 to Ground:

I'm using a Wiznet Ethernet Shield connected a Freeduino board via a six wire harness connecting their ICSP headers.  I am also connecting the boards' Ethernet SS pins (pins 10) to each other.  The boards are thus about a foot (30cm) apart.

This setup works great as a web server!

As I do not wish to use the SD service of the shield, I thought I could simply ground pin 10 locally on the Ethernet shield, thus permitting the elimination of the separate wire connecting the number 10 pins on the two boards.

But this causes my web server to NOT work any more !
Even after cold reboot.
Manipulating pin 4 seems to make no difference.


Question:  Why do the pins #10 need to be connected instead of just grounding pin 10 on the Ethernet Shield if I only want to use shield for Ethernet and not for SD ?

Thank you for helping me !

Bob W.
Rochester, NY USA
36  Forum 2005-2010 (read only) / Troubleshooting / Re: Unable to build Virtual USB Keyboard on: May 29, 2010, 08:12:49 am
When I plug the device in, this message pops up:

USB Device Not Recognized

One of the USB devices attached to this computer
has malfunctioned, and Windows does not
recognize it.

For assistance in solving this problem, click this
message.


I am using 1N5227B 3.6V 500mW Zener diodes.

LED on pin 13 comes on and stays on when board powers up, even if no other components are attached (5V power only)

37  Forum 2005-2010 (read only) / Troubleshooting / Unable to build Virtual USB Keyboard on: May 24, 2010, 04:32:46 pm
Built Virtual USB Keybord according to instructions in Practical Arduino Book.
Compiled using Arduino 0016 as instructed

Triple checked wiring.

Get message that says USB device not recognized.

When Arduino boots, the LED on pin 13 lights and stays lit.
Even when an (any) input button is pressed.
No characters sent to notepad.

Additional data:

Am using Modern Device Bare Bones Board.
Atmega328.
When done uploading, the light on the USB-BUB serial stays on.
It usually goes off after a successful upload.

Any thoughts on this ?

BobW
38  Forum 2005-2010 (read only) / Syntax & Programs / Re: Convert c code to pde sketch file on: July 03, 2009, 07:19:19 am
I'm sorry.
I did not know about the code button.
I see it now.
I will use it next time.

BobW
39  Forum 2005-2010 (read only) / Syntax & Programs / Re: Convert c code to pde sketch file on: July 02, 2009, 09:53:24 am
//***************************************************************************
//* A P P L I C A T I O N   N O T E   F O R   T H E   A V R   F A M I L Y
//*
//* Number               : AVR314
//* File Name            : "dtmf.c"
//* Title                : DTMF Generator
//* Date                 : 00.06.27
//* Version              : 1.0
//* Target MCU           : Any AVR with SRAM, 8 I/O pins and PWM
//*
//* DESCRIPTION
//* This Application note describes how to generate DTMF tones using a single
//* 8 bit PWM output.
//*
//***************************************************************************

#include <stdio.h>
#define __IAR_SYSTEMS_ASM__  
#include <io4414.h>
#include "ina90.h"

#define  Xtal       8000000          // system clock frequency
#define  prescaler  1                // timer1 prescaler
#define  N_samples  128              // Number of samples in lookup table
#define  Fck        Xtal/prescaler   // Timer1 working frequency
#define  delaycyc   10               // port B setup delay cycles

//************************** SIN TABLE *************************************
// Samples table : one period sampled on 128 samples and
// quantized on 7 bit
//**************************************************************************
flash unsigned char auc_SinParam [128] = {
64,67,
70,73,
76,79,
82,85,
88,91,
94,96,
99,102,
104,106,
109,111,
113,115,
117,118,
120,121,
123,124,
125,126,
126,127,
127,127,
127,127,
127,127,
126,126,
125,124,
123,121,
120,118,
117,115,
113,111,
109,106,
104,102,
99,96,
94,91,
88,85,
82,79,
76,73,
70,67,
64,60,
57,54,
51,48,
45,42,
39,36,
33,31,
28,25,
23,21,
18,16,
14,12,
10,9,
7,6,
4,3,
2,1,
1,0,
0,0,
0,0,
0,0,
1,1,
2,3,
4,6,
7,9,
10,12,
14,16,
18,21,
23,25,
28,31,
33,36,
39,42,
45,48,
51,54,
57,60};

//***************************  x_SW  ***************************************
//Table of x_SW (excess smiley-cool: x_SW = ROUND(8*N_samples*f*510/Fck)
//**************************************************************************

//high frequency (coloun)
//1209hz  ---> x_SW = 79
//1336hz  ---> x_SW = 87
//1477hz  ---> x_SW = 96
//1633hz  ---> x_SW = 107

const unsigned char auc_frequencyH [4] = {
107,96,
87,79};

//low frequency (row)
//697hz  ---> x_SW = 46
//770hz  ---> x_SW = 50
//852hz  ---> x_SW = 56
//941hz  ---> x_SW = 61

const unsigned char auc_frequencyL [4] = {
61,56,
50,46};


//**************************  global variables  ****************************
unsigned char x_SWa = 0x00;               // step width of high frequency
unsigned char x_SWb = 0x00;               // step width of low frequency
unsigned int  i_CurSinValA = 0;           // position freq. A in LUT (extended format)
unsigned int  i_CurSinValB = 0;           // position freq. B in LUT (extended format)
unsigned int  i_TmpSinValA;               // position freq. A in LUT (actual position)
unsigned int  i_TmpSinValB;               // position freq. B in LUT (actual position)

//**************************************************************************
// Timer overflow interrupt service routine
//**************************************************************************
void interrupt [TIMER1_OVF1_vect] ISR_T1_Overflow (void)
{
  // move Pointer about step width aheaed
  i_CurSinValA += x_SWa;      
  i_CurSinValB += x_SWb;
  // normalize Temp-Pointer
  i_TmpSinValA  =  (char)(((i_CurSinValA+4) >> 3)&(0x007F));
  i_TmpSinValB  =  (char)(((i_CurSinValB+4) >> 3)&(0x007F));
  // calculate PWM value: high frequency value + 3/4 low frequency value
  OCR1A = (auc_SinParam[i_TmpSinValA] + (auc_SinParam[i_TmpSinValB]-(auc_SinParam[i_TmpSinValB]>>2)));
}

//**************************************************************************
// Initialization
//**************************************************************************
void init (void)
{
  TIMSK  = 0x80;                     // Int T1 Overflow enabled
  TCCR1A = (1<<COM1A1)+(1<<PWM10);   // non inverting / 8Bit PWM
  TCCR1B = (1<<CS10);                // CLK/1
  DDRD   = (1 << PD5);               // PD5 (OC1A) as output
  _SEI();                                // Interrupts enabled
}

//**************************************************************************
// Time delay to ensure a correct setting of the pins of Port B
//**************************************************************************
void Delay (void)
{
  int i;
  for (i = 0; i < delaycyc; i++) _NOP();
}

//**************************************************************************
// MAIN
// Read from portB (eg: using evaluation board switch) which
// tone to generate, extract mixing high frequency
// (column) and low frequency (row), and then
// fix x_SWa and x_SWb
// row    -> PINB high nibble
// column -> PINB low nibble
//**************************************************************************

void main (void)
{
  unsigned char uc_Input;
  unsigned char uc_Counter = 0;
  init();
  for(;smiley-wink{
    // high nibble - rows
    DDRB  = 0x0F;                     // high nibble input / low nibble output
    PORTB = 0xF0;                     // high nibble pull up / low nibble low value
    uc_Counter = 0;
    Delay();                          // wait for Port B lines to be set up correctly
    uc_Input = PINB;                  // read Port B
    do
    {
      if(!(uc_Input & 0x80))          // check if MSB is low
      {
                                      // if yes get step width and end loop
        x_SWb = auc_frequencyL[uc_Counter];  
        uc_Counter = 4;
      }
      else
      {
        x_SWb = 0;                    // no frequency modulation needed
      }
      uc_Counter++;
      uc_Input = uc_Input << 1;       // shift Bits one left
    } while ((uc_Counter < 4));
 
    // low nibble - columns
    DDRB  = 0xF0;                     // high nibble output / low nibble input
    PORTB = 0x0F;                     // high nibble low value / low nibble pull up
    uc_Counter = 0;
    Delay();                          // wait for Port B lines to be set up correctly
    uc_Input = PINB;
    uc_Input = uc_Input << 4;    
    do
    {
      if(!(uc_Input & 0x80))          // check if MSB is low
      {
                                      // if yes get delay and end loop
        x_SWa = auc_frequencyH[uc_Counter];
        uc_Counter = 4;
      }
      else
      {
        x_SWa = 0;                
      }
      uc_Counter++;
      uc_Input = uc_Input << 1;
    } while (uc_Counter < 4);
  }
}

40  Forum 2005-2010 (read only) / Syntax & Programs / Re: Convert c code to pde sketch file on: July 02, 2009, 09:30:35 am
Cut and paste did not work.
Structure of file is not the same.
Fo example, rquired void loop() is not present.
Also problems finding "includes".

BobW
41  Forum 2005-2010 (read only) / Syntax & Programs / Convert c code to pde sketch file on: July 02, 2009, 08:48:36 am
Am new to Arduino.
Using Atmega 328.
Have mastered basic tasks.

Question:
I want to try some c code I downloaded (google: AVR314 - DTMF generator).
How can I convert the c code I downloaded to a pde sketch file usable by the arduino software?

Thank you.

BobW
42  Forum 2005-2010 (read only) / Syntax & Programs / Re: button array status poll via PORTD on: June 23, 2009, 10:04:04 am
Re: internal pull-up resistors

If I run this code:

pinMode(pin, input);
digitalWrite(pin, LOW);

Will the internal pull-up resistor be disconnected?

I'm NOT asking if it will pull the input DOWN.
I understand that that won't happen.

I have no practical need to do this.
I just want to understand this better.
Thank you.

BobW
43  Forum 2005-2010 (read only) / Troubleshooting / Convert int to boolean on: May 12, 2010, 07:39:01 am
Why does the code below print 5 instead of 2 ?
If I store 2 or 3 to a BOOLEAN variable, wouldn't it make the variable TRUE (1) ?

If I "bang" (negate) x and y TWICE before printing (!!x + !!y), I get 2 as I would expect.

Does this mean that boolean variables are really stored as whole bytes?

Code:
boolean x = 2;
boolean y = 3;
int z = 0;
  Serial.begin(9600);
  z = x + y;
  Serial.println(z, DEC);
44  Forum 2005-2010 (read only) / Troubleshooting / Re: IRremote lib compatible with SoftwareSerial lib ?? on: May 10, 2010, 08:43:32 pm
THANK YOU  Mr Paul S.  !!!

NewSoftSerial did the trick for me.

You da man !

Thanks for helping me!

BobW
45  Forum 2005-2010 (read only) / Troubleshooting / Re: IRremote lib compatible with SoftwareSerial lib ?? on: May 10, 2010, 04:15:14 pm
I did not know about NewSoftSerial.
Will look for it now.
Thank you.
Good advice.
Pages: 1 2 [3] 4