Loading...
  Show Posts
Pages: 1 ... 8 9 [10] 11
136  Using Arduino / Microcontrollers / Re: ATmega1284P: End to End using 1.0 IDE on: April 05, 2012, 06:40:22 pm
Since one has not been created don't worry, I can get it off of Eagle.  I just thought if one was generated it would easy to download it.

Thanks
wade
137  Using Arduino / Microcontrollers / Re: ATmega1284P: End to End using 1.0 IDE on: April 05, 2012, 01:54:46 pm
I tried to find the BOM for this board in the posts and I came up blank.

Has a BOM been generated?  If it exists does can someone post a link?

Thanks
wade
138  Using Arduino / Project Guidance / Re: Solar Tracker Project on: March 29, 2012, 10:49:46 am
Why not use a GPS to give you an accurate time and location fix and then calculate the position of the sun?  The algorithms for the location of the sun are very accurate and not computationally expensive so they would easily fit on your choice of MCU with a lot of headroom for the other code.

It has been a long time since I implemented solar location software so I do not have a link, but google is you friend.

wade
139  Using Arduino / Installation & Troubleshooting / Re: Seeeduino Stalker and a Cp2102 USB to UART convertor programming problem on: March 27, 2012, 04:10:54 pm
I don't think the 2302 and 2102 are that close as the datasheet for the 2102 has the RXD on pin 25 and TXD on pin 26.  I do not have the 9 pin connector only 6.  Another confusing issue for me is: I do not know what difference I would get if I connected the RXD and TXD directly from the pins of the chip and not the 6 pin connector provided.

I know I have the 5v and ground connected correctly as the program that was loaded on the board from the factory is running when I make the connections that I showed in the original post.

Thanks

wade
140  Using Arduino / Installation & Troubleshooting / Seeeduino Stalker and a Cp2102 USB to UART convertor programming problem on: March 27, 2012, 03:30:11 pm
I bought a couple of the version 1.0 of the Seeeduino Stalker (168), the price was great given the onboard RTC, battery backup, XBee adaptor, etc. 

I had purchased a couple of the Cp2102 USB to UART convertors and these (or similar) were needed as the Stalker does not have an onboard FTDI

I have the convertor connected to the Serial connector on the Stalker in the following fashion

Convertor                Stalker Serial Connector
5 V                               Vdd
Ground                         Ground
RX                                PD1(TXD)
TX                                PD0(RXD)
RST                              DTR

To test the system I just opened one of the examples, Blink, that did not work when I tried to upload.

For the board I chose all of the boards that had a ATMega168 onboard trying to find a mathc that would work and all I got was the "avrdude: stk500_getsync(): not in sync: resp=0x00" error

I have seen a couple of posts here and on the net that used the Cp2102 chip convertor successfully with the Arduino IDE and they made the same connections I did between the convertor and the board.  Is there a setting or configuration change I need to make in the IDE to get this combo running?

Thanks

wade
141  Using Arduino / Project Guidance / Re: Sensors on: March 18, 2012, 11:54:59 am
Digital elevation data (usually DTED data), baro-altimeter, GPS, and the human operator are probably the best ways to keep from unplanned UAV landings.  By knowing you GPS location you know the height of the land from the DTED data and use the baro-altimeter to stay above the ground.  The human operatror comes in by not telling the bird to go to low or having the situational awareness that there are tall trees in the area that you need to fly over that are not in your DTED data.

In a nut shell that is the way a lot of UAVs prevent unplanned landings.

wade
142  Using Arduino / Networking, Protocols, and Devices / Re: Xbee Api connection on: March 10, 2012, 11:17:42 am
Yes you can use the ADC's on the XBee to measure the accelerometer values and then report these values back to the coordinator in a regular defined fashion.
wade
143  Using Arduino / Networking, Protocols, and Devices / Re: serial read xbee on: March 08, 2012, 10:49:28 am
The code below should give you a start.  I have not tested it but it is the way I have done it a number of times.

