Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jdgch2009
PostPosted: Apr 21, 2012 - 12:54 PM
Newbie


Joined: Apr 21, 2012
Posts: 4


Would it be possible to communicate between one DE2 board and multiple Atmega8s with USB? (possible v-usb since Atmega8 doesn't offer USB) I'm doing my project and want to see if this is possible before I start actual work.. If this is possible what would be the data transferring speed?
Cheers
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Apr 21, 2012 - 12:59 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62354
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

possible v-usb since Atmega8 doesn't offer USB

You kind of answered your own question there. DE2 is Altera FPGA isn't it? Would it not be easier simply to make some UARTs at that end?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Apr 21, 2012 - 01:00 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

I'd have used the RS485 instead - the v-usb is a way slow and resource hangry.

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
jdgch2009
PostPosted: Apr 21, 2012 - 01:12 PM
Newbie


Joined: Apr 21, 2012
Posts: 4


I want to control many stepper motors (possibly more than 100 stepper motors) with DE2 and use Atmega8 to control each motor. De2 sends control data to each atmega8. This way I can save alot of control pins on DE2. I dont want to make more thn 100 UARTs
 
 View user's profile Send private message  
Reply with quote Back to top
jdgch2009
PostPosted: Apr 21, 2012 - 01:13 PM
Newbie


Joined: Apr 21, 2012
Posts: 4


clawson wrote:
Quote:

possible v-usb since Atmega8 doesn't offer USB

You kind of answered your own question there. DE2 is Altera FPGA isn't it? Would it not be easier simply to make some UARTs at that end?




I want to control many stepper motors (possibly more than 100 stepper motors) with DE2 and use Atmega8 to control each motor. De2 sends control data to each atmega8. This way I can save alot of control pins on DE2. I dont want to make more thn 100 UARTs
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Apr 21, 2012 - 01:17 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62354
Location: (using avr-gcc in) Finchingfield, Essex, England

Then do what MBedder said and use RS485 - one (possibly a handful?) of UARTs at the host end and many slave devices that respond to an addressing mechanism sent in-band.

The other option might be I2C (which Atmel call TWI).

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
MBedder
PostPosted: Apr 21, 2012 - 01:51 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

jdgch2009 wrote:
I want to control many stepper motors (possibly more than 100 stepper motors) with DE2 and use Atmega8 to control each motor. De2 sends control data to each atmega8. This way I can save alot of control pins on DE2. I dont want to make more thn 100 UARTs
In this case you do not need 100 UARTS nor RS485. A single DE2 UART (or I2C) sends address and command/parameter to all Mega8's, and only one Mega which has recognized its address, performs the requested action. Forget about USB.
 
 View user's profile Send private message  
Reply with quote Back to top
DocJC
PostPosted: Apr 21, 2012 - 02:09 PM
Raving lunatic


Joined: Dec 11, 2007
Posts: 6851
Location: Cleveland, OH

Unless you neeed feedback from the micros driving the stepper motors to confirm that it received the command.

Then you are back to RS485.

JC
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
MBedder
PostPosted: Apr 21, 2012 - 02:40 PM
Raving lunatic


Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia

I2C will handle the feedback as well.

_________________
Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Apr 21, 2012 - 03:00 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 25921
Location: Wisconsin USA

Hmmm--it brings an automotive network to mind. CAN?

Even with a USB-enabled AVR wouldn't the master then need to be a 100-port "hub"?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Apr 21, 2012 - 03:34 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62354
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

Hmmm--it brings an automotive network to mind. CAN?

But then he's going to need 100 CAN tranceivers to add to the mega8's. I assume (I know) he was looking for a soft solution? Even RS485 is going to cost electronics.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
Lennart
PostPosted: Apr 21, 2012 - 04:05 PM
Raving lunatic


Joined: Oct 29, 2006
Posts: 2758
Location: Sweden

Knowing how far apart those motors are might exclude some of the options. And total expected length of wire.
Also if the connections will be star-shape or serial.
 
 View user's profile Send private message  
Reply with quote Back to top
jdgch2009
PostPosted: Apr 21, 2012 - 04:09 PM
Newbie


Joined: Apr 21, 2012
Posts: 4


I was thinking I2c but only problem was it's max speed is only 400kHz for atmega8. My project partner is developing SPI way and I'm looking for other solutions and I was wondering if USB is a possible solution
 
 View user's profile Send private message  
Reply with quote Back to top
DocJC
PostPosted: Apr 21, 2012 - 04:40 PM
Raving lunatic


Joined: Dec 11, 2007
Posts: 6851
Location: Cleveland, OH

Quote:
I was wondering if USB is a possible solution


Not worth it, but technically possible.
For USB there needs to be a Master, such as a PC, and the remote devices which plug into the USB bus, (such as a thumb drive, etc.).

There are some chips with (limited, OTG, USB Master capability). One could also use a stand-alone chip to be the USB Master, (which then needs non-USB serial comm's to the main micro).

Also, if you use USB you must use appropriate cabling. This can also significantly increase the cost. There are also limits on the length of a USB cable which could be exceeded given your 100 remote devices.

Bottom line, there ARE many good options for connecting the micro to a large collection of remote devices, but in this case USB is at the bottom of the list.

JC
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Kun.io
PostPosted: Apr 21, 2012 - 06:05 PM
Hangaround


Joined: Feb 09, 2012
Posts: 223


I agree with DocJC.

Also, if you use V-USB, you still need a few extra components, and the software implementation is slow. So it won't much faster than the 400kHz of the I2C.
 
 View user's profile Send private message  
Reply with quote Back to top
westfw
PostPosted: Apr 21, 2012 - 10:04 PM
Resident


Joined: Jun 19, 2002
Posts: 957
Location: SF Bay area

Quote:
I was thinking I2c but only problem was it's max speed is only 400kHz for atmega8.

Note that V-USB is low-speed USB which will probably be slower than 400kHz once you include protocol overhead.

You might look at DMX512 (http://en.wikipedia.org/wiki/DMX512 ), which is normally used to tie up to 512 lights (ie for theater) to a controller, using convenient wiring. That gets you back to rs485 for the physical layer (unless you ignore the physical layer as much a V-USB ignores the physical layer of USB...) the advantage would be that there is probably significant amounts of exitsing DMX512 code for AVR...
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits