Author Topic: bluetooth controlled robots  (Read 22396 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
bluetooth controlled robots
« on: July 20, 2006, 07:54:50 AM »
question . . .

so i want to control and program my robots wirelessly through bluetooth.

i plan to use this controller:
http://wiring.org.co/ioboard/index.html
it already operates through usb . . .

from the computer side i know i can just buy a usb bluetooth dongle for it to work, but from the microcontroller side what do i hook up to the usb output? and how do you recommend me powering it?

i also found this, but it is still confusing:
http://www.sparkfun.com/commerce/present.php?p=Bluetooth%20Primer

thoughts?

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: bluetooth controlled robots
« Reply #1 on: July 21, 2006, 07:40:23 PM »
before i start, a side note on USB.
there are 2 types of USB port: host and device.
the kind on your laptop is a host port.
the kind you plug into a host port is a device port. you will find device ports on keyboards, mice, bluetooth dongles and on the Wiring board you intend to use for this project.
you will not be able to plug another device port into the device port on the Wiring board. sad but true.

the sparkfun article you point out is still an option though.
so most of that sparkfun article covers setting up the bluetooth dongle on your computer.
the BR-SC11A bluetooth module is the interesting bit.

the BR-SC11A bluetooth module pairs with the bluetooth on your computer and emulates a serial port.
as far as your project and computer are concerned both bluetooth devices are just seen as a serial port and cable.
the BR-SC11A has a TX and RX pin that you would just connect to the UART on your microcontroller.
according to the specs of your chosen microcontroller you have a regular "Hardware Serial Port" or UART as well as the fancy USB one.
the BR-SC11A will connect to the regular UART not the USB port.
when you open hyperterminal (or similar) on your PC, any character you type will make it's ASCII value appear on the UART register on your micro.

i'm guessing you would still need to program the Wiring board via it's USB interface and access the UART from within your program. not sure about this point. maybe the Wiring board can be programmed over either.

so the BR-SC11A works @ 3.5volts so you'll need a 3.5V regulator to drop the voltage.
not sure how you will (or if you will need to) convert between the 3.5V and 5V on the TX and RX pins.
some sort of level shifter to adjust between the 5V and 3.5V signals would be ideal but the guy in the sparkfun doc got it working without. not sure if it would be a good idea to run this way for a long time....

i've had a sort of similar thing running using these: http://www.lprs.co.uk/main/product.info.php?productid=199
i used a pair of these between a PCs serial port (via a MAX232 level shifter) and a PIC's UART.
(the level shifter is required because PC serial ports operate at 12V or more where as most microcontrollers use logic level. ie. 5V.)
so the way to get things working is to first experiment with an actual serial cable between a PCs serial port (via a MAX232 level shifter) and your board's UART.
once you get your program working, substitute the serial cable with your wireless link. (or in your case the bluetooth link.)

i tried to find a bluetooth device like the one you are looking at but they didn't exist at the time. it was a couple of years ago. i'm kind of excited they are now on the market.

hope this clears things up a little.
if i'm off on a tangent again please let me know and i'll try to clear things up.

dunk.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #2 on: July 25, 2006, 07:42:20 AM »
Ok I should better describe my problem. I am working on a robot fish, and I have realized that programming it will be a problem.

For example, if I wanted to make a program change, I would have to:
take it out of the water
drain and dry it
disassemble part of it
open water proof seals
connect cable and program
reseal/assemble everything

Way too much effort for tweaking a single variable . . .

So the ability to wirelessly reprogram it is a must.

The wiring site has this tutorial:
http://wiring.org.co/learning/tutorials/wireless.html
But unfortunately they emphasize (in caps) that "YOU CANNOT USE BLUETOOTH WIRELESS TO UPLOAD PROGRAMS TO THE BOARD"  :'(

I dont necessarily require the wiring board, anything atmel/PIC/stamp based would be fine. But I do require at least 20+ digital I/O, 8+ ADC, and wireless reprogrammability. I have the money so if money can buy it, I'd rather not struggle making it.

I was thinking of perhaps using a usb to serial converter like this:
http://www.pololu.com/products/pololu/0391/
or
http://ucables.com/ref/USB-RS232
and connecting it to this:
http://www.zbausa.com/bluetooth_serial_port_adapter.asp
Think it will work? The drivers requirement kinda worries me though . . .

I also found these other interesting links (wont work in my case, but could for someone else):
https://courses.ece.uiuc.edu/ece395/projects/spring2006/project5_final_paper.doc

http://www.linxtechnologies.com/index.php?section=products&category=rf_modules&subcategory=lr_series
« Last Edit: July 25, 2006, 08:01:08 AM by Admin »

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: bluetooth controlled robots
« Reply #3 on: July 25, 2006, 06:52:40 PM »
robot fish? you don't pick the easy problems do you?

from your links i see the way you are thinking.
you want to connect a USB to serial adapter to the wiring board then a serial to bluetooth adapter connected to that.
unfortunately the part of this that will not work is plugging a USB to serial adapter to the USB port on the wiring board. both these USB ports are USB DEVICE ports. for this to work the wiring board would require a USB HOST port instead and would require drivers to be written for it and probably other stuff i'm not aware of.

the limitation i see here is the wiring board only allowing programming via the USB port.
if it also allowed you to program via the regular serial port it would work.
if you can find a controller you like that allows you to program via a standard serial port (or UART) then i see no reason why you couldn't connect the bluetooth module to the serial port.
the bluetooth adapter on your PC sees the bluetooth module as an emulated serial port so whatever software you are using to program your controller will not notice that this is a bluetooth link rather than a serial cable.
as far as your PC is concerned, it thinks it's bluetooth port is a regular serial port.
as far as your microcontroller is concerned the bluetooth module's TX and RX pins appear the same as a regular serial cable's TX and RX pins.

i've never played with this option but i've seen bootloader code on the net that allows you (once flashed to your microcontroler via regular means) to upload programs via the micro's serial port.
i've seen such bootloaders for atmels and PICs.
maybe you could convert such a bootloader to run on the Atmel ATMega128 based wiring board.
rather than describe bootloaders in more detail, here's a link the nice people at google found for me doing just that:
http://hubbard.engr.scu.edu/embedded/avr/bootloader/index.html

just for the sake of conversation....
you say you have resources to throw at this. if you have a reasonable budget these may be worth considering:
http://gumstix.com/platforms.html
these processors run Linux so you have a choice of many programing languages. they draw only a few hundred mA, are really small (hence the gumstix name), some have bluetooth built in but interestingly with one of the addons you get wireless ethernet too!
they also do breakout modules aimed at robotics enthusiasts:
http://gumstix.com/spexExpnsion.html
just think, no complicated programmer, just telnet in and edit your code from within a proper realtime OS. all for around $200.

i've been itching to invest in one of these but unfortunately my current project needs a USB host port to run a webcam and the gumstix only have USB device ports (so far).

dunk.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #4 on: July 26, 2006, 08:10:04 AM »
Ive done all the easy stuff, only hard problems left  ;)

