Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: dellagd on May 07, 2009, 06:00:59 AM
-
I think it would be coon to have a mod that can connect to a PC via USB and take commands from it. this mod would be a master. the point would be so that you could easily change I2C addresses. the only problem I see is that I have no program that can interface with a device by directly manipulating the usb data + and data - wires. with this you could also send commands like "get value of IR sensor form I2C device 14250201"
(http://www.bealecorner.org/best/measure/USB/USB-cable-wiring.png)
any thoughts?
-
Something like this will work:
http://www.acroname.com/robotics/parts/R286-USB-I2C.html (http://www.acroname.com/robotics/parts/R286-USB-I2C.html)
-
thats a little too pricy
-
yep, that's the way they make em...
unfortunately a chip will always be required to interface uc with pc 8)
i will look into chips able to do this a bit later... and maybe look at designing a later module...
as computer debugging would be heaps easier!
-
what I want is to have a ATTiny and have that as a master on the TWI network.
this could then be connected to a computer via UART.
-
you may want something a bit bigger, maybe mega8/168? just for the sake of it?
-
well then I'll be using a $50 board
-
yeah, that could work... take a look at the chip that arduino/roboduino use...
-
you may want something a bit bigger, maybe mega8/168? just for the sake of it?
What's the point? For prototyping and test you could use a bigger MCU, but for "production" I don't see the point of using something bigger that a ATTiny (much cheaper and smaller package)
You will only need 4 pins!! and the MCU will basically forward the command from serial to I2C and then the answer back to serial. No processing is required AFAIK.
Hell you don't even need storage! Atmega is overkill in this situation as far as I know.
Chelmi
-
I was thinking we need another few good examples of modules the meet specifications and work great. So my move is over and its time for me to get off my lazy butt and do something. I started research today on building a cost effective USB to I2c module and an Ethernet to I2C module. However they will require SMD components as I have yet to find something that complex in a dip. But its a reality we live in these days. I plan on it being a pass through device and the USB connection working like a virtual serial port so you just connect with hyperterminal and type commands. Something more complex may arise later.
-
Aselith, please use the same USB chip Axon uses, so there is no need for a second or even third driver, if you also have Arduino driver installed. Also it would be a good idea to research the commands that other manufacturers have so we can use a similar approach. I can offer help hardware wise, but not software wise.
-
Already planning on it. Ordering samples from them tonight. I might have to fake them out and send them to my work place to get them for free. But I can order straight from the manufacturer for $2 cheaper then sparkfun has them. In single quantities so someone is making money.
Edit: The same company makes an ethernet chip that might work out good. The hope is to get my ear wet with the USB one then work up to the ethernet one as it will be complicated. With the ethernet one working good it would open the way for those crazy people who rewrite firmware for routers to make cool robots out of wifi routers.
Edit #2: So I'm looking at the datasheet for the ATMEGA16U4 and drooling. RobotX I might have to forgo the chip admin used as this will cut my BOM by a 4th at least. The USB chip alone was $4 this one is like $2.50 from digikey and I don't need to buy another MCU. Still doing research to see if it is a good option or not.
-
Asellith,
that is what I am doing!
Well, I am building a TWI master that will do things based on data from a computer.
so like "hit 1 to change slave address" "enter current slave address:" "enter new slave address"
or "hit 2 to get data from slave""enter slave address""what data would you like to pool from slave"
-
USB chip from the Axon? That will be a PITA to solder :-\
-
USB chip from the Axon? That will be a PITA to solder :-\
oh god, you said it brother!
-
Asellith,
that is what I am doing!
Well, I am building a TWI master that will do things based on data from a computer.
so like "hit 1 to change slave address" "enter current slave address:" "enter new slave address"
or "hit 2 to get data from slave""enter slave address""what data would you like to pool from slave"
do you think I can write code for this?
-
for the pc side it would not be too hard if you can program,
on the robot side, it will be harder, that's for sure.
-
Wouldn't the Axon or any main board with usb be capable of this with the right firmware? Could even make it so you can turn it on and off just use one line of I/O and put a switch on it? I do like the ethernet idea though.
-
yes, the axon has 4 uart i think? as long as the main chip has uart capabilities it would be fine, you would just need to hook up the uart-pc chip and go...
-
Wouldn't the Axon or any main board with usb be capable of this with the right firmware? Could even make it so you can turn it on and off just use one line of I/O and put a switch on it? I do like the ethernet idea though.
You are absolutelly right. Also Arduino or Roboduino are capable of the same thing. All we need is the program that will transform the Axon into a I2C interface for the PC. But even so, a small nice module that is only USB-I2C interface will be great since sometimes we will need to read from the PC sensors and control motors on the I2C bus without an Axon or Roboduino. It's a pitty to use any of these powerfull controllers for such a small task.
-
plus, it will be better to spend ~$20 instead of $130 for a simple I2C-pc module...
-
http://www.acroname.com/robotics/parts/R286-USB-I2C.html (http://www.acroname.com/robotics/parts/R286-USB-I2C.html)
could have sworn it was from sparkfun
-
you will want something like this to connect from uart to usb http://www.sparkfun.com/commerce/product_info.php?products_id=650 (http://www.sparkfun.com/commerce/product_info.php?products_id=650)
i think this is the one, or similar to the one arduino uses...