Show Posts
Pages: 1 ... 12 13 [14]
196  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Using the Bluetooth module on the ArduinoBT on: January 10, 2008, 10:04:28 am
Woohoo - its working smiley-grin

bigengineer - your set control escape line that you gave didn't work. I changed it to:

Code:
Serial.println("SET CONTROL ESCAPE 43 00 0");

and the thing burst into life.

Sending the command INQUIRY 5 NAME returned the following:

Code:
READY.
INQUIRY 5
INQUIRY 00:0b:0d:4d:fb:f8 020104
INQUIRY 00:10:60:10:76:06 020340
INQUIRY 00:05:c9:fa:71:16 520204
INQUIRY 00:1a:75:f4:44:aaNAME 00:0b:0d:4d:fb:f8 "MWLAPTOP"
NAME 00:10:60:10:76:06 "BTAP-7606"
NAME 00:05:c9:fa:71:16 "banana LG"
NAME 00:1a:75:f4:44:aa "K550i"
NAME 00:18:13:08:c9:98 "What? "

it can be seen that there are some transmission errors somewhere in the data transfer. I wonder if the AVR can keep up with the serial data from the WT-11 when it is writing to the EEProm.

The code I used was:

Code:
#include <EEPROM.h>

int ledPin = 13;                // LED connected to digital pin 13
int resetPin = 7;                  // BT module uses pin 7 for reset
char inByte = 0;                // incoming serial byte
int  infoSize = 0 ;
void setup()                    // run once, when the sketch starts
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  pinMode(resetPin, OUTPUT);  
  Serial.begin(115200);        // start serial at 115200 kbs
  
  Serial.println("SET CONTROL ESCAPE 43 00 0");
}

void loop()
{
  // if we get a valid byte, read analog ins:
  if (Serial.available() > 0) {    
    inByte = getbyte();  // get incoming byte
    if (inByte == '&' ) { // look for a &
        Serial.print("Got an &  ");
      infoSize = getInfo();
        Serial.println("Done");
    }
    else if (inByte == '@' ) { // look for a 0
      digitalWrite(ledPin, LOW); // set led LOW
      Serial.print("Get string:  ");  
      for(int i=0;i<infoSize;i++)
      {
        Serial.print(EEPROM.read(i));
      }
      Serial.println();
      Serial.print("Cleared string  size: ");
      Serial.println(infoSize);
    }        
  }
}

int getInfo()
{
  int j=0;
  digitalWrite(ledPin, HIGH); // set led HIGH
  delay(2000);  
  Serial.print("+++");
  delay(2000);

  Serial.println("INQUIRY 5 NAME");
  for (int i=0; i <= 10; i++){
    delay(1000);
    while (Serial.available() > 0 && j <512) {    
      inByte = getbyte();  // get incoming byte    
      EEPROM.write(j, inByte);
      j++;
    }
    delay(1000);
  }  
  delay(2000);
  Serial.print("+++");
  delay(2000);
  digitalWrite(ledPin, LOW); // set led low
  return j;
}

char getbyte()
{
  while (Serial.available() == 0) { //look for aviable data
    // do nothing, wait for incoming data
  }
  return Serial.read(); //return data if aviable
}

There is still some work to do - finding the cause of the transmission errors and I guess some external SRAM is required as it looks like the string data back from the WT-11 could easily exceed the EEProm and ram in the AVR.

Regards,

Mike
197  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Using the Bluetooth module on the ArduinoBT on: January 08, 2008, 04:19:16 am
That's great, thank you. I'll give it a try this evening.

Is the command/data mode change over quicker if using the hardwired mode, do you know?  I haven't seen long delays mentioned in the datasheets.

Regards,

Mike
198  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Using the Bluetooth module on the ArduinoBT on: January 07, 2008, 12:04:48 pm
That seems like a decent project.  What are you going to use for a temp sensor?

I was looking at using a Dallas Semi temp sensor that was aimed at battery packs. It periodically sensed the temperature and maintained a histogram type table. It had one of their 1-wire interfaces so was easy to use. I'll see if I can find a part number for it.

Mike
199  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Using the Bluetooth module on the ArduinoBT on: January 07, 2008, 10:37:01 am
Thanks for your reply - I'll change the escape sequence so that it expects "+++" and see how I get on then.

I've been reading the documentation - its going ok, but the bit that seems vague is the Arduino interface - once I have that sorted I'll get stuck in properly.

My project?  At the moment I'm just toying with some ideas relating to proximity marketing - sending vcards, text, images and MP3s. Do you have experience sending these items?

Thanks again,

Mike

200  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Using the Bluetooth module on the ArduinoBT on: January 06, 2008, 08:18:10 am
OK - I need some help on this one.

Looking at the code in the thread I mentioned in my last post, the AVR swaps the WT11 between command and data modes using the escape sequence "+++" preceded and followed by a 2 second delay.  This is confirmed by the iWrap manual: http://www.bluegiga.com/default.asp?file=210