Yea i didnt think the usb->serial adaptor would work without the drivers. Know of any self-contained adaptors that do not require drivers?

So im looking at the gumstix connex 400xm-bt board.
http://gumstix.com/spexconnex.html
Looks very promising . . . still looking into it. The manual wasnt too clear on this, but seems I can program in C++, then upload to compile the code with g++ right on the gumstix board itself, all through bluetooth wireless.

I am trying to figure out how I can control my 20+ servos on this thing. I noticed it has a 92 pin bus header:
http://svn.gumstix.com/gumstix-hardware/Eagle/lbr/CONNEX.PNG
Think I can make 20+ independent square waves on those pins? Probably about 25ms (~1.2ms/servo) average of wasted processing time there . . . but cant figure out any other way around it . . .

Found some servo gumstix sample code here:
http://www.gumstix.org/tikiwiki/tiki-index.php?page=Robostix-Simple-Servo

Thoughts?

As for the avr bootloader program, seems simple. So after I upload this bootloader .hex file through usb to the wiring board, I will be able to reprogram the avr through the uart with bluetooth (as described in the previously mentioned bluetooth tutorial links), correct?

Until now bootloading has been magic to me . . .
« Last Edit: July 26, 2006, 08:17:59 AM by Admin »

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: bluetooth controlled robots
« Reply #5 on: July 26, 2006, 09:05:58 AM »
i haven't seen anything that would do what you want with the USB -> bluetooth link.
i doubt it's possible without putting a processor capable of running a USB host port in between.