Hope it helps,

wade

Code:
byte get_myByte();
int n_bytes;
byte discard, myByte
// I am assuming you have the packet coming into the receiving XBee and you have started Serial()

while(Serial.available() > 0)
{
  n_bytes = Serial.available();
  if(n_bytes >= 18)
  {
    if(Serial.read() == 0x7e)
    {
         for(int i = 1; i < 11; i++)
         {
              discard = Serial.read();
         }
         return(Serial.read());
    }
    // If you have gotten here you have an error so
    // return a value that signifies an error
  }
}
144  Using Arduino / Networking, Protocols, and Devices / Re: Xbee Api connection on: March 08, 2012, 10:33:33 am
Have you tried to set the sensor XBee to sample and send the data automatically?  You can set up which pins to sample and at what rate you want them sampled.

wade
145  Using Arduino / Storage / Re: Reading from a SD Card without a shield on: March 07, 2012, 01:15:01 pm
DigiKey shows they do not stock that item so it is a special order.  Would these http://search.digikey.com/us/en/products/SN74HC125DR/296-1192-1-ND/404905 work.

wade
146  Using Arduino / Networking, Protocols, and Devices / Re: XBee Node Discovery problem on: March 05, 2012, 11:41:57 am
Thanks for the helpful hints.  I had some problems with the first code dhunt posted and came up with code similar to his second posted code.

After doing extensive programming in FORTRAN for the last 30 years doing numerical analysis and only dabbling in C when needed I am not fully comfortable with pointers and structures yet.

Thanks

wade
147  Using Arduino / Networking, Protocols, and Devices / Re: XBee Node Discovery problem on: March 02, 2012, 07:08:15 pm
As I stated in my original post the code is rough and maybe my choice of variable names doesn't please all but to me they are self documenting.

Anyway, I was waiting too long to read in from the buffer.  I read all of the data into an array and then parsed it out and that worked.  Here is the code snippet that I used to read in from the network nodes
Code:
  start_t = millis();
 
  while(millis() - start_t < 10 * net_delay_time)
  {
    n_bytes = Serial1.available();
    if(n_bytes > 0)
    {
      for(int ij = 0; ij < n_bytes; ij++)
      {
        read_buf[i_count] = Serial1.read();
        Serial.print("n_bytes = ");Serial.print(n_bytes);
        Serial.print("i_count = ");Serial.print(i_count);
        Serial.print(" byte = ");Serial.println(read_buf[i_count], HEX);
        i_count++;
      }
    }
    delay(net_delay_time / 10);
  }


Thanks for the help,

wade
148  Using Arduino / Networking, Protocols, and Devices / XBee Node Discovery problem on: March 02, 2012, 04:41:54 pm
I am building a small network with about 10 XBee Series 2 transceivers and when I start up the network I want to do a node discovery to find all of the nodes on the network. 

I developed the code shown below and it works find when there are only 3 nodes, coordinator and 2 routers.  When I add additional nodes problems arise, the number of bytes read in is only 63.  The packet length for a node discovery response is 29.  The first two sets of 29 bytes of the 63 bytes are correct and correspond correctly to two of the routers on the net.

The code is rough right know so ignore the routines that get input from the user, this works fine and the node addresses are being parsed out correctly.  I think the problem lies in the following statement:

  n_bytes = Serial1.available();

Is there a buffer that is being overloaded when the 3rd or more router is added into the net?

Thanks for looking,

wade


Code:
#define max_Nodes 40
#define net_delay_time 10000 // How long to wait for modules top check in
int Verbose = 0;

// Function Prototypes
void node_discovery(void);
void send_packet(byte, int);
int get_node_number(void);
int get_UI(int);
int get_node_location(void);

int  n_sensors;
int i;
int add_start = 14;


byte Node_16_add_MSB[max_Nodes], Node_16_add_LSB[max_Nodes];
int node_location[max_Nodes], node_number[max_Nodes];

byte value;