Looking at the initialiasation sketch: http://www.arduino.cc/en/Main/ArduinoBTInitializationSketch

we have the following line:

Code:
Serial.println("SET CONTROL ESCAPE - 00 1");

according to the iWrap manual, this disables the escape sequence :o and sets the wt11 to command mode when the PIO0 goes low. I can't see a PIO0 on the schematic http://www.arduino.cc/en/uploads/Main/arduino_bt06.pdf and no wiring to any of the GPIO pins.

So, moving forward:

1) is it possible to use a different SET CONTROL ESCAPE command in my sketch to enable the +++ esacpe sequence?  I'm concerned that doing so will make the communication to the PC stop and I'd then have an unusable Arduino;

2) is using a hardwired link to one of the wt-11 PIO pins preferable?

Thanks,

Mike
201  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Using the Bluetooth module on the ArduinoBT on: January 06, 2008, 12:40:16 am
To answer my own question -- this has been discussed in the following thread:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1181825471

I am having some trouble getting this going, so maywell be back for some more help.

Regards,
Mike
202  Forum 2005-2010 (read only) / Frequently-Asked Questions / Using the Bluetooth module on the ArduinoBT on: January 05, 2008, 04:51:41 pm
So my ArduinoBT arrived today smiley-grin  it semed like a long wait especially with Christmas holidays slowing the post.

I have it flashing LEDs (ok one LED) and sending serial data back to my PC over bluetooth. It was  pretty easy to get it up and running all things considered.

Its all very well using the WT11 as a virtual serial cable, but what I'm really looking to do is use the WT11 to interface with mobile phones / PDAs.
  
Is it possible to keep the serial link to the PC alive and use the other bluetooth channels (there are 7 right?) to contact other devices?

What would be a great start would be code that sent a list of nearby bluetooth devices back to the PC. Is there any code available for this?

Can anyone point me in the right direction?

Thanks for your halp,

Mike
203  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Arduino digital delay? on: January 08, 2008, 04:48:07 am
It does depend on the audio bandwidth you are looking for and the delay times.

Some years ago I worked on a system for digitizing voice (approx 100Hz to 3kHz). I used a Dual Slope Delta Modulation technique to digitise the incoming audio - the thing about it is it digitises to a bit stream.

There are some largish serail ram chips - the serial stream could be packaged into 8 bits written in using SPI and read out from a different address in order to get the delay.

I think an arduino could handle this.

Mike
204  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: How fast is an Arduino ... on: December 28, 2007, 04:20:01 am
Thanks, kg - very informative.

It is not part of a project - I'm just trying to get to grips with the system.  It is always possible that the Arduino environment would put a significant overhead on the code and that the c compiler would produce complete rubbish (I have seen some bad assembler produced by c compliers in my time).

Using your last code snippet:

Code:
while(1)
  {
    PORTB = 0x40; // set pin 13 to high, all other port B pins low
    PORTB = 0x00; // set pin 13 and all other port B pins low
  }

one would hope that would end up as 2 single instructions and a goto. If so, and the goto also takes a single clock cycle, we're looking at a ~33% duty cycle with 5.3MHz frequency.

Not too shabby.

As you say, the Arduino system also does some periodic stuff - keeping track of milli seconds, for example, so my nice output will be interrupted from time to time.

Mike

205  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: How fast is an Arduino ... on: December 27, 2007, 08:56:55 am
Thanks for that, Mellis, much appreciated.

I guess this is something I'll be able to look at when my board arrives, but I'm trying to get a handle on the performance of the system before then.

If not 50% duty cycle, then what would I expect to see? >49% or more like 40%?

Any idea what frequency this will go at?

Like I said, I'm really just trying to get a handle on the performance of the system, rather than actually doing this.

Cheers,

Mike
206  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: How fast is an Arduino ... on: December 27, 2007, 08:35:21 am
Thanks for your reply ... looking at the forum you suggest, there is a little Arduino info, but not much. My questions were pretty much Arduino specific, so I should hope an authoritative answer would be available here.

Regards,

Mike
207  Forum 2005-2010 (read only) / Frequently-Asked Questions / How fast is an Arduino ... on: December 27, 2007, 07:34:25 am
First post, and new to Arduinos, but not electronics or Microcontrollers.

I havea few questions whilst I wait for my Arduino to arrive:

1) How fast does an Arduino output go up and down with this code:

Code:
int outPin = 13;                
void setup()
{
  pinMode(outPin, OUTPUT);
}
void loop()
{
  digitalWrite(outPin, HIGH);
  digitalWrite(outPin, LOW);  
}

and would it be a square wave?

2) Is the C-like source code compiled to native AVR instructions or some intermediate code that is interpreted by the AVR at run time?

Thanks,

Mike
Pages: 1 ... 12 13 [14]