so with the gumstix board,
it's basically an ARM processor running Linux. this means that you can run dozens of different programming languages.
yes you can compile C++ programs on board, all through bluetooth.
you can run lots more fun programmes on board too. run a web server for example so anyone with a nearby PC can controll your bot.

i'm running Linux on a different ARM platform on my latest bot (http://www.nslu2-Linux.org/) and i'm using python for proof of consept programming stuff because it's so quick and easy to get code up and running.
it's a different platform but if you decide to go this route i can give you lots of pointer when it comes to running the Linux operating system although there are bound to be some complications on embedded hardware.

although it's probably possible to use the GPIO pins on the gumstix 92 pin bus header, it looks like there are easier ways.
what you want is one of the expansion cards: http://gumstix.com/store/catalog/index.php?cPath=31
either get one of the dedicated robot controller boards: http://docwiki.gumstix.org/Robostix
and do this: http://docwiki.gumstix.org/Robostix_simple_servo
or there are also expansion boards that give you a simple serial port. you could connect the UART on a separate PIC micro controller to use that a servo conroller.

putting such a powerfull processor on there really is overkill but that can be fun too right?

so on to bootloaders,
like i say, i've never used one my self either but yes, you have the idea.
the booloader programme sits in the first section of memory and when told to saves input from the UART in program memory.
you won't actually be reprogramming the micro as such as the bootloader code will always remain the same.
the bootloader is either saving any uploaded program into the remaining memory after the bootloader or directing the microcontroller to run that code.
a bootloader won't care if the incoming program is over bluetooth or serial line as long as you can get the program to it without errors.


dunk.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #6 on: July 26, 2006, 02:51:07 PM »
An additional complication that we missed . . .