void setup()
{
  Serial.begin(9600);  //  For serial monitor
   Serial1.begin(9600); // For XBee
   Serial.println("Initializing System");
   node_discovery();
}

void loop()
{
  while(1) {}
}


void node_discovery()
/* 
From Faludi page 291:
ND is an AT command that discovers and reports all RF modules
found.
*/
{
  int n_bytes;
  byte discard;
  int i_offset = 0;
  int curr_cnt;
  unsigned long bit_address, crap1, crap2, crap3, crap4;
 
 /*
  The packet below is from an example in the XBee Pro manual page
  57.
*/
byte ND_packet[] =
    {0x7E, 0x00, 0x04, 0x08, 0x01, 0x4E,0x44, 0x64};

    Serial.println("Inside node_discovery()");


send_packet(ND_packet, sizeof(ND_packet));

  delay(net_delay_time);  // Delay giving nodes time to respond
 
  n_bytes = Serial1.available();    // IS THE BUFFER BEING OVER LOADED?
 
  if(n_bytes  > 1)
  {
    discard = Serial1.read();

    if(discard == 0x7e)
      n_sensors = 1;
      { 
        for (i = 1; i < n_bytes; i++) {
          discard = Serial1.read();
           if(discard == 0x7E)
          {
            n_sensors++;
            i_offset =+ 29;
         }
          curr_cnt = i - i_offset;

//  Get lower 32 bits of current ZigBee address
        if(curr_cnt >= add_start & curr_cnt < add_start + 4)
        {
        if(curr_cnt == add_start)
          {
            crap1 = (unsigned long)discard << 0x18;
          }
          else if(curr_cnt == add_start + 1)
           {         
            crap2 = (unsigned long)discard << 0x10;     
           }
          else if(curr_cnt == add_start + 2)
           {
            crap3 = (unsigned long)discard << 0x08;
          }
          else  // no if as if you are here curr_cnt == add_start + 3
           {
            crap4 = (unsigned long)discard;
 //            Serial.print("Crap4 = "); Serial.println(discard, HEX);
            bit_address = crap4 | crap3 | crap2 | crap1; 

            // Output results
 
            Serial.print("Node with the 32-bit address ");
            Serial.print(bit_address, HEX);
            Serial.println(" checked in");
       
          }
        }
        if(curr_cnt > 7 & curr_cnt < 10)
        {
         
          if(curr_cnt == 8) // MSB of 16-bit address
          {
             Node_16_add_MSB[n_sensors] = discard;
          }
          else   // LSB of 16-bit address
          {
             Node_16_add_LSB[n_sensors] = discard;
 
          }
          }
         
          }


      }
  }
 
 
void send_packet(byte packet[], int n_bytes)
/*
This Routine just sends a packet out from the XBeePro Module, to send from
another radio system just change the function from XBeeSerial() to the new
radio serial port function and all is good.
*/
{
for (int ik = 0;ik < n_bytes;ik++)
  {
  Serial1.write(packet[ik]);

  }
}

149  Using Arduino / Programming Questions / Re: How to generate an interrupt from an analog signal on: March 27, 2011, 12:52:14 pm
Doug,

Maybe it was just me, but I let the smoke out a couple of Op Amps when I was starting off.  Remember most Op Amps are cheap so get some Op Amps and breadboard some of these circuits up and if you let some smoke out just think of the loss as a very low cost tuition.  The main thing is to get in and do something as that is where the learning starts.

wade

150  Topics / Science and Measurement / Re: Problem with a MAX 1272 12-bit ADC on: March 25, 2011, 09:36:26 am
As recommended by RuggedCircuits I turned the reference voltage down popped in a new ADC and all is good.  For once is was not my code but my failure to read the manual.  Also thanks robtillaart for the help on cleaning up the code that helps, C and its variants are not my first language, I am kind of a dinosaur as my first language was FORTRAN.

Thanks

wade
Pages: 1 ... 8 9 [10] 11