Bluetooth operates at around 2.45 GHz, which is at the microwave range. Guess which frequency water absorbs best? Microwaves . . .  :(
(for details see http://www.lsbu.ac.uk/water/microwave.html)

So I cant use bluetooth for the robot fish (unless I want to cook pizza) . . . But lower frequencies (lower the better) will probably work. I only need like 50ft range max in chlorinated water.

Looking at this transeiver (similar to what you posted earlier, but lower frequency):
http://www.lprs.co.uk/main/product.info.php?productid=154

How exactly did you interface it between the microcontroller UART and your PC? I am assuming just connect pins 5 and 6 to the UART, and a 2nd module has pins 5 and 6 connected to the tx/rx lines of the PC USB. Think I need to worry about pins 4 (busy output) and 7 (host ready input)?

I think I'll write a good tutorial on this as soon as I figure it out . . . definitely not easy stuff . . .  :-\

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: bluetooth controlled robots
« Reply #7 on: July 26, 2006, 07:15:57 PM »
o well. back to the drawing board.

so for the easy radio modules you will be using them between the microcontroller's UART and the PC's serial port. (the com port *not* the USB port.)

the first thing you need to do  is test the communication between your PC and the microcontroller.
this article describes the process quite well:
http://www.oz1bxm.dk/PIC/628uart.htm

next you want to put your transceivers between the max232 chip and the PIC.
the PC end of the circuit is drawn on page 19 of this data sheet:
http://www.lprs.co.uk/main/viewdatasheet.php?product_id=154&datasheetref=151

for anyone else reading this if you only want one way communication you don't need such complicated transceivers but only a single transmitter and receiver like these:
http://www.sparkfun.com/commerce/product_info.php?products_id=383
but Admin, you will need the transceivers as you want to program the microcontroller over this link so you will need 2 way communication to allow a checksum to make sure there was no data loss wile programming.
(a transmitter transmits. a receiver receives. a transceiver both transmitts and receives at the same time.)

dunk.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: bluetooth controlled robots
« Reply #8 on: July 31, 2006, 05:17:07 PM »
hey, i just had a thought,
you're problem with radiowaves through water,
why not use infrared? light passes through water just fine.

i have had IR working over a PIC's UART in simplex (one direction) with the baud rate right down low.
so to get 2 way working you would need to have a transmitter and receiver at both ends.

you would need to accept that you could only communicate with your fish when it's pointing it's receiver/transmitter array at the base station (either that or cover either the pond or the fish in transmitters and receivers.)
also only a solution for line of sight operation in clear water.

anyway, here's a couple of links to explain the principal:
http://www.xs4all.nl/~sbp/knowledge/ir/ir.htm
http://users.frii.com/dlc/robotics/projects/botproj.htm

it's not a great solution due to afore mentioned limitations but might just suit your application.

dunk.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #9 on: July 31, 2006, 06:37:04 PM »
Interestingly, today by accident I found this waterproof bluetooth module:
http://www.bulgin.co.uk/HTMLDocs/news/BluetoothBuccaneerPR.htm

Yea the line of site issue is why I decided not to do IR, although I did consider it.

I am currently working on using those RF modules with an atmel and rs232. Will probably take awhile to design and make it tho, a month or two . . . Ill post an article on it with schematic and code when its done.

Offline Nyx

  • Robot Overlord
  • ****
  • Posts: 204
  • Helpful? 0
Re: bluetooth controlled robots
« Reply #10 on: July 31, 2006, 10:27:08 PM »
Well, you mention drying and opening the robot to reprogram it but... For the sake of simplicity... Why not have an external serial plug?

You could make some sort of plug that you leave outside of the robot in the water all the time? That way, only need to get the robot out and plug it. With that kind of voltage, there is no real danger of a short happening (water, unless you add large quantities of electrolytes, is just not that conductive). Plus you could always have some simple circuit to prevent shorts if you're paranoid, or even a simple screw-on cap (like a sawed off aspirin pill box) over the plug in question.

For ease of use, you could use 3.5mm connectors:

« Last Edit: July 31, 2006, 10:30:15 PM by Nyx »

Offline RoboHobby

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: bluetooth controlled robots
« Reply #11 on: December 16, 2006, 01:23:16 AM »
Hi,

We use another approach:

BlueTooth enable phone resides on small robot.
PC (under Linux) sends commands to the phone (left, right, forward, etc.).
Phone do moving and do snap (capture one image).
Image is saved on the phone.
PC get image from the cell phone.
Robot’ brain (or user) make decision – where to go next.
PC sends command to cell phone, etc.
...

See www.RoboHobby.com



Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: bluetooth controlled robots
« Reply #12 on: December 16, 2006, 02:59:47 PM »
Hey Admin.
I'm currently using the gumstix+robostix combo and it works pretty well...
I don't think you'll be able to get fine resolution on that 92 pin header because that is connected
to the Linux Kernel(unless you start looking at the Real Time Linux Patches). However the compiling on host computer and sending over bluetooth works just fine, but I'd recommend a Linux setup if you are going to do that. What I do is I long into the gumstix over bluetooth and in another window on my host computer compile and send the .hex file to the gumstix. then I run the bootloader program and it to the avr it goes. That's the easiest solution with the least headaches...You could try to put a compiler on the gumstix but you would need to jimmy with the system to boot of of a mmc or compact flash card instead of the on-board flash.

As for the servos, I'd recommend a serial servo controller or something like that.
I'm only using 3 servos on my robot (steering, scanning, esc) so I don't have to worry about this.
Another option would be to make some i2c servo controllers out of some mega8's and then you can controll them from the gumstix i2c bus and any thing that needed more processing (a2d or such)
you can put on the robostix and controll though i2c as well.

I'm almost done with my RTOS controller(running on the robostix) that my AI(on the gumstix) is going to talk to through i2c and I can send you the code if you like.
« Last Edit: December 16, 2006, 03:01:21 PM by JesseWelling »

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #13 on: December 16, 2006, 03:57:26 PM »
I decided on taking dunks idea of using an avr bootloader with easyradio . . . bluetooth is out of the question because it will all be underwater (2.5ghz is absorbed really well by water).

Ive still havnt built it yet, but its all designed and parts ordered (finally!).

I looked into the serial servo controllers, but they dont do more than 8 or 16 tops. I needed 22 controllable servos . . . I understand there is some kind of 'up to 128' daisy chain features for servo controllers, but couldnt find any that also had source code . . .

I decided to just use a simple shift register IC to control the servos:
http://www.fairchildsemi.com/ds/74/74F676.pdf

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #14 on: March 08, 2007, 02:34:26 PM »
after like 6 months of working on this, im finally building the darn thing. all the basic stuff is programmed and working, but now i want to add in the wireless stuff.

so im wiring in the easy radio transceiver module and just want to double check on this:

the Tx pin of the AVR goes to pin 6 (Serial Data In) of the easy radio module
and the Rx pin goes to pin 5 (Serial Data Out)
right?

and im right when i say i dont need to use pins 3, 4, and 7 on the module, correct? when should I need to use those pins?

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
    • Surveyor Robotics Journal
Re: bluetooth controlled robots
« Reply #15 on: March 08, 2007, 03:17:53 PM »
That looks right.  The only reason for the other signals would be if you needed hardware flow control in the comm link - at 19.2kbps, that's not likely to be an issue.

You might want to monitor pin 3 - RSSI - that's a signal strength measure, though unfortunately a  analog voltage.  Because signal strength will likely be an issue in your environment, it would be useful to be able to check it, though you could run this check on the host side.
Surveyor Corporation
  www.surveyor.com

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: bluetooth controlled robots
« Reply #16 on: March 09, 2007, 07:10:04 AM »
i think from memory you want to connect Host Ready Input (pin 7) to ground as well.
run your comms package (Hyperterminal or whatever you are using) with no flow controll.

dunk.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #17 on: March 09, 2007, 08:14:58 AM »
RSSI is analog!? perfect! (although im very limited on available ADC)

so if my vehicle starts having poor communication issues, i can have it surface until the problem goes away :D

might even work as a neat way to keep the robot fish from swimming away from home base (if signal is too weak, alter course, etc.)

yeap Dunk your memory is still good, I checked and the datasheet says 'The ‘Host Ready Input’ should be tied to 0 Volt (Ground) if not used.'

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #18 on: May 18, 2007, 02:29:26 PM »
Suppose I wanted my Easy Radio transceiver to communicate to my PC through USB, what do you think the easiest way would be for me?

Im sure there is some adapter with software that I can just buy and quickly wire up.

They offer a schematic for Easy Radio to serial on page 15 but i just dont want to deal with all that wiring . . . USB also has the additional benefit of stealing power from my laptop to power the transceiver.

btw what is the signal from the Easy Radio called before I ask any more potentially dumb questions? Serial Data Ouput? TTL? rs232? Sooooo much I still need to learn :-\

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
    • Jon's Place
Re: bluetooth controlled robots
« Reply #19 on: May 18, 2007, 02:48:27 PM »
You would need a USB -> TTL chip, like an FT232. You can buy breakout boards that have chips like that already on them:

http://www.sparkfun.com/commerce/product_info.php?products_id=199

Or you can make a custom board with that chip on it. I have a board like that I am doing for one of my robots:

http://www.bioloid.info/tiki/show_image.php?id=185

The 28-pin TSSOP chip on the bottom left is an FT232, which lets me talk to the Bioloid bus at 1.0 Mbps over USB.

- Jon

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: bluetooth controlled robots
« Reply #20 on: May 19, 2007, 03:03:34 AM »
there's a schematic here: http://www.robot-electronics.co.uk/htm/rf04tech.htm
or you could buy one here if you wanted an Easy Life (TM): http://www.acroname.com/robotics/parts/R226-RF04-900.html

dunk.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #21 on: May 21, 2007, 07:43:25 AM »
lol, hmmmm the 'Easy Life' is a bit cost prohibitive by comparison. I also already have a few ER modules on me.

I think Ill go with Jons suggestion for the spark fun CP2103.

Quick question. The datasheet wasnt entirely clear on this, and I just want to verify.

I can power the breakout board through serial 5V, and power the Easy Radio by the 3.3V pin, no?

And for this application I can ignore that middle row of 8 holes, right? I notice both the ER and the breakout board both have RTS and CTS pins, so I guess I should use those . . . but otherwise?

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
    • Jon's Place
Re: bluetooth controlled robots
« Reply #22 on: May 21, 2007, 08:35:40 AM »
The 5v pin is capable of driving 500 mA. The 3.3 volt pin is capable of driving 100 mA.

Yes, you can ignore those 8 pins, and only pay attention to the five you need - Ground, Tx, Rx, and the two power pins. Unless you're doing really fast serial transmission, you really don't need hardware flow control.

- Jon

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #23 on: June 19, 2007, 09:39:49 AM »
My noob-ness continues . . .

So I am sending data out of my ATmega644 uart TX line. I scoped it and its sending data correctly.
In my make file I have F_CPU set to 1000000, I am using the default AVR internal oscillator and default fuses, and have baud set to 19200 in uart.h
(Im using AVRlib)

Unfortunately, when scoping the output of the easy radio (both pins of the antenna), I just get squiggley lines (no square waves). My recieving end (easy radio attached to sparkfun TTL to USB converter) remains high on the RX line . . .

Ideas on what Im doing wrong?

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: bluetooth controlled robots
« Reply #24 on: June 19, 2007, 10:51:30 AM »
Am not an EE but here goes:

I'm assuming these are the babies that you are using:
http://www.robotshop.ca/PDF/easy-radio-datasheet-2.3-sept-05.pdf
There are actually two versions, an old one and an "02" one.

Are you wiring the CTS (BSY pin) and RTS (RDY pin) of the Easy Radio module? See page 8. If the communication is only one way, ie the robot always sending and the remote computer always receiving, you might want to temporarily pull-down the BSY and RDY pins of the module (at least for testing).

If the F_CPU and baud rate is incorrect you will still be able to receive something over the radio, even if it's only garbage. Though you should try to verify if your oscillator is indeed running 1MHz and that there are no clock divisors enabled. But as you said its sending data correctly so this might not be the issue.

BTW, on page  12 it says that Data is inverted. You might need to account for that.
« Last Edit: June 19, 2007, 11:01:49 AM by rgcustodio »
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: bluetooth controlled robots
« Reply #25 on: June 19, 2007, 11:35:51 AM »
Quote
Are you wiring the CTS (BSY pin) and RTS (RDY pin) of the Easy Radio module? See page 8. If the communication is only one way, ie the robot always sending and the remote computer always receiving, you might want to temporarily pull-down the BSY and RDY pins of the module (at least for testing).
I have RTS grounded, and CTS is already low (its an output, so I shouldnt ground it anyway).

Quote
that there are no clock divisors enabled
I have the fuse called 'Divide clock by 8 internally; [CKDIV8=0]' checked by default . . . are you saying I should uncheck this box?

Quote
BTW, on page  12 it says that Data is inverted. You might need to account for that.
hmmm so the uart is high and only goes low when it sends data . . . not sure how to see if anything is inverted . . .

Offline Eco19R

  • Full Member
  • ***
  • Posts: 104
  • Helpful? 0
Re: bluetooth controlled robots
« Reply #26 on: June 19, 2007, 12:21:02 PM »
hey Admin - sorry to be bothering you but once you get this figured out - could you post a tutorial regarding setting up wireless communication and reprogramming?

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: bluetooth controlled robots
« Reply #27 on: June 19, 2007, 12:25:11 PM »
Quote
I have the fuse called 'Divide clock by 8 internally; [CKDIV8=0]' checked by default . . . are you saying I should uncheck this box?
IIRC "0" means programmed (or enabled). So given your current oscillator settings in the fuse bits, you need to divide it by 8 and set that value as the F_CPU. So if your fuse bit settings for the oscillator is 8MHz, you'll be internally running 1MHz when the this setting is enabled.

If all of your current settings, oscillator 8MHz and the clock divisor is enabled, your F_CPU is then correct, so you won't need to uncheck this setting.

Quote
hmmm so the uart is high and only goes low when it sends data . . . not sure how to see if anything is inverted . . .
It'll be hard unless you have a DSO or a logic analyzer. At least with a DSO you can save captured data and check/analyze it on a PC using the DSO's software.

Are you receiving anything from on the host side? (Even if it's garbage?)
« Last Edit: June 19, 2007, 12:34:54 PM by rgcustodio »
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: bluetooth controlled robots
« Reply #28 on: June 19, 2007, 12:34:56 PM »
**rgcustodio posted wile i was writing this so apologies for some overlap...**

Quote
Unfortunately, when scoping the output of the easy radio (both pins of the antenna), I just get squiggley lines (no square waves). My recieving end (easy radio attached to sparkfun TTL to USB converter) remains high on the RX line . . .
yup. that's the expected behaviour.

Quote
I have the fuse called 'Divide clock by 8 internally; [CKDIV8=0]' checked by default . . . are you saying I should uncheck this box?
depends on your oscillator speed. i don't know the ATmega644 but assuming the internal oscillator is running at 8MHz having this fuse set will give you a 1MHz speed.

so i haven't used those modules for a while but i think from memory you need to set the easy radio module to the baud rate you are using.
if i remember correctly the default baudrate of the easyradio units was either 9600 or 19200.
maybe this is different on the newer modules. it was quite a while ago.


if i was trying to debug this i'd do something like this:

1st. on your TTL to USB converter, connect the RX and TX lines without any of the rest of your circuit.
this should create a loop back.
anything you type into hyperterminal should be sent out the TX and return up the RX and appear on your screen.
this confirms your PC and TTL to USB converter are working correctly.

2nd. reconnect one of the easy radio modules to the TTL to USB converter and power up the other one with the RX and TX lines connected.
now you should again get a loopback but this time it's getting looped at the remote radio module.

3rd. next i'd connect your microcontroller to TTL to USB converter the without the radio modules in the way and see if your application works like that.
this will verify that your clock speed is indeed correct.


anyway, good luck with it.

dunk.

Offline gamefreak

  • Supreme Robot
  • *****
  • Posts: 543
  • Helpful? 2
  • Robo-Enthusiast
Re: bluetooth controlled robots
« Reply #29 on: June 21, 2007, 07:06:01 PM »
im a noob so this is probably useless... but: dont micro controllers need to be programmed a certain way? wouldn't you need to have a chip in between the receiver and stamp/processor that "decodes" the signal and turns it into something the stamp/processor can understand?
All hail Rodney, the holy 555 timer
And Steve said: "Let there be lead!"

 


Get Your Ad